jaroro Posted May 29, 2008 Share Posted May 29, 2008 Hello, I'm new here, I tried looking for help with my PHP forms but I couldn't find any, so I found this web site, looks great!! so I hope someone here can help me out. I created a web page with an email form in flash, I followed a tutorial in Kirupa, I gave all the box text inputs a variable and then theres a code that send the information to the PHP. But oh well, it doesn't work.. Ill post it here, I hope someone can help me I've created lots of web sites, but I just don't understand PHP. Thank You really, I appreciate it. PHP FORM 1 <?php $nombre = $_POST['nombre']; $email = $_POST['email']; $empresa = $_POST['empresa']; $direccion = $_POST['direccion']; $estado = $_POST['estado']; $asunto = $_POST['asunto']; $to= "[email protected]"; $subject = "Contacto MG Propeller"; $msg .= "Nombre: $nombre\n\n"; $msg .= "Empresa: $empresa\n\n"; $msg .= "Email: $email\n\n"; $msg .= "Direccion: $direccion\n\n" ; $msg .= "Estado/Ciudad: $estado\n\n" ; $msg .= "Asunto: $asunto \n\n"; if(mail($to, $subject, $msg)) echo 'msg=Mail sent&to='.$to.'&subject='.$subject; else echo 'msg=Mail faild, Please try again'; echo $msg; ?> PHP FORM 2 <?php $myChecks=""; if(!empty($_POST['check'] )) $myChecks .= "Mail: ".$_POST['check']."\r\n"; $nombre = $_POST['nombre']; $email = $_POST['email']; $embarcacion = $_POST['embarcacion']; $slora = $_POST['slora']; $manga = $_POST['manga']; $tonelaje = $_POST['tonelaje']; $motor = $_POST['motor']; $horsepower = $_POST['horsepower']; $transmicionl = $_POST['transmicion']; $velocidadactual = $_POST['velocidadactual']; $propela = $_POST['propela']; $velocidadrequerida = $_POST['velocidadrequerida']; $to= "[email protected]"; $subject = "Asesoria Tecnica"; $msg .= "Nombre: $nombre\n\n"; $msg .= "Email: $email\n\n"; $msg .= "Embarcacion: $embarcacion\n\n"; $msg .= "Slora: $slora\n\n" ; $msg .= "Manga: $manga \n\n"; $msg .= "Tonelaje: $tonelaje \n\n"; $msg .= "Motor: $motor \n\n"; $msg .= "Horse Power: $horsepower \n\n"; $msg .= "Relacion de Transmicion: $transmicion \n\n"; $msg .= "Velocidad Actual: $velocidadactual \n\n"; $msg .= "Propela Actual: $propela \n\n"; $msg .= "Velocidad Requerida: $velocidadrequerida \n\n"; $msg .= "Turbo Cargados: \n".$myChecks; if(mail($to, $subject, $msg)) echo 'msg=Mail sent&to='.$to.'&subject='.$subject; else echo 'msg=Mail faild, Please try again'; echo $msg; ?> Link to comment https://forums.phpfreaks.com/topic/107856-php-help/ Share on other sites More sharing options...
next Posted May 29, 2008 Share Posted May 29, 2008 You need to put your code inside tags for readability. What's not working? Where is your form? What do the error messages say? Link to comment https://forums.phpfreaks.com/topic/107856-php-help/#findComment-552882 Share on other sites More sharing options...
nloding Posted May 29, 2008 Share Posted May 29, 2008 Does the $msg variable get echo'd? Where does the code fail? Do you see 'message sent' or 'message failed'? What fails? And yes, as next said, put your code in code tags (it's the "#" button at the top of the reply box). Link to comment https://forums.phpfreaks.com/topic/107856-php-help/#findComment-552886 Share on other sites More sharing options...
jaroro Posted June 4, 2008 Author Share Posted June 4, 2008 Sorry its just that I copied pasted the code from a tutorial I found online so Im not quite sure I understand the "echo" and the message sent or failed, beacause I didnt type that sort of code in the flash page, so.. if the user what ever he writes down on the web page leaving a space blank or not it should get sent to the email.. but no email gets sent... Link to comment https://forums.phpfreaks.com/topic/107856-php-help/#findComment-557779 Share on other sites More sharing options...
discomatt Posted June 4, 2008 Share Posted June 4, 2008 We can't help you if you don't know what you're working with. If you want someone to build a working script for your specific scenario please check out the freelancer's forum. Link to comment https://forums.phpfreaks.com/topic/107856-php-help/#findComment-557781 Share on other sites More sharing options...
revraz Posted June 4, 2008 Share Posted June 4, 2008 The best way to troubleshoot this is to build a new simple page that just uses the mail() function. This way you can see if you even have it working correctly. The first thing I noticed is that you are not using the forth header parameter for mail(). Some webhosts require a FROM: header in order for mail to be sent. Link to comment https://forums.phpfreaks.com/topic/107856-php-help/#findComment-557794 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.