![Aplauso](http://static.forosdelweb.com/fdwtheme/images/smilies/aplausos.gif)
Trabajo de manera local ..uso Appserv 2.59, MySQL y Win XP
Mi tabla para almacenar el Video es la siguiente
Código:
este es el Formulario para subir el Video se llama Form2.htmlCreate table VIDEO ( codigo_video Int NOT NULL, video_nombre Varchar(100), Primary Key (codigo_video)) ENGINE = MyISAM;
Código HTML:
<html> <head> <title>Documento sin título</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table border=0 width="600" cellpadding=3 cellspacing=0 align="center"> <tr> <td width="600" colspan=2> <table border=0 cellspacing=0 cellpadding="0" width="100%"> <tr> <td class="navbaron"><img src="images/video.jpg" width="31" height="30" align="absmiddle">Selecciona Video a Insertar</td> </tr> </table><br /> <table width="600" border="0" cellpadding="3" cellspacing="1" align="center"> <FORM enctype="multipart/form-data" method="post" action="Insert2.php" name="form1" onSubmit="return validar(this)"> <tr> <td colspan=2><p><strong>Video:</strong> <input type="file" name="archivo" size="30" style="border: 1px solid #7F9DB7;"> <input type="submit" value="Subir Video" name="enviar"> </td> </tr> </form> </table><br/> </td> </tr> </table> </body> </html>
Código PHP:
<?php
//establece una conexión con la base de datos.
include("Conexion.php");
// archivo temporal (ruta y nombre).
$temp=$_FILES["archivo"]["tmp_name"];
// Obtener del array FILES (superglobal) los datos del binario .. nombre, tabamo y tipo.
$nom=$_FILES["archivo"]["name"];
//coloco / muevo el archivo a la carpeta "otra"
move_uploaded_file($temp,"otra/".$nom);
//Archivo Max Codigo
$query_arch=mysql_query("SELECT Max(codigo_video) AS arch FROM video") or die ("Error SQL Video");
$data_arch=mysql_fetch_array($query_arch);
$max_arch=$data_arch[arch];
$maxi_arch=$max_arch+1;
//insertamos los datos en la BD.
$sql="INSERT INTO video VALUES('$maxi_arch','$nom')";
mysql_query($sql,$DB) or die ("No se pudo insertar los datos en la base de datos.");
include("close_conexion.php");
header("location: NewFC_Oseo.php");
?>
Código HTML:
<EMBED TYPE='application/x-mplayer2' SRC='otra/xxxx' WIDTH='280' HEIGHT='250'></EMBED>
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
Código HTML:
<html> <head> <title>Documento sin título</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="290" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"> <OBJECT ID='MediaPlayer' WIDTH='280' HEIGHT='250' CLASSID='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject'> <PARAM NAME='FileName' VALUE='' valuetype='ref' ref> <param name='AudioStream' value='1'> <param name='AutoSize' value='0'> <param name='AutoStart' value='-1'> <param name='AutoRewind' value='0'> <param name='BufferingTime' value='5'> <param name='ClickToPlay' value='-1'> <param name='VideoBorderColor' value='333333'> <param name='VideoBorder3D' value='-1'> <param name='Volume' value='-1'> <param name='WindowlessVideo' value='-1'> <EMBED TYPE='application/x-mplayer2' SRC='otra/' WIDTH='280' HEIGHT='250'></EMBED> </OBJECT>"; </td> <td>.::Ingrese Video::.<a href="Form2.php"><img src="images/video1.gif" width="31" height="30" border="0" align="absmiddle" title="Nuevo Video"></a></td> </tr> </table> </body> </html>