3 Replies - 483 Views - Last Post: 28 March 2013 - 07:14 PM

#1 patk570  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 13-February 13

Hey guys, Trying to pass a parameter in PHP

Posted 28 March 2013 - 01:47 PM

Hello,

I am trying to pass a parameter in php, Below is my code for what i am trying to do, but it will not work. I keep getting an error for the stupid Ampersand...Let me give you my code..

    echo '<div class="textwidget">';
    echo '<div class="search-title">Video Title: '.$video['title'].'</div>';
    echo '<div class="search-link">';
    echo '<iframe width="560" height="315" src="http://www.youtube.com/v/'.$video['emurl'].'&loop=1" frameborder="0"></iframe>';
    echo '</div>';
    echo '<div class="search-cata">';
    echo '<p>Instructions: '.$video['instructions'].'</p>';
    echo '</div>';
    echo '<br />';
    echo '<br />';
    echo '</div>';




where is says the src code for the Youtube video, the &loop=1 will not work, it just errors out and will not allow the video to loop, says i need to use &amp; but when i do that it will not decode, i even tried to use a new variable to put it in with urldecode(&amp;loop=1) but it didnt work and same with encode.

Any suggestions would be great.

Is This A Good Question/Topic? 0
  • +

Replies To: Hey guys, Trying to pass a parameter in PHP

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5951
  • View blog
  • Posts: 23,214
  • Joined: 23-August 08

Re: Hey guys, Trying to pass a parameter in PHP

Posted 28 March 2013 - 02:16 PM

Unless $video['emurl'] includes a ? you probably need one instead of the &.
Was This Post Helpful? 2
  • +
  • -

#3 patk570  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 13-February 13

Re: Hey guys, Trying to pass a parameter in PHP

Posted 28 March 2013 - 06:50 PM

View PostJackOfAllTrades, on 28 March 2013 - 02:16 PM, said:

Unless $video['emurl'] includes a ? you probably need one instead of the &.


I tired to use a ? in there, Here is the updated code:

http://www.youtube.com/v/'.$video['emurl'].'?loop=1&amp;rel=0


I have seen that rel=0 works but the loop still wont work.

ugh frustrating...

any other ideas?
Was This Post Helpful? 0
  • +
  • -

#4 patk570  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 13-February 13

Re: Hey guys, Trying to pass a parameter in PHP

Posted 28 March 2013 - 07:14 PM

I need to close this out, forgot to add a few variables in there,

Here is how i had to do it:

echo '<iframe width="560" height="315" src="http://www.youtube.com/v/'.$video['emurl'].'?version=3&amp;loop=1&amp;rel=0&amp;autoplay=1&amp;controls=0&amp;showinfo=0&amp;playlist='.$video['emurl'].'" frameborder="0"></iframe>';


Thanks for your help!

Have a good night.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1