Forums
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Guys, I need help!! I’m banging my head on the wall trying to resolve!
When I click ‘SEND’ I’m getting an error message on line 33. I can’t figure out what’s going on!
Please, your help is GREATLY appreciated.
@hendrix940 Post your code but remove any sensitive information, first.
@chrisburton, I’m new to the forums, can you please advise me the best way to do this? Thanks!!
$subject = “Comment/Question from the site.”;
$message = “$question”;
$mail_from = “$email”;
$header = “from: $name <$mail_from>“;
$to = “[email protected]”
$send_contact = mail($to,$subject,$message,$header);
if($send_contact){
echo “
We’ve received your email. We will email you back shortly.
“;
}
else {
echo “Error. Please go back and try again.”;
}
?>
Okay, that’s my PHP
@hendrix940 I only want what’s on line 33 for now. So just create an empty space/line, hit the spacebar 4x and paste.
that’s the html calling on the .php. Did I include everything?
$send_contact = mail($to,$subject,$message,$header);
Thank you sir. Above is line 33.
@hendrix940 What’s this about?
$to = “[email protected]”
Shouldn’t it be:
$to = “[email protected]”;
that very well could be it @chrisburton … testing now.
@chrisburton, now it is sending (THANK YOU), HOWEVER, it’s not sending any of the information from the text fields. Just an email shows up with no information in the inbox.
Next time, include the actual error message. PHP does reasonably well at *telling you* what the problem is – you don’t have to guess.
> …HOWEVER, it’s not sending any of the information from the text fields. Just an email shows up with no information in the inbox.
$message = “$question”;
$mail_from = “$email”;
$header = “from: $name <$mail_from>“;
where do you define the variables `$question`, `$email`, `$name`, `$mail_from`, etc.? Are you sure they contain the values you expect?