![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
19/09/2008, 06:58
|
| | Fecha de Ingreso: abril-2007
Mensajes: 31
Antigüedad: 17 años, 10 meses Puntos: 0 | |
Respuesta: Adjuntar archivo en formulario PHP Y este es el codigo PHP del Archivo confirmación envió:
Código:
<?
@import_request_variables("gpc");
$youremail = "[email protected]"; //YOUR MAIL HERE
$subject = "Formulario sugerencias "; // TITLE OF DE SUBJECT IN MAIL
$redirect = "index.html";//URL TO BE REDIRECTED IN 5 SECONDS
$secs = "5";// TIME TO BE REDIRECTED
if(eregi("MIME-Version:",$postVars)) {
mail("[email protected]"/*YOUR MAIL HERE*/, "Form Hijack Attempt", "A spam relay was attempted from the Web site and was blocked.", "From:SpamMonitor");
die();
} //BLOCKING spam
$secret = 'ssshhitsasecret';
$token = md5(rand(1, 1000).$secret);
$_SESSION['token'] = $token;
?>
<?
//
$name = stripslashes($name);
$poblacion = stripslashes($poblacion);
$message = stripslashes($message);
$headers .= "From: " . $email . "\r\n\r\n";
//
mail("$youremail", "$subject","
Nombre : $name
Edad : $edad
Poblacion : $poblacion
Email : $email
Publico : $emailpublico
Msn : $msn
Zona comunidad : $phone
userfile : $userfile
Detalles : $message
",$headers);
// Strip \r and \n from the email address - DESACTIVADOS POR ALBERTO POR QUE DAN ERROR DE LINEA
$_POST['email'] = str_replace("\r", "", $_POST['email']);
$_POST['email'] = str_replace("\n", "", $_POST['email']);
//*****COMMENT: if you have problems with the lines 40/41, replace these for:
//$_POST['email'] = str_replace("\r", "", $_POST['email']);
//$_POST['email'] = str_replace("\n", "", $_POST['email']);
//*****
$_SESSION['token'] = $token;
$token = md5(rand(1, 1000).$secret);
$secret = 'ssshhitsasecret';
$field = preg_replace( "/[\n\r]+/", " ", $field );
// Remove injected headers
$find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i");
$_POST['email'] = preg_replace($find, "", $_POST['email']);
$message = preg_replace($find, "", message);
$email=str_replace("\r","\n",$email);
$name=str_replace("\r","\n",$name);
$poblacion=str_replace("\r","\n",$poblacion);
$message=str_replace("\r","\n",$message);
$phone=str_replace("\r","\n",$phone);
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
ob_clean();
mail("$youremail", "Message Killed", "$message", "From: $name <$email>");
exit("Message killed.");
}
if (eregi('^(bcc$|content-type|mime-version|--)',$key))
print_error("Field names indicate exploit."); //BLOCKING SPAM
?>
|