Jump to content

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?
Link to comment
https://forums.phpfreaks.com/topic/5472-variable/
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]
Link to comment
https://forums.phpfreaks.com/topic/5472-variable/#findComment-19667
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.