I need help! (should be simple)

Discussion in 'PHP' started by thejared, Mar 12, 2007.

  1. #1
    I am coding a video site and I have a simple form that inputs the video title, avatar, description, date posted, # of views and the YouTube video code for it into my database. Yes, all the videos will come from videos on YouTube. The YouTube embed code looks like this:
    
    <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/[B]VIDEONUMBERHERE[/B]"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/[B]VIDEONUMBERHERE[/B]" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
    
    Code (markup):
    So, where I have placed 'VIDEONUMBERHERE' is where I need to grab the video numbers/letters from the database and input them to the rest of the html code and display it on the page. I cannot get it to work. I have tried something like this:
    
    <?php
    echo '
    "$.row['videocode']."
    ';
    
    ?>
    
    Code (markup):
    If you can help me with this I would be forever grateful, especially if it works!
    Thanks in advance,
    -Jared
     
    thejared, Mar 12, 2007 IP
  2. klown

    klown Peon

    Messages:
    2,093
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    [B]<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/<?php echo $row['videocode']; ?>"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/<?php echo $row['videocode']; ?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>[/B]
    
    Code (markup):
    That should work, assuming that $row['videocode'] contains the correct information.
     
    klown, Mar 12, 2007 IP
    thejared likes this.
  3. thejared

    thejared Peon

    Messages:
    382
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It worked! Thank you SO much! I honestly cannot thank you enough. I have been stuck for a solid week. I added to your reputation.
    thanks
     
    thejared, Mar 12, 2007 IP