1.

Solve : Contact form?

Answer»

Hi,
I have a contact form, it is a script from a tutorial of youtube, but I d'ont UNDERSTAND it doesn't work,
I haven't receive the E mail message ,  I wish someone can help me!

index.php


 

Name:
E-Mail:
 
 
Message:
Anti spam:9+1=
 
 
 
 

 

guide.php

 $nom = $_POST['nom'];
 $email = $_POST['email'];
 $message = $_POST['message'];
 $secu = $_POST['secu'];
 $to = "[email protected]";
 $sujet = "Client Message";
 $info = "un client a soumis un message.\n\nNom: $nom\n\nEmail: $email\n\nMessage: $message\n\nVeuillez le répondre";

 if ($secu=="10") {
 mail("$to, $sujet, $nom, $email, $info");
 header("Location:index.php?s=1");
 }
 else {
 header("Location:index.php?s=2");
 }
 ?>

the headrer is OK, so I d'idn't put here, only the problem is I have no E mail message

You are passing a string into the mail() function RATHER than the individual arguments:
Code: [Select]mail("$to, $sujet, $nom, $email, $info");should be:
Code: [Select]mail($to, $sujet, $nom, $email, $info);(Notice the lack of quotes)

That said, don't just copy code samples from YouTube or anywhere else for that matter, read through them and make sure you understand what every LINE does.Also to mention when sharing code here, be sure to hide confidential info such as actual e-mail address, as for if its detected by a spam source you could all of the a sudden be flooded with spam. Its best to alter usernames, passwords, and e-mail addresses from the original to hide the true info vs sharing with the entire world.  I have modified it:
mail($to, $sujet, $nom, $email, $info);
but it's still not OK
is it a problem of sendmail ?
I d'ont KNOW very well sendmail.


Discussion

No Comment Found