Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/02/2004, 18:39
Avatar de Gerald
Gerald
 
Fecha de Ingreso: julio-2003
Mensajes: 1.356
Antigüedad: 20 años, 9 meses
Puntos: 2
Código PHP:

<?

// DO NOT MESS WITH THESE TWO LINES
$subject_array = array();
$recipient_array = array();
///////////////////////////////////

$this_script "emailform.php"// The name of THIS file, if you change it.

// Edit only what's between the quotation marks in the below lines.
// These will be the subjects that your users can choose from
// You can have as many as you want.
// Each one must be set up like so:
// $subject_array[] = "What You Want This Choice To Be";
// Make sure to remove empty ones that you aren't using. Just delete the entire line.
$subject_array[] = "Alta en Noelia Fan Club - <a href="/out.php?http%3A%2F%2Fwww.noeliafanclub.tk" target="_blank">[url]www.noeliafanclub.tk[/url]</a>";

// Edit only what's between the quotation marks in the below lines.
// These lines contain the various people that can be contacted via your form.
// You can have as many as you want.
// Each one must be set up like so:
// $recipient_array["UNIQUE Short Name"] = "[email protected]";
// The "UNIQUE Short Name" will be shown in the select box.
// This allows the actual email address to be hidden from the user.
// Make sure to remove empty ones that you aren't using. Just delete the entire line.
$recipient_array["Your Email"] = "[email protected]";



////////////////////////////////////////////////////////////////////////////////////
// Do Not Edit Below Here Unless You Know What You Are Doing
////////////////////////////////////////////////////////////////////////////////////
if ($_POST["send"] == "true") {
$to "[email protected]";
$name $_POST["name"];
$apellidos $_POST["apellidos"]; //le faltaba el ; 
$calle $_POST["calle"]; //le faltaba el ; 
$numero $_POST["numero"]; //le faltaba el ; 
$piso $_POST["piso"]; //le faltaba el ;
$c_postal $_POST["c_postal"]; //le faltaba el ;
$localidad $_POST["localidad"]; //le faltaba el ;
$provincia $_POST["provincia"]; //le faltaba el ;
$email $_POST["email"];
$dni $_POST["dni"]; //le faltaba el ;
$fecha_nacimiento $_POST["fecha_nacimiento"]; //le faltaba el ;
$talla $_POST["talla"]; //le faltaba el ;
$numero_fijo $_POST["numero_fijo"]; //le faltaba el ;
$numero_movil $_POST["numero_movil"]; //le faltaba el ;
$the_subject $_POST["subject"];
if ((
$name == "") OR ($email == "")) {
print (
"<div id=\"sectionContent\">");
print (
"<font color=\"red\">Uno de los espacios requeridos está en blanco. Por favor, rellena todos los espacios.</font><br><br>");
print (
"</div><br>");
email_form();
} elseif (
ereg("([[:alnum:].-]+)(@[[:alnum:].-]+.+)"$email)) {
$recipient $to;
$subject $the_subject;
$additional_headers = ("From: $email\n");
$body = ("Name: $name\nCalle: $calle\nNúmero: $numero\nPiso: $piso\nCódigo Postal: $c_postal\nLocalidad: $localidad\nProvincia: $provincia\nEmail: $email\nDNI: $dni\nFecha de Nacimiento: $fecha_nacimiento\nTalla Camiseta/Sudadera: $talla\n Número Fijo: $numero_fijo\nNúmero de Móvil: $numero_movil\n\nMessage:\n\n" $message);
if (
mail($recipient$subject$body$additional_headers)) {
print (
"<div id=\"sectionContent\">");
print (
"La inscripción ha sido enviada satisfactoriamente.<br><br>");
print (
"</div><br>");
} else {
print (
"<div id=\"sectionContent\">");
print (
"<font color=\"red\">Lo sentimos, tenemos un problema temporal con la web. Por favor, inténtalo de nuevo más tarde. Disculpen las molestias.</font><br><br>");
print (
"</div><br>");
$send "false";
email_form();
}
} else {
print (
"<div id=\"sectionContent\">");
print (
"<font color=\"red\">La dirección de e-Mail introducida no es válida. Por favor, introduce una dirección válida.</font><br><br>");
print (
"</div><br>");
$send "false";
email_form();

} else {
print (
"<div id=\"sectionContent\">");
print (
"Select who you want to mail from the box below and fill out the form.<br><br>");
print (
"</div><br>");
email_form();
}

function 
email_form()
{
global 
$subject_array$recipient_array$this_script$PHP_SELF;

print (
"<div id=\"sectionContent\">");
print (
"<form METHOD=POST action=\"$PHP_SELF\">\n");
print (
"<input type=\"hidden\" name=\"send\" value=\"true\">\n");
print (
"Nombre:<br><input type=\"text\" name=\"name\"><br><br>\n");
print (
"Apellidos:<br><input type=\"text\" name=\"apellidos\"><br><br>\n");
print (
"Calle:<br><input type=\"text\" name=\"calle\"><br><br>\n"); 
print (
"Numero:<br><input type=\"text\" name=\"numero\"><br><br>\n");
print (
"Piso:<br><input type=\"text\" name=\"piso\"><br><br>\n");
print (
"Código Postal:<br><input type=\"text\" name=\"c_postal\"><br><br>\n");
print (
"Localidad:<br><input type=\"text\" name=\"localidad\"><br><br>\n");
print (
"Provincia:<br><input type=\"text\" name=\"provincia\"><br><br>\n");
print (
"Tu Dirección de e-Mail:<br>\n");
print (
"DNI:<br><input type=\"text\" name=\"dni\"><br><br>\n");
print (
"Fecha de Nacimiento:<br><input type=\"text\" name=\"fecha_nacimiento\"><br><br>\n");
print (
"Talla Camiseta/Sudadera:<br><input type=\"text\" name=\"talla\"><br><br>\n");
print (
"Teléfono Fijo:<br><input type=\"text\" name=\"numero_fijo\"><br><br>\n");
print (
"Teléfono Móvil:<br><input type=\"text\" name=\"numero_movil\"><br><br>\n");
print (
"<input type=\"text\" name=\"email\" size=\"40\"><br><br>\n");
print (
"<select name=\"subject\">\n");
foreach (
$subject_array as $value2) {
print (
"<option value=\"" $value2 "\">" $value2 "</option>\n");
}
print (
"</select><br><br>\n");
print (
"<input type=\"submit\" value=\"Submit\">  \n");
print (
"<input type=\"reset\" value=\"Reset Fields\">\n");
print (
"</form>\n");
print (
"</div>");
}
?>
Le faltaba el ;
__________________
Solo por Hoy: Trataré de fortalecer mi mente. Estudiaré y aprenderé algo útil
Hoteldipity
Arte Caracol