Total Pageviews

Tuesday, April 5, 2011

view the uploaded video in js also

?php
$con=mysql_connect('localhost','root','');
mysql_select_db('videodb',$con);

if(isset($_REQUEST['submit']))
{
$uploaddir = 'uploads/';
$uploadfile = $uploaddir.basename($_FILES['uploadedfile']['name']);
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
}
else {
echo "File uploading failed.\n";
}
mysql_query("insert into videoview (id,video,status) values ('','".$_FILES['uploadedfile']['name']."','y')");
}
?>

form enctype="multipart/form-data" action="upload1.php" method="POST">
input type="hidden" name="post_max_size" value="60531648" />
Choose a file to upload:
input type="submit" name="submit" value="Upload File" />
/form>

script src='includes/swfobject.js' type='text/javascript'>


?php
$rk=mysql_query("SELECT * FROM `videoview` order by id desc limit 1");
$kk=mysql_fetch_array($rk);

echo $kk['video'];
?>
div id='flvplayer'>
script type='text/javascript'>
var so = new SWFObject('mpw_player.swf', 'swfplayer', "400", "327", "9", "#000000"); // Player loading
so.addVariable("flv",""); // File Name
so.addVariable("jpg","trusted.jpg"); // Preview photo
so.addVariable("autoplay","false"); // Autoplay, make true to autoplay
so.addParam("allowFullScreen","true"); // Allow fullscreen, disable with false
so.addVariable("backcolor","000000"); // Background color of controls in html color code
so.addVariable("frontcolor","ffffff"); // Foreground color of controls in html color code
so.write("flvplayer"); // This needs to be the name of the div id
/script>

No comments:

Post a Comment