Comunidad de diseño web y desarrollo en internet online

Agregar imagen o archivo a un codigo formulario de contacto

Citar            
MensajeEscrito el 28 Oct 2009 01:19 am
Buenas les dejo este codigo haber si alguien me puede ayudar, este codigo nos da la opcion de escribir nuestro:

nombre:
apellido:

pais:
telefono:

etc,

Me gustaría que alguien me ayude a agregarle al codigo una opcion para que pueda adjuntar un archivo por ejemplo word o una imagen.

el codigo es este:

---------------------------------------------------------------------------------------------------

<?
if (!$HTTP_POST_VARS){
?>
<form action="contacto.php" method=post onSubmit="return form_Validator(this)">
</p>
<table width="358" height="233" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="86" class="style15"><span class="style15">Nombre:</span></td>
<td width="498"><input
name=nombre class=imputbox id=usuario
style="WIDTH: 250px; HEIGHT: 20px" size=49></td>
</tr>
<tr>
<td class="style15"><span class="style15">Apellido:</span></td>
<td><input
name=apellido class=imputbox id=usuario2
style="WIDTH: 250px; HEIGHT: 20px" size=33></td>
</tr>
<tr>
<td class="style15">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="style15"><span class="style15">Mail:</span></td>
<td><input
name=email class=imputbox id=usuario5
style="WIDTH: 250px; HEIGHT: 20px" size=33></td>
</tr>
<tr>
<td class="style15"><span class="style15">Telefono:</span></td>
<td><input
name=telefono class=imputbox id=usuario6
style="WIDTH: 250px; HEIGHT: 20px" size=33></td>
</tr>
<tr>
<td class="style15">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="style15">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><span class="style15">Mensaje:</span></td>
<td><textarea name="mensaje" cols="33" class="imputbox" id="usuario8" style="WIDTH: 250px; HEIGHT: 100px"></textarea></td>
</tr>
<tr>
<td><span class="style16"></span></td>
<td><input name="Submit" type="submit" class="botones " value="Enviar">
<input name="reset" type="reset" id="reset" value="Borrar"></td>
</tr>
</table>
<?
}else{
//Estoy recibiendo el formulario, compongo el cuerpo
$cuerpo = "Enviado desde vitralesquintanilla.com:\n";
$cuerpo = "Mensaje enviado desde vitralesquintanilla.com .- \n";
$cuerpo .= "Nombre: " . $HTTP_POST_VARS["nombre"] . "\n";
$cuerpo .= "Apellido: " . $HTTP_POST_VARS["apellido"] . "\n";
$cuerpo .= "E-mail: " . $HTTP_POST_VARS["email"] . "\n";
$cuerpo .= "Telefono: " . $HTTP_POST_VARS["telefono"] . "\n";
$cuerpo .= "Mensaje: " . $HTTP_POST_VARS["mensaje"] . "\n";

//mando el correo...
mail("[email protected]","Mensaje desde vitralesquintanilla.com",$cuerpo,"From: www.vitralesquintanilla.com");

//doy las gracias por el env&iacute;o
echo "<font face='arial' color='#FF9900' size='2' style='font-size:12px '> <strong>Su mensaje a sido enviado satisfactoriamente, nos pondremos en contacto a la brevedad posible.

Muchas Gracías
</strong><br>";
echo "<font face='arial' color='#666666' size='2' style='font-size:12px '> <strong><strong><br>";
}
?>

-------------------------------------------------------------------------------------------------------------


Muchas Gracias

Por tamez11

1 de clabLevel



 

safari
Citar            
MensajeEscrito el 01 Nov 2009 02:07 am
Mira estos enlaces:
http://alfonsocatron.com.ar/2007/10/15/formulario-de-contacto-php-gratis-v3-adjuntar-archivo-al-mail/
y para no reinventar la rueda
http://www.hotscripts.com/category/php/scripts-programs/file-manipulation/file-management/
Cualquier cosa comentame.

Por crmauricio

52 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.