Foros del Web » Programando para Internet » PHP »

alguien me puede ayudar?estoy desesperado!

Estas en el tema de alguien me puede ayudar?estoy desesperado! en el foro de PHP en Foros del Web. hola gente y perdon por la molestia.necesito que alguien me diga que pasa a este script que me da este error: Parse error: parse error ...
  #1 (permalink)  
Antiguo 13/02/2004, 18:11
Avatar de yeta  
Fecha de Ingreso: enero-2004
Mensajes: 148
Antigüedad: 20 años, 2 meses
Puntos: 0
alguien me puede ayudar?estoy desesperado!

hola gente y perdon por la molestia.necesito que alguien me diga que pasa a este script que me da este error:

Parse error: parse error in /home/webcindario/noeliafanclub/emailform.php on line 37

aqui os dejo el codigo:

<?

// 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 - www.noeliafanclub.tk";

// 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"]
$calle = $_POST["calle"]
$numero = $_POST["numero"]
$piso = $_POST["piso"]
$c_postal = $_POST["c_postal"]
$localidad = $_POST["localidad"]
$provincia = $_POST["provincia"]
$email = $_POST["email"];
$dni = $_POST["dni"]
$fecha_nacimiento = $_POST["fecha_nacimiento"]
$talla = $_POST["talla"]
$numero_fijo = $_POST["numero_fijo"]
$numero_movil = $_POST["numero_movil"]
$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\">&nbsp;&nbsp;\n");
print ("<input type=\"reset\" value=\"Reset Fields\">\n");
print ("</form>\n");
print ("</div>");
}
?>



alguien me puede ayudar?que pasa, por que me sale ese error?enviadme un mail( [email protected] ) o contestadme aqui
muchas gracias!!
  #2 (permalink)  
Antiguo 13/02/2004, 18:28
Avatar de Gerald  
Fecha de Ingreso: julio-2003
Mensajes: 1.356
Antigüedad: 20 años, 9 meses
Puntos: 2
Colorea el codigo

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 - [url]www.noeliafanclub.tk[/url]";

// 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"]
$calle $_POST["calle"]
$numero $_POST["numero"]
$piso $_POST["piso"]
$c_postal $_POST["c_postal"]
$localidad $_POST["localidad"]
$provincia $_POST["provincia"]
$email $_POST["email"];
$dni $_POST["dni"]
$fecha_nacimiento $_POST["fecha_nacimiento"]
$talla $_POST["talla"]
$numero_fijo $_POST["numero_fijo"]
$numero_movil $_POST["numero_movil"]
$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>");
}
?>
__________________
Solo por Hoy: Trataré de fortalecer mi mente. Estudiaré y aprenderé algo útil
Hoteldipity
Arte Caracol
  #3 (permalink)  
Antiguo 13/02/2004, 18:31
Avatar de yeta  
Fecha de Ingreso: enero-2004
Mensajes: 148
Antigüedad: 20 años, 2 meses
Puntos: 0
pero no m puedes ayudar?es q no m basta q m digas q coloree el codigo...eso no m lo soluciona....xD
bueno menos coña, puede solucionarme alguien el problema?
  #4 (permalink)  
Antiguo 13/02/2004, 18:39
Avatar de 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
  #5 (permalink)  
Antiguo 13/02/2004, 18:43
Avatar de Ds1
Ds1
 
Fecha de Ingreso: junio-2003
Mensajes: 87
Antigüedad: 20 años, 9 meses
Puntos: 0
le faltan artoosss ";"


desde la linea 36 para abajo le faltan arto
  #6 (permalink)  
Antiguo 13/02/2004, 19:11
Avatar de yeta  
Fecha de Ingreso: enero-2004
Mensajes: 148
Antigüedad: 20 años, 2 meses
Puntos: 0
muchisimas gracias!!!!
  #7 (permalink)  
Antiguo 14/02/2004, 10:38
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
yeta .. justamente lo de colorear el código no es de coña .. El coloreado te sirve para identificar esos problemas. PHP lo hace a traves de una función y este foro la usa para eso .. pero si usas tu editor de código que coloree ese código y te acostumbras a saber indentificar los colores que te está mostrando verás más claro y rápido cuando tengas errores de sintax (parser que llama PHP).

Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.
  #8 (permalink)  
Antiguo 14/02/2004, 10:41
Avatar de yeta  
Fecha de Ingreso: enero-2004
Mensajes: 148
Antigüedad: 20 años, 2 meses
Puntos: 0
ah vale, gracias de nuevo!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:18.