Good evening!I'm working on learning .php to assist me with building basic websites - very basic, self-taught. Getting a workable handle on css. A new client needs a "Testimonials" submission form. With the help of several tutorials and myfreephp, I thought I got things right, but when trying to submit a test, I get the following error messagearse error: syntax error, unexpected ';' in D:\Hosting\4651002\html\freedomcleaning\contact.php on line 11If I'm counting right, line 11 is the "comments" line. One thing I've learned is that when something isn't working quite right, it's usually something simple, but I can't find this specific error in any forums! Can someone give me push in the right direction?Many thanks in advance, and God bless!The Ole CowboyGittin' Older, But Not Agin'!
Hi there...it looks like you are missing a ")" on this line: $howfound = check_input($_POST['howfound']; should be: $howfound = check_input($_POST['howfound']); give that a try.
Many thanks, MancuZ28 - that did the trick! But I apparently have something else wrong...I submitted 2 tests, and nothing showed up at the email address. What else do I have wrong? I looked at the mail functions, and, with my very limited knowledge, all of that appears to be OK.Thanks again! Hope you can solve this one, also.The Ole CowboyGittin' Older, But Not Agin'!
You mean the email doesn't get sent? It could be a PHP configuration then...are you on a web host, or running on your own machine?
I should add that most PHP configuration require a valid "from" address header, which you are not setting. You can set it in the php.ini file, or do it like this: $headers = 'From: ' . "\r\n" . 'Reply-To: ' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers);
Hey, MancuZ28!I host everything through GoDaddy. I'll try the header suggestion, but where do I put that - at the top of the php file? And I then changemail($myemail, $subject, $message);to mail($to, $subject, $message, $headers);?And what the heck....my posts don't show paragraph changes!Muchas gracias!The Ole CowboyGittin' Older, But Not Agin'
Doesn't matter where you do it, the important thing is to add the 4th parameter to the mail function, with a valid FROM: address: $to = 'you@yourdomain.com'; $subject = 'your subject'; $message = 'the message...'; $headers = 'From: john@aol.com'; mail($to, $subject, $message, $headers);
Good morning! Thanks MancuZ28 for your guidance. This is interesting (you're not going to want to hear this, though)...I didn't have to add the additional parameter, apparently. Before making any other changes, I was checking all the emails for various sites, and found the original test submissions...after I added the ")" from your original reply. So I tried another test submission...took about 30 minutes, but it showed up! Odd that it takes a while, but at least it's working. So again, thanks for the imput, and I look forward to learning more here...as well as maybe making some contributions! Everyone have a great day, and God bless! The Ole CowboyGittin' Older, But Not Aging'!