Jump to content

MySQL + PHP Help needed in relation to calling up a Quicktime file


Mr Rich UK

Recommended Posts

Good morning,

 

Been meaning to joint this forum for some time as I am a kind of beginner to combining PHP and MySQL, and I now have got to the point where I am slightly stuck.

 

What I have already achieved, which was quite simple, was creating a table of thumbnails and titles for films being called from the database.

 

Now, what I want to achieve with this is being able to click on the thumbnail or title and then this goes to a new page where the quicktime is shown.

 

So in the database the fields I have for each film are id, title, pic_url (for the thumbnail), vid_url (where quicktime is stored and so on.

 

So here is the section from the index.php page which contains the table to show you how I have done things:

 

<td align="left"><a href="view_film.php?id=' . $row['id'] . '"><img src="' . $row['pic_url'] . '" alt="" name="" width="100" height="75" border="0"></a></td>
<td align="center"><a href="view_film.php?id=' . $row['id'] . '">' . $row['client'] . '<br />' . $row['title'] . '</a></td>

 

So as you can see, this calls the thumbnail and the name of the film, and both are links to the view_film.php page where we are going to use the id of the record in the database to call the vid_url in the page.

 

Now, what I am struggling with is how to call the quicktime, display is in the next page

 

<?php
include '1.php';

if ( (isset($_GET['id'])) && (is_numeric
($_GET['id'])) ) { //accessed through main page
$id = $_GET['id'];
} else { // NO valid ID, kill script.
echo '<h1>Page Error</h1>
<p>This page has been accessed in error.</p><p><br /><br /></p>';
include ('2.php');
exit();

require_once ('mysql_connect.php');

$query = "SELECT vid_url, id FROM films WHERE id=$id"; $result = @mysql_query ($query);if ($result) {

echo '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="320" height="255">
      <param name="SRC" value="' . ['vid_url'] . '">
      <param name="CONTROLLER" value="true">
      <param name="scale" value="Aspect">
      <param name="AUTOPLAY" value="true">
      <param name="border" value="0">
      <param name="target" value="webbrowser">
      <param name="href" value="">
      <param name="bgcolor" value="#000000">
      <embed src="' . ['vid_url'] . '" width="320" height="255" border="0" autoplay="true" scale="Aspect" pluginspage="http://www.apple.com/quicktime/download/" target="webbrowser" controller="true" bgcolor="#000000" href=""></embed>
    </object>';

mysql_free_result ($result);  } else {  echo '<p class="error">Sorry it cannot be displayed.</p>';  echo '<p>' . mysql_error() . '<br />  <br />Query: ' . $query . '</p>';  }    


mysql_close();   

include '2.php';?>

 

What I don't understand is when I go to this page, it gets the id of the film correct as the URL in the address bar ends php?id=1    but nothing is being displayed on the page.  Not even the 1.php file which contains the page head.

 

Does anyone have any ideas or can see where I am going wrong?  This would be greatly appreciated as my head is sore for being scratched too much now.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.