How to launch embedded video listed in MYSQL via PHP script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ernest
    New Member
    • Apr 2008
    • 1

    How to launch embedded video listed in MYSQL via PHP script

    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.ph p
    Code:
    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.ph p
    Code:
    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:

    Code:
    <?php
    
    //.........connect....
    
      $id = mysql_real_escape_string($_GET['id']);
    
      $query = "SELECT id, movie, link FROM vid WHERE id='$id'";
    
      $result = mysql_query($query);
    
      // If results are found, output them
      if (mysql_num_rows($result) > 0) {
    
        $row = mysql_fetch_array($result);
    
        // Convert HTML entities prior to displaying
        printf("%s", (htmlentities($row['link'])));
    
    
      } else {
        printf("Failed");
      }
    
    ?>

    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
    Last edited by Ernest; Apr 4 '08, 09:10 AM. Reason: typing error - referenced wrong file in posted code
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    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.?
    Last edited by pbmods; May 29 '08, 12:41 AM. Reason: Changed the joke.

    Comment

    Working...