Jump to content

PHP help


jaroro

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.