Foros del Web » Programando para Internet » PHP »

Ayuda al procesar un formulario

Estas en el tema de Ayuda al procesar un formulario en el foro de PHP en Foros del Web. Hola, soy nuevo e el foro, necesito que me ayudeis. tengo una web para que la gente suba tutoriales, y tengo un formulario, y tengo ...
  #1 (permalink)  
Antiguo 22/08/2008, 13:38
Avatar de fcdragons  
Fecha de Ingreso: agosto-2008
Ubicación: echo $_REQUEST['ubicacion'];
Mensajes: 474
Antigüedad: 15 años, 8 meses
Puntos: 13
Pregunta Ayuda al procesar un formulario

Hola, soy nuevo e el foro, necesito que me ayudeis. tengo una web para que la gente suba tutoriales, y tengo un formulario, y tengo el codigo php, todo funciona bien, el problema es que el correo no me llega al correo que puse en el codigo php.

Este se llama phpsubirtutorial.php el codigo ke ase ke envie el correo electronico es el primero ke hay.

Código PHP:
<?php
   
//cree nombres de variables
   
$nombre=$_POST['nombre'];
   
$email=$_POST['email'];
   
$tutorial=$_POST['tutorial'];
   
   
$toadress '[email protected]';
   
$subject 'nuevo tutorial para tutorialeserik';
   
$mailcontent 'Nombre: '.$name."\n"
                  
.'Email: '.$email."\n"
                  
."Tutorial: \n".$tutorial."\n";
   
$fromaddress 'From: [email protected]';
   
   
mail($toaddress$subject$mailcontent$fromaddress);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TE.com .::TutorialesErik.com::. una web para aprender disfrutando.</title>
<style type="text/css">
input {
   border:1px solid #666666;
}
</style>

<style type="text/css">
.MainNav a:hover {
   color:#333333;
   background-color:#CCCCCC;
}

.MainNav a:visited {
   color:#999999;
}

.MainNav a:link {
   color:#999999;
}
</style>

<style type="text/css">
body {
   text-align:center;
   min-width:760px;
}

#wrapper {
   width:720px;
   text-align:left;
   margin:0 auto;
}

#content {
   width:560px;
   float:right;
}

#content h1, #content h2, #content p {
   padding-right:20px;
   padding-left:20px;
}

#mainNav {
   width:150px;
   float:left;
}

#footer {
   clear:both;
}


</style>
</head>

<body link="#666666" vlink="#666666" alink="#666666">
<div id="wrapper">
<div id="branding">
<table width="720" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="enc.png" height="100"></td>
</tr>
</table>
</div>
<div id="content">
<div id="mainContent">
<table width="560" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="30"><img src="welcomenav.png" /></td>
</tr>
<tr>
<td background="fondocon1.png" height="30"><center></center></td>
</tr>
<tr>
<td background="fondocon2.png" height="30"><center>
Tutorial enviado con exito, gracias por tu apoyo, cuando llegue a nuestro correo lo revisaremos inmediatamente.
</center></td>
</tr>
<tr>
<td height="30" background="fondocon3.png"></td>
</tr>
<tr>
<td background="welcomenav2.png" height="30"></td>
</table>
</div>
</div>
<div id="mainNav" class="mainNav">
<table cellpadding="0" cellspacing="0" border="0" bordercolor="#000000" width="150" align="center">
<tr>
<td background="tutorialesnav.png" width="150" height="30"></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav1.png"><center><a href="/tutorialesphp.php">PHP</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesmysql.php">MySql</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialescss">CSS</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialeshtml.php">HTML</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesjavascript.php">JavaScript</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesphotoshop.php">Photoshop</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesflash.php">Flash</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesfireworks.php">Fireworks</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesaftereffects.php">After Effects</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav3.png"><center><a href="tutorialesdreamweaver.php">Dreamweaver</a></center></td>
</tr>
<tr>
<td background="tutorialesnav2.png" width="150" height="30"></td>
</tr>
</table>
<p>
<br />
<p>
<table width="150" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td background="lawebnav.png" height="30"></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav1.png"><center><a href="/sugerencias.php">Envia una sugerencia</a></center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav2.png"><center><a href="/index.php">Home</a></center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav2.png"><center><a href="mailto:[email protected]">Contacta conmigo</a></center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav2.png"><center>Foro tutoriales</center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav3.png"><center><a href="/subetutorial.php">Subir un tutorial</a></center></td>
</tr>
<tr>
<td background="tutorialesnav2.png" height="30"></td>
</tr>
</table>
<p>
<br />
<p>
<table width="150" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td background="loginnav.png" height="30"></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav1.png"></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav2.png"><center><?
if(!$_COOKIE[uid]) {
?>
<form method="post" action="entrar.php">
<b>Nick:</b><br>
<input type="text" name="nick" maxlength="20" size="10"><br>
<b>Contrase&ntilde;a:</b><br>
<input type="password" name="contrasena" maxlength="20" size="10"><br><br>
<input type="submit" name="enviar" value="Iniciar Sesion">
</form>
<p><a href="registrar.php">Registrarse</a> | 
<?
}
else {
?>
Bienvenid@ <b><?=$_COOKIE[unick]?></b><br><br>
<br>
<a href="salir.php">cerrar sesion</a>
<?
}
?> </center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav3.png"></td>
</tr>
<tr>
<td background="tutorialesnav2.png" height="30"></td>
</tr>
</table>
</div>
<div id="footer">
</div>
</div>
</body>
</html>

Pongo la pagina donde esta el formulario en el siguiente post que ino no me deja porque me paso
  #2 (permalink)  
Antiguo 22/08/2008, 13:39
Avatar de fcdragons  
Fecha de Ingreso: agosto-2008
Ubicación: echo $_REQUEST['ubicacion'];
Mensajes: 474
Antigüedad: 15 años, 8 meses
Puntos: 13
Respuesta: Ayuda al procesar un formulario

Y este se llama subetutorial.php que es donde esta el formulario y todo:

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TE.com .::TutorialesErik.com::. una web para aprender disfrutando.</title>
<style type="text/css">
input {
   border:1px solid #666666;
}
</style>

<style type="text/css">
.MainNav a:hover {
   color:#333333;
   background-color:#CCCCCC;
}

.MainNav a:visited {
   color:#999999;
}

.MainNav a:link {
   color:#999999;
}
</style>

<style type="text/css">
body {
   text-align:center;
   min-width:760px;
}

#wrapper {
   width:720px;
   text-align:left;
   margin:0 auto;
}

#content {
   width:560px;
   float:right;
}

#content h1, #content h2, #content p {
   padding-right:20px;
   padding-left:20px;
}

#mainNav {
   width:150px;
   float:left;
}

#footer {
   clear:both;
}


</style>

<script language="JavaScript">
function validar(form) { //verifica que haya llenado los campos
if (!form.nombre.value) {
alert("Debe completar el campo de Tu Nombre!");
return (false)
} else if (!form.email.value) {
alert("Debe completar el campo Tu Email!");
return (false)
} else if (!form.tutorial.value) {
alert("Debe completar el campo Aqui Tu Tutorial!");
return (false)
} else { 
return (true)
}
}
</script>

</head>

<body link="#666666" vlink="#666666" alink="#666666">
<div id="wrapper">
<div id="branding">
<table width="720" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="enc.png" height="100"></td>
</tr>
</table>
</div>
<div id="content">
<div id="mainContent">
<table width="560" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="30"><img src="welcomenav.png" /></td>
</tr>
<tr>
<td background="fondocon1.png" height="30"><center></center></td>
</tr>
<tr>
<td background="fondocon2.png" height="30"><center>
<form method="post" action="phpsubirtutorial.php" onSubmit="return validar(this)" name="formtutoriales">
<table cellpadding="0" cellspacing="0" border="1" bordercolor="#999999">
<tr>
<td>Tu nombre: </td><td><input type="text" name="nombre" id="nombre" size="42" /></td>
</tr>
<tr>
<td>Tu email: </td><td><input type="text" name="email" id="email" size="42" /></td>
</tr>
<tr>
<td>Tutorial: </td><td><textarea name="tutorial" cols="40" rows="50" id="tutorial"></textarea></td>
</tr>
</table>
<input type="submit" value="enviar formulario" />
</form>
</center></td>
</tr>
<tr>
<td height="30" background="fondocon3.png"></td>
</tr>
<tr>
<td background="welcomenav2.png" height="30"></td>
</table>
</div>
</div>
<div id="mainNav" class="mainNav">
<table cellpadding="0" cellspacing="0" border="0" bordercolor="#000000" width="150" align="center">
<tr>
<td background="tutorialesnav.png" width="150" height="30"></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav1.png"><center><a href="/tutorialesphp.php">PHP</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesmysql.php">MySql</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialescss">CSS</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialeshtml.php">HTML</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesjavascript.php">JavaScript</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesphotoshop.php">Photoshop</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesflash.php">Flash</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesfireworks.php">Fireworks</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav2.png"><center><a href="/tutorialesaftereffects.php">After Effects</a></center></td>
</tr>
<tr>
<td bgcolor="#0066FF" width="150" height="30" background="fondonav3.png"><center><a href="tutorialesdreamweaver.php">Dreamweaver</a></center></td>
</tr>
<tr>
<td background="tutorialesnav2.png" width="150" height="30"></td>
</tr>
</table>
<p>
<br />
<p>
<table width="150" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td background="lawebnav.png" height="30"></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav1.png"><center><a href="/sugerencias.php">Envia una sugerencia</a></center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav2.png"><center><a href="/index.php">Home</a></center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav2.png"><center><a href="mailto:[email protected]">Contacta conmigo</a></center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav2.png"><center>Foro tutoriales</center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav3.png"><center><a href="/subetutorial.php">Subir un tutorial</a></center></td>
</tr>
<tr>
<td background="tutorialesnav2.png" height="30"></td>
</tr>
</table>
<p>
<br />
<p>
<table width="150" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td background="loginnav.png" height="30"></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav1.png"></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav2.png"><center><?
if(!$_COOKIE[uid]) {
?>
<form method="post" action="entrar.php">
<b>Nick:</b><br>
<input type="text" name="nick" maxlength="20" size="10"><br>
<b>Contrase&ntilde;a:</b><br>
<input type="password" name="contrasena" maxlength="20" size="10"><br><br>
<input type="submit" name="enviar" value="Iniciar Sesion">
</form>
<p><a href="registrar.php">Registrarse</a> | 
<?
}
else {
?>
Bienvenid@ <b><?=$_COOKIE[unick]?></b><br><br>
<br>
<a href="salir.php">cerrar sesion</a>
<?
}
?> </center></td>
</tr>
<tr>
<td width="150" height="30" background="fondonav3.png"></td>
</tr>
<tr>
<td background="tutorialesnav2.png" height="30"></td>
</tr>
</table>
</div>
<div id="footer">
</div>
</div>
</body>
</html>

Espero que puedan ayudarme, ya que vosotros entienden de esto, muchas gracias de antemano bye
  #3 (permalink)  
Antiguo 22/08/2008, 15:02
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Respuesta: Ayuda al procesar un formulario

Hola fcdragons,

Revisa si tu hosting te da acceso a usar la función mail().

Saludos.
  #4 (permalink)  
Antiguo 22/08/2008, 15:53
Avatar de fcdragons  
Fecha de Ingreso: agosto-2008
Ubicación: echo $_REQUEST['ubicacion'];
Mensajes: 474
Antigüedad: 15 años, 8 meses
Puntos: 13
Respuesta: Ayuda al procesar un formulario

Cita:
Iniciado por GatorV Ver Mensaje
Hola fcdragons,

Revisa si tu hosting te da acceso a usar la función mail().

Saludos.
ahora me informo, che, pero me puedes deci alguno, eske yo bucando hosting soy muy malo
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 05:05.