Jump to content

Archived

This topic is now archived and is closed to further replies.

Elorensun

Variable

Recommended Posts

Hi ... I got a question ... can I insert a variable with a object

first this is my code
[code]<object type="application/x-shockwave-flash" width="400" height="220"
    wmode="transparent data="video/flvplayer.swf?file=video.flv"
  <param name="movie" value="video/flvplayer.swf?file=video.flv" />
  <param name="wmode" value="transparent" />
  </object>[/code]


I want to change video.flv by a variable that I put in my url link...

exemple ?vids=video

I tried a code I got from the forum but did not work... got any suggestion?

Share this post


Link to post
Share on other sites
your_page.php?var=something

$variable = $_GET['var'];

$variable will now be "something"


You can then use <?=$variable?> to insert it into your html object or whatever.

Share this post


Link to post
Share on other sites
[!--quoteo(post=357246:date=Mar 22 2006, 11:19 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ Mar 22 2006, 11:19 AM) [snapback]357246[/snapback][/div][div class=\'quotemain\'][!--quotec--]
your_page.php?var=something

$variable = $_GET['var'];

$variable will now be "something"
You can then use <?=$variable?> to insert it into your html object or whatever.
[/quote]

yep. just to elaborate on that incase youre not sure, you need to put php into your code:


[code]
<?php
$vid = $_GET['vids'];
?>
<object type="application/x-shockwave-flash" width="400" height="220"
    wmode="transparent data="video/flvplayer.swf?file=<?php echo $vid; ?>"
  <param name="movie" value="video/flvplayer.swf?file=<?php echo $vid; ?>" />
  <param name="wmode" value="transparent" />
  </object>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.