PHP video playback -
i trying video play play database. have form following code:
<form action="abs3xvideos.php" method="post" enctype="multipart/form-data"> <input type="file" name="id" /> <input type="submit" name="submit" value="upload!" /> <form action="abs3xvideos.php"> search abs3x: <input type="search" name="googlesearch"> <input type="submit"> </form>
i have page form linked following code:
<?php error_reporting(e_all); ini_set('display_errors', 1); define('db_name', 'gaufensr_abs3x'); define('db_user', 'gaufensr_owner'); define('db_password', 'password'); define('db_host', 'localhost'); $link = mysql_connect(db_host, db_user, db_password); if (!$link) { die('could not connect:' . mysql_error()); } $db_selected = mysql_select_db(db_name, $link); if (!@db_selected) { die('can\t use' . db_name. ': ' . mysql_error()); } echo 'connected successfully'; $id = $_post['id']; $value = $_post['id']; $sql = "insert videos (video_name) values ('$value')"; if (!mysql_query($sql)) { die(`error: ` .mysql_error()); } if (isset($_post['id'])){ $id = $_post['id']; $query = mysql_query("select * `videos` id='$id'"); while($row = mysql_fetch_assoc($query)) { $id = $row['id']; $video_name = $row['video_name']; } echo "you watching " .$id. "<br />"; echo "<embed src=`$id` width='560' height='315'></embed>"; } else { echo "error!"; } mysql_close(); ?>
i following error message when try upload video using form page created:
connected successfully
notice: undefined index: id in /home1/gaufensr/public_html/abs3xvideos.php on line 39
notice: undefined index: id in /home1/gaufensr/public_html/abs3xvideos.php on line 40 error!
i @ loss. spoke on stackflow earlier , suggested might wrong while loop not sure mistake be. should separate php code different pages maybe?
you forget close form
use
<form action="abs3xvideos.php" method="post" enctype="multipart/form-data"> <input type="file" name="id" /> <input type="submit" name="submit" value="upload!" /> </form>//from close here <form action="abs3xvideos.php"> search abs3x: <input type="search" name="googlesearch"> <input type="submit"> </form>
Comments
Post a Comment