Saludos foro.
Tengo el siguiente codigo:
Código PHP:
<?php
session_start();
include '../conexion.php';
$con = mysql_connect($bd_host, $bd_usuario, $bd_password);
mysql_select_db($bd_base, $con);
if($_POST['fpon_env']==1) {
//variables POST
$nom=$_POST['nombres'];
$pater=$_POST['paterno'];
$mater=$_POST['materno'];
$inst=$_POST['institucion'];
$pais=$_POST['paises'];
$edo=$_POST['estados'];
$tel=$_POST['tel'];
$fax=$_POST['fax'];
$email=$_POST['email'];
$hoja_v=$_POST['hoja_vida'];
$res_ponen=$_POST['res_ponencia'];
$simposio=$_POST['simposio'];
$tipo_ponencia=$_POST['tipo_ponencia'];
echo "nombre archivo(input)= ".$hoja_v. "<br>";
//Datos del arhivo HOJA DE VIDA
$nombre_archivo = $_FILES[$hoja_v]['name'];
$tipo_archivo = $_FILES[$hoja_v]['type'];
$tamano_archivo = $_FILES[$hoja_v]['size'];
echo "nombre archivo= ".$_FILES[$hoja_v]['name']. "<br>";
echo "tipo archivo= ".$tipo_archivo. "<br>";
echo "tamaño archivo= ".$tamaño_archivo. "<br>";
echo "tipo ponencia= ".$tipo_ponencia."<br>";
if($tipo_ponencia==1){
//compruebo si las características del archivo son las que deseo
//if (!((strpos($tipo_archivo, "docx") || strpos($tipo_archivo, "doc") || strpos($tipo_archivo, "pdf"))){
/*&& ($tamano_archivo < 100000))) { */
//echo "La extensión o el tamaño de los archivos no es correcta. <br><br><table><tr><td><li>Se permiten archivos .gif o .jpg<br><li>se permiten archivos de 100 Kb máximo.</td></tr></table>";
//}
//else{
//move_uploaded_file($HTTP_POST_FILES['archivo']['tmp_name'], $_SERVER['DOCUMENT_ROOT']."/CONANP/Resumen Ponencias/1 Invitado o Conferencista/".$HTTP_POST_FILES['archivo']['name']);
$ruta=$_SERVER['DOCUMENT_ROOT']."/CONANP/Resumen Ponencias/1 Invitado o Conferencista/".$_FILES['hoja_v']['name'];
$temp_name=$_FILES[$hoja_v]['tmp_name'];
echo "ruta= ".$ruta. "<br>";
echo "temp_name= ".$temp_name. "<br>";
//if(move_uploaded_file($temp_name, $ruta)){
//if(move_uploaded_file($HTTP_POST_FILES['hoja_v']['tmp_name'], $_SERVER['DOCUMENT_ROOT']."/CONANP/Resumen Ponencias/1 Invitado o Conferencista/".$HTTP_POST_FILES['archivo']['name']){
//echo "El archivo ha sido cargado correctamente.";
//}
//else{
//echo "Ocurrio algun error al subir el fichero. No pudo guardarse.<br>";
//echo $_FILES['hoja_v']['error'];
//}
//}
}
//registra los datos personales del usuario
$sql="INSERT INTO reg_ponentes (nombres, paterno, materno, institucion, pais, estado, telefono, fax, email, hoja_vida, res_ponencia, simposio) VALUES('$nom','$pater','$mater','$inst','$pais','$edo','$tel','$fax','$email','$hoja_v','$res_ponen','$simposio')";
//mysql_query($sql,$con);
//$_SESSION['last_ID'] = mysql_insert_id();
}
?>
Y me imprime lo siguiente:
nombre archivo(input)= C:\Documents and Settings\E R I K\Mis documentos\Codigo ASCII completo.docx
nombre archivo=
tipo archivo=
tamaño archivo=
tipo ponencia= 1
ruta= C:/xampp/htdocs/CONANP/Resumen Ponencias/1 Invitado o Conferencista/
temp_name=
este es el formulario que lo envia:
Código:
<form name="formPonente" action="" onsubmit="enviarDatosPonente(); return false;" enctype="multipart/form-data" method="post">
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Nombre(s)</td>
<td><input name="nombres" type="text" class="input" id="nombres" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';" onBlur="borra_espacios(this); convMayus(this);" onkeypress="solo_letras();" size="25" onpaste="return false" /></td></tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Apellido Paterno</td>
<td><input name="paterno" type="text" class="input" id="paterno" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';" onBlur="borra_espacios(this); convMayus(this);" onkeypress="solo_letras();" size="25" onpaste="return false" /></td></tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Apellido Materno</td>
<td><input name="materno" type="text" class="input" id="materno" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';" onBlur="borra_espacios(this); convMayus(this);" onkeypress="solo_letras();" size="25" onpaste="return false" /></td></tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Institución/Dependencia</td>
<td><input name="institucion" type="text" class="input" id="institucion" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';" onBlur="borra_espacios(this); convMayus(this);" onkeypress="solo_letras();" size="25" onpaste="return false" /></td></tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Pais</td>
<td><?php generaPaises(); ?></td>
</tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Estado/Provincia</td>
<td><div>
<select id="estados" name="estados" disabled="disabled" class="input" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';">
<option value="">- - - - - - - - - - - - - -</option>
</select>
</div> </td>
</tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Teléfono</td>
<td><input name="telefono" type="text" class="input" id="telefono" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';" onBlur="borra_espacios(this);" onkeypress="solo_numeros();" size="20" onpaste="return false" /></td></tr>
<tr>
<td></td>
<td>Fax</td>
<td><input name="fax" type="text" class="input" id="fax" onBlur="borra_espacios(this)" onkeypress="solo_numeros()" size="20" onpaste="return false" /></td></tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>E-mail</td>
<td><input name="email" type="text" class="input" id="email" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';" onblur="borra_espacios(this); convMinusc(this);" size="30" onpaste="return false" /></td></tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Hoja de vida</td>
<td><input name="hoja_vida" type="file" class="input" id="hoja_vida" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';" onpaste="return false" /></td></tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Resumen de Ponencia</td>
<td><input name="res_ponencia" type="file" class="input" id="res_ponencia" onfocus="this.style.backgroundColor='#ffffff'; document.getElementById('mensajes_error').innerHTML = '';" onpaste="return false" /></td></tr>
<tr>
<td><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" /></td>
<td>Simposio al que se ajusta su ponencia</td>
<td><?php mostrar_simposios(); ?></td>
</tr>
<tr><td align="center" colspan="3"><br /><input type="submit" name="Submit" value="Registrar" /></td></tr>
<input type="hidden" name="formPonente_env" value="1" />
<input type="hidden" name="tipo_ponencia" value="1" />
<tr><td colspan="3"><img src="imgs/imgs_registro/bullet_red.png" width="10" height="10" align="middle" /><font size="1"><b>Datos obligatorios</b></font></td></tr>
</form>
Como se pueden dar cuenta el problema es que ni con
$_FILES ni con
$HTTP_POST_FILES (ya lo intente) me trae los datos del archivo.
Gracias de antemano por la ayuda.