SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast AimyThomas's Avatar
    Join Date
    Sep 2011
    Posts
    46
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Find the Error while Putting Link in PHP

    Clearly I want to paste the object in the html but the problem is how do I make the php work? How do I put the code in a .php and then link the page to it? do i need to do some sort of src='XYZpage.php' in the html

    <?php

    // Build an array from the list of YouTube videos
    // Replace YourVideoList.txt with the path to your text file
    // This will likely be something like /home/accountname/public_html/foldername/etc
    $video_array = file('YourVideoList.txt');

    // Randomly pick one video from the array
    $video = $video_array[rand(0, count($video_array) - 1)];
    $video = trim($video);

    ?>

    <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/<?php echo $video;? >"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/<?php echo $video;?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Yes. Try that.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •