PHP Video Page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
evanleondawod
Forum Newbie
Posts: 8
Joined: Sat Mar 28, 2009 1:04 pm

PHP Video Page

Post by evanleondawod »

Hi,

I have created this page that should play a video from a remote folder and also display other details about the video (eg. Author, Description, Date).

When i Use this code it stops the page from loading fully and also shows no video or video name.

When i delete the while loop in the middle the page loads. But still no PHP elements.

Can you give me some advice or point me in the right direction?

Code: Select all

 
<?php
require("connection.php");
$thevid = $_GET['u'];
$db = mysql_query("SELECT * FROM videos WHERE title = '$thevid'"); // use the defined username to filter the SELECT statement - should only come out with 1 result
?>
<div id="bodyPanel">
        <table width="900">
          <tr>
            <td width="600">
            <h1> <? while($details = mysql_fetch_array( $db )){ 
               echo $details['title'];
             ?>
            </h1>
            <p>
             <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" WIDTH="600" HEIGHT="300" >
             <PARAM NAME="src" VALUE=" <? echo $thevid; ?> ">
             <PARAM NAME="autoplay" VALUE="true" >
             <EMBED SRC="QTMimeType.pntg" TYPE="image/x-macpaint" PLUGINSPAGE="http://www.apple.com/quicktime/download" QTSRC=" <? echo $thevid; ?> " WIDTH="600" HEIGHT="300" AUTOPLAY="true" > </EMBED>
             </OBJECT>
            </p>
            <h2>Comments</h2>
            </td>
            <td width="300">
              <h2>Uploaded by</h2>
              Author: <? echo $details['author']; ?> <br /><br />
              Date: <? echo $details['date']; ?> <br /><br />
              Description: <? echo $details['title']; ?> <br /><br />
        <h2>Related Videos</h2>       
        <? } ?>
             <p>
             
             </p>
    </td>
          </tr>
        </table>
    </div>
 
User avatar
angelicodin
Forum Commoner
Posts: 81
Joined: Fri Nov 13, 2009 3:17 am
Location: Oregon, USA

Re: PHP Video Page

Post by angelicodin »

I'm new so please keep that in mind.
Try this:

Code: Select all

<?php
$db = mysql_query("SELECT * FROM videos WHERE title = '".$thevid."'"); // use the defined username to filter the SELECT statement - should only come out with 1 result
?>
Remember to escape the string (not sure if that's the right wording). Before it was reading $thevid as "$thevid" and not the data of that variable. If that helps awesome, if not let me/us know.
Post Reply