Jump to content


Photo

Variable


  • Please log in to reply
2 replies to this topic

#1 Elorensun

Elorensun
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 22 March 2006 - 03:58 AM

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

first this is my 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>


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?

#2 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 22 March 2006 - 11:19 AM

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.
wisewood: proven fact, I am both wise, and wooden.

#3 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 22 March 2006 - 03:09 PM

[!--quoteo(post=357246:date=Mar 22 2006, 11:19 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ Mar 22 2006, 11:19 AM) View Post[/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:


<?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>

"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users