trevor von Posted July 21, 2008 Share Posted July 21, 2008 Well first of all congrats on such a great forum. I'm quite new to php and all the interaction I've had with it as a web designer has been a simple contact form code. But I have tried to modify the code and it didnt work. The Problem: I can get the php code below to send the feedback to my email but only for $nombre and $email(its a spanish website). But when I try to add the rest of the requests it will either give me an error or it will take me to the "thank you" page but the email will never get there. This is the php script and the html codes below it: <?php $nombre = $_REQUEST['nombre'] ; $email = $_REQUEST['email'] ; $telefono = $_REQUEST['telefono'] ; $pais = $_REQUEST['pais'] ; $message = $_REQUEST['message'] ; $bienes = $_REQUEST['bienes'] ; $liderasgo = $_REQUEST['liderasgo'] ; $ventas = $_REQUEST['ventas'] ; $diseño = $_REQUEST['diseño'] ; mail( "llllllllllllllllllllllll@hotmail.com", "contact form VA", $nombre, "From: $email" ); header( "Location: http://llllllllllllllllllllllllllll.com/thankyou.html" ); ?> HTML form <form action="feedback.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table width="433" border="0" align="left" cellpadding="2" cellspacing="2"> <tr> <td width="112" class="style27">Nombre:</td> <td width="301"><label> <input name="nombre" type="text" id="nombre" size="30" /> </label></td> </tr> <tr> <td class="style27">Email:</td> <td><label> <input name="email" type="text" id="email" size="30" /> </label></td> </tr> <tr> <td class="style27">Telefono:</td> <td><label> <input name="telefono" type="text" id="telefono" size="30" /> </label></td> </tr> <tr> <td height="25" class="style27">Pais:</td> <td><label> <input name="pais" type="text" id="pais" size="30" /> </label></td> </tr> <tr> <td height="115" class="style27">Comentarios Adicionales: </td> <td><label> <textarea name="message" cols="30" rows="5" id="message"></textarea> </label></td> </tr> <tr> <td class="style27">Quiero Recibir informacion adicional sobre: </td> <td valign="middle"><label class="style27"> <input name="bienes" type="checkbox" id="bienes" value="bienes" /> <span class="style27">Bienes raices</span> </label> <label> <br /> <input name="liderazgo" type="checkbox" id="liderazgo" value="liderazgo" /> <span class="style27">Liderazgo</span> <br /> <input name="ventas" type="checkbox" id="ventas" value="ventas" /> <span class="style27">Ventas</span> <br /> <input name="diseño" type="checkbox" id="diseño" value="diseño" /> <span class="style27">Diseño Web</span> </label></td> </tr> <tr> <td height="45" class="style27"><label> <div align="left"> <input type="submit" name="Submit" value="Enviar" /> </div> </label></td> <td valign="middle"> </td> </tr> </table> </form> This is the php script that wont work: <?php $nombre = $_REQUEST['nombre'] ; $email = $_REQUEST['email'] ; $telefono = $_REQUEST['telefono'] ; $pais = $_REQUEST['pais'] ; $message = $_REQUEST['message'] ; $bienes = $_REQUEST['bienes'] ; $liderasgo = $_REQUEST['liderasgo'] ; $ventas = $_REQUEST['ventas'] ; $diseño = $_REQUEST['diseño'] ; mail( "llllllllllllllllllllllll@hotmail.com", "contact form VA", $nombre, $telefono, $pais, $message, "From: $email" ); header( "Location: http://lllllllllllll.com/thankyou.html" ); ?> Just to give a quick example, the red codes are the ones I try to apply in order to get every requested info to be sent to my email. But it's not working so I would really apreciate knowing how I'm supposed to add them all. It seems like I'm already close enough but I havent been able to fix it. Thanks in advanced Quote Link to comment Share on other sites More sharing options...
StormTheGates Posted July 21, 2008 Share Posted July 21, 2008 You could always look at the manual. It should tell you everything you need to know about PHP Mail: http://www.php.net/mail Quote Link to comment Share on other sites More sharing options...
trevor von Posted July 21, 2008 Author Share Posted July 21, 2008 Thanks for the links, but I think this is much more simple for a php expert than any of the topics covered on that site. My code doesnt even require any installing, its just a .php file inside the public_html folder on my web host. Quote Link to comment Share on other sites More sharing options...
peranha Posted July 21, 2008 Share Posted July 21, 2008 <?php // send e-mail to ... $to=$email; // Your subject $subject=$subjectP; // From $header="from: email@address.com>"; // Your message $message=$messageP; // send email $sentmail = mail($to,$subject,$message,$header); That is what I use for my email function, it is the basics and it works fine. Also is email set up in your php.ini file Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.