PDA

View Full Version : Php and Flash Object


raamkum
12-28-2010, 01:12 PM
Hi,

I have youtube video embedded to a php file. I keep uploading new youtube videos always because of this the link also keeps changing and also I need keep editing my php file always.

Instead what I thought was I could create a text file which will have the youtube link for the object and so the php file get the link from text and put in the required place accordingly.

To achieve the above idea below code is what I tried.

<html>
<head>
<title>File read demo</title>
</head>
<body>
<?php
$file = "/home/rambo/public_html/release/knot/text.txt";
$f = fopen($file, "r");
while ( $line = fgets($f, 1000) ) {
print $line;
}

<div align=center>
<object width="960" height="745"><param name="movie" value="<?php echo $line; ?> &amp;hl=en_US&amp;rel=0&amp;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="<?php echo $line; ?> &amp;hl=en_US&amp;rel=0&amp;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="670" height="600"></embed></object>
</div>


</body>
</html>

It gives me a error stating:

Parse error: syntax error, unexpected '<' in /home/rambo/public_html/release/knot/test.php on line 14

I am not sure if
value="<?php echo $line;?>
is correct in the code?

Please let me know the right syntax to solve this issue?

Awaiting your response!
Thanks!

audiopro
01-05-2011, 10:39 AM
value="<?php echo $line;?>

You have a speech mark imbalance and the line needs a ';' at the end.