| | |
Run Video File in browser
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
hi nil
checkout this code which will upload only avi,dat,mpg and wmv video files only create uplodedvideos in ur folder
checkout this code which will upload only avi,dat,mpg and wmv video files only create uplodedvideos in ur folder
php Syntax (Toggle Plain Text)
if($_SERVER['REQUEST_METHOD']=='POST') { if($HTTP_POST_FILES["video"]["size"] >1) { // for large image 1 $ext = substr($HTTP_POST_FILES['video']['name'],strpos($HTTP_POST_FILES['video']['name'],'.')+1); $ext_arr=array("avi","dat","mpg","wmv"); //if (in_array($ext,$ext_arr)) { $prlvideo=substr($HTTP_POST_FILES['video']['name'],0,strpos($HTTP_POST_FILES['video']['name'],'.')); $prlvideo.=time(); $prlvideo.=strstr($HTTP_POST_FILES['video']['name'],'.'); $prlvideo="uplodedvideos/".$prlvideo; if(!move_uploaded_file($HTTP_POST_FILES['video']['tmp_name'],$prlvideo)) { $prlvideo=""; } chmod($prlvideo,0777); } else { $prlvideo=""; } $v = substr($HTTP_POST_FILES['video']['name'],strpos($HTTP_POST_FILES['video']['name'],'.')+1); if($v=='avi' || $v=='dat' || $v=='mpg' || $v=='wmv') { $qry2="INSERT INTO vdo_cat(`c_name`,`videos`,`parent_id`)VALUES ('".$_POST['txtsubcategory']."','".$prlvideo."','".$_POST['selcategory']."')"; $res2=mysql_query($qry2) or die(mysql_error()); if($res2==1) { header("location:manage_videos.php?msg=ad"); } } else { $vmsg="You must upload only videos...."; } }
Failure is success if we learn from it
•
•
•
•
hi nil
checkout this code which will upload only avi,dat,mpg and wmv video files only create uplodedvideos in ur folder
php Syntax (Toggle Plain Text)
if($_SERVER['REQUEST_METHOD']=='POST') { if($HTTP_POST_FILES["video"]["size"] >1) { // for large image 1 $ext = substr($HTTP_POST_FILES['video']['name'],strpos($HTTP_POST_FILES['video']['name'],'.')+1); $ext_arr=array("avi","dat","mpg","wmv"); //if (in_array($ext,$ext_arr)) { $prlvideo=substr($HTTP_POST_FILES['video']['name'],0,strpos($HTTP_POST_FILES['video']['name'],'.')); $prlvideo.=time(); $prlvideo.=strstr($HTTP_POST_FILES['video']['name'],'.'); $prlvideo="uplodedvideos/".$prlvideo; if(!move_uploaded_file($HTTP_POST_FILES['video']['tmp_name'],$prlvideo)) { $prlvideo=""; } chmod($prlvideo,0777); } else { $prlvideo=""; } $v = substr($HTTP_POST_FILES['video']['name'],strpos($HTTP_POST_FILES['video']['name'],'.')+1); if($v=='avi' || $v=='dat' || $v=='mpg' || $v=='wmv') { $qry2="INSERT INTO vdo_cat(`c_name`,`videos`,`parent_id`)VALUES ('".$_POST['txtsubcategory']."','".$prlvideo."','".$_POST['selcategory']."')"; $res2=mysql_query($qry2) or die(mysql_error()); if($res2==1) { header("location:manage_videos.php?msg=ad"); } } else { $vmsg="You must upload only videos...."; } }
Thanx for ur attention...........But my problem is how to display uploaded videos in any browser using WM player
hi,
here is the code for displaying videos for the code above
when user clicks on play videos will play in a window in my program (see above... 'pid' )
it worked fine for me
here is the code for displaying videos for the code above
php Syntax (Toggle Plain Text)
<? include_once('functions.php'); include_once('conn.php'); if(!empty($_GET['pid'])) { $pqry="SELECT * FROM vdo_cat where c_id=".$_GET['pid']; $pres=mysql_query($pqry) or die(mysql_error()); $prow=mysql_fetch_array($pres); $len=strrpos($prow['videos'],'.'); $vtype=substr($prow['videos'],$len+1,5); echo $vname=($prow['videos']); if(isset($vtype)) { ?> <html> <link href="site.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)"> <body> <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#83CBED"> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td align="center" valign="middle"><object id="MediaPlayer1" width="180" height="200" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject" align="middle"> <param name="FileName" value="video path/<?=$vname; ?>"> <param name="ShowStatusBar" value="True"> <param name="DefaultFrame" value="mainFrame"> <param name="autostart" value="false"> <embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" src="../banjara_admin/videos/<?=$vname; ?>" autostart="false" align="middle" width="176" height="144" defaultframe="rightFrame" showstatusbar="true"> </embed> </object> <a href="YourFilesName.mpeg"><font size="2">Clickhere for standalone player</font></a> <a href="http://www.microsoft.com/windows/windowsmedia/mp10/default.aspx"> <font size="1">Download Windows Media Player Here</font></a></p></td> </tr> <tr> <td></td><? } }?> </tr> <tr> <td align="center" valign="middle"><a href="#" class="orngsml" onClick="javascript:window.close();" ><strong>Close</strong></a></td> </tr> </table></td> </tr> </table> </body> </html>
it worked fine for me
Failure is success if we learn from it
•
•
•
•
hi,
here is the code for displaying videos for the code above
when user clicks on play videos will play in a window in my program (see above... 'pid' )php Syntax (Toggle Plain Text)
<? include_once('functions.php'); include_once('conn.php'); if(!empty($_GET['pid'])) { $pqry="SELECT * FROM vdo_cat where c_id=".$_GET['pid']; $pres=mysql_query($pqry) or die(mysql_error()); $prow=mysql_fetch_array($pres); $len=strrpos($prow['videos'],'.'); $vtype=substr($prow['videos'],$len+1,5); echo $vname=($prow['videos']); if(isset($vtype)) { ?> <html> <link href="site.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)"> <body> <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#83CBED"> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td align="center" valign="middle"><object id="MediaPlayer1" width="180" height="200" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject" align="middle"> <param name="FileName" value="video path/<?=$vname; ?>"> <param name="ShowStatusBar" value="True"> <param name="DefaultFrame" value="mainFrame"> <param name="autostart" value="false"> <embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" src="../banjara_admin/videos/<?=$vname; ?>" autostart="false" align="middle" width="176" height="144" defaultframe="rightFrame" showstatusbar="true"> </embed> </object> <a href="YourFilesName.mpeg"><font size="2">Clickhere for standalone player</font></a> <a href="http://www.microsoft.com/windows/windowsmedia/mp10/default.aspx"> <font size="1">Download Windows Media Player Here</font></a></p></td> </tr> <tr> <td></td><? } }?> </tr> <tr> <td align="center" valign="middle"><a href="#" class="orngsml" onClick="javascript:window.close();" ><strong>Close</strong></a></td> </tr> </table></td> </tr> </table> </body> </html>
it worked fine for me
You have included function.php do this page compile without this file
nice post
Help as an alias
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
I think programming is great................
Tour Travel weblink by me and about Tour ,
Go To My Home Page and I m in Webdevelopment.
•
•
Join Date: May 2008
Posts: 250
Reputation:
Solved Threads: 20
Why not just use FLV? its a lot simpler and will work in Firefox/Safari as well as IE
P.S. I know you can run WMP plugin in firefox but its an extra download you don't need (Not sure about Safari thoug)
P.S. I know you can run WMP plugin in firefox but its an extra download you don't need (Not sure about Safari thoug)
My Blog, Life and everything that matters to me - SamRudge.co.uk
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
![]() |
Similar Threads
- Recommended Web Hosts (Web Hosting Deals)
- "Buffer run detected" (Viruses, Spyware and other Nasties)
- Browser redirect/about:blank/other problems... (Viruses, Spyware and other Nasties)
- Browser Battle -- Your TOP Pick! (Geeks' Lounge)
- My browser got ambushed by spyware (Viruses, Spyware and other Nasties)
- rpcxwinex.exe and rpcxsys.exe virus' (Viruses, Spyware and other Nasties)
- Unable to execute a video file in browser using Java (Java)
- Rundll32 Problem (Viruses, Spyware and other Nasties)
- Internet connection problem Hijack This logfile (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: Project idea
- Next Thread: everything appears bolded.
| Thread Tools | Search this Thread |
ajax apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error errors execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google href htaccess html image include insert integration ip java javasciptvalidation javascript joomla keywords limit link login loop mail matching menu mlm multiple mysql number oop paypal pdf php problem query radio random recursion recursive regex remote script search server sessions shot sms soap source space sql subscription syntax system table tag tutorial tutorials update upload url validator variable video web xml youtube





