469,925 Members | 1,519 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,925 developers. It's quick & easy.

How to launch embedded video listed in MYSQL via PHP script

1
Trying to launch my flash videos by passing their URL listed in a field on MYSQL via PHP script. Any help is greatly appreciated.

1) I am able to launch the video referenced directly in main page...for example:
launch_video.php
Expand|Select|Wrap|Line Numbers
  1. printf("Movie %s: <a href='http://.../embedded_flash_video.html'>%s</a>
and 2) I can print the URL as output from server via PHP script...for example:
launch_video.php
Expand|Select|Wrap|Line Numbers
  1. printf("Movie %s: <a href='send_link.php?id=%s'>%s</a>
(where the 'link' value from database in this case is "http://.../embedded_flash_video.html")


send_link.php:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. //.........connect....
  4.  
  5.   $id = mysql_real_escape_string($_GET['id']);
  6.  
  7.   $query = "SELECT id, movie, link FROM vid WHERE id='$id'";
  8.  
  9.   $result = mysql_query($query);
  10.  
  11.   // If results are found, output them
  12.   if (mysql_num_rows($result) > 0) {
  13.  
  14.     $row = mysql_fetch_array($result);
  15.  
  16.     // Convert HTML entities prior to displaying
  17.     printf("%s", (htmlentities($row['link'])));
  18.  
  19.  
  20.   } else {
  21.     printf("Failed");
  22.   }
  23.  
  24. ?>
  25.  

But I do not know how to update the PHP script to pass the URL (link) for the selected id in the proper manner (with the result of launching the video as in #1 above) as opposed to printing the URL (link) when the href is clicked.

Thanks
Apr 4 '08 #1
1 1794
pbmods
5,821 Expert 4TB
Heya, Ernest. Welcome to ICB!

Too bad this isn't a Mac question. Then I could welcome you to ICB(M)!

Anyway, does the link point to an HTML page or directly to a .flv, etc.?
May 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Jussi Rasku | last post: by
8 posts views Thread by chrisdude911 | last post: by
6 posts views Thread by xhunter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.