Forum Moderators: coopster

Message Too Old, No Replies

using php variable in html

stuck at this point

         

Drunk N Japan

4:34 pm on Apr 17, 2007 (gmt 0)

10+ Year Member



Good Day,
I am working on having an url saved in a mysql database called in an html file. Essentially I would like to be able to just save the URLs of videos and call the URLs from a php file and use that in the html that calls the video.

I have

<?php
include filepath/geturl.php //$code is the variable name for the url
echo $code; //it displays the url I want. All good so far.
?>

<param name="movie" value=$code></param><param name="wmode" value="transparent"></param>
<embed src=$code type="application/x-shockwave-flash" wmode="transparent" width="300" height="247"></embed></object>

Unfortunately I cannot use the variable $code in the html side of things. Is there a better way to do this?

whoisgregg

4:55 pm on Apr 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The variables are only interpreted if they are inside of php tags. Try:

<param name="movie" value="<?php echo $code; ?>"></param><param name="wmode" value="transparent"></param>
<embed src="<?php echo $code; ?>" type="application/x-shockwave-flash" wmode="transparent" width="300" height="247"></embed></object>

Drunk N Japan

5:37 pm on Apr 17, 2007 (gmt 0)

10+ Year Member



Now why didn't I think of that?

Really Thank you! Once I read your reply it seemed obvious.

Chalk another one up to experience.

It's five O'clock somewhere - Jimmy Buffet

Drunk