Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/02/2005, 13:08
herni
 
Fecha de Ingreso: octubre-2004
Mensajes: 17
Antigüedad: 19 años, 6 meses
Puntos: 0
Cómo recibir datos formulario

Hola, tengo este formulario y este script y recibo las imágenes en mi web pero no se cómo recibir los datos de los campos de texto. ¿Podéis ayudarme? Gracias.

Herni

<form action="http://www.zerotwowear.com/upload/upload_2.php" method="post" enctype="multipart/form-data">
<form action="http://www.zerotwowear.com/cgi-bin/formmail.pl" method="post" enctype="multipart/form-data">
<div align="center">
<p align="center" class="Estilo1 Estilo2">If you want your action photo(s) displayed in the <strong>zerotwo</strong> gallery, you can upload them filling the form below: </p>
<p align="center" class="Estilo3">Thanks, we appreciate all photo contributions !</p>
<table width="260" border="0">
<tr>
<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">Rider</font>..........</div></td>
<td> <div align="right">
<input type="text" name="rider" size="45" maxlength="100">
</div></td>
</tr>
<tr>
<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">Date...........</font></div></td>
<td><div align="right">
<input name="date" type="text" id="date" size="45" maxlength="100">
</div></td>
</tr>
<tr>
<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">Place.........</font></div></td>
<td> <div align="right">
<input name="place" type="text" id="place" size="45" maxlength="100">
</div></td>
</tr>
<tr>
<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">Photograph</font>.</div></td>
<td><p align="right">
<input name="photograph" type="text" id="photograph" size="45" maxlength="100">
</p> </td>
</tr>
<tr>
<td colspan="2"><div align="left">
<p align="center">&nbsp;</p>
<p align="center"><font face="Arial, Helvetica, sans-serif"><span class="bodyTextSmall Estilo1 Estilo2">Please ensure that any pictures sent are JPEG format and no larger than 200 KB.</span></font></p>
<p align="center">&nbsp;</p>
</div> </td>
</tr>
<tr>
<td><font size="-1" face="Arial, Helvetica, sans-serif">Image File..</font></td>
<td><div align="right">
<input name="userfile" type="file" id="userfile" size="30">
</div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<p>&nbsp; </p>
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="200000">
<input type='hidden' name='recipient' value='[email protected]'>
<input name="submit" type="submit" value="Upload">
</p>
</div></td>
</tr>
</table>
</div>
</form>

__________________________________________________ _______________

<?
//tomo el valor de los elementos de tipo texto del formulario

$cadenatexto = $_POST["rider"];
echo "<p align='center'><font face='Arial'<font size='2'>Rider: " . $cadenatexto . "<br><br>";
$cadenatexto = $_POST["date"];
echo "Date: " . $cadenatexto . "<br><br>";
$cadenatexto = $_POST["place"];
echo "Place: " . $cadenatexto . "<br><br>";
$cadenatexto = $_POST["photograph"];
echo "Photograph: " . $cadenatexto . "<br><br><br>";

//datos del arhivo
$nombre_archivo = $HTTP_POST_FILES['userfile']['name'];
$tipo_archivo = $HTTP_POST_FILES['userfile']['type'];
$tamano_archivo = $HTTP_POST_FILES['userfile']['size'];

//compruebo si las características del archivo son las que deseo

if (!((strpos($tipo_archivo, "gif") || strpos($tipo_archivo, "jpeg")) && ($tamano_archivo < 200000))) {
echo "FILE TOO LARGE OR WRONG FILE FORMAT. <br><br><table><tr><td><li>Only GIF or JPEG files.<br><li>200 Kb maximum size.</td></tr></table>";
}else{
if (move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], $nombre_archivo)){
echo "FILE UPLOADED SUCCESSFULLY.";
}else{
echo "SORRY, THERE WAS A PROBLEM MOVING YOUR FILE. TRY AGAIN";
}
}
?>