form error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wero86
Forum Newbie
Posts: 6
Joined: Sat Apr 25, 2009 11:06 am

form error

Post by wero86 »

xxxx
Last edited by wero86 on Mon May 04, 2009 9:40 am, edited 2 times in total.
Yossarian
Forum Contributor
Posts: 101
Joined: Fri Jun 30, 2006 4:43 am

Re: form error

Post by Yossarian »

Take a look at my reply in this other thread today.

Turn on error reporting, var_dump the incoming POST variables and take a close look at them.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: form error

Post by McInfo »

How did you arrive at the page that gives you the errors? Did you click a submit button on a form? If you used a form, please share the code for the form.

Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 12:37 pm, edited 1 time in total.
wero86
Forum Newbie
Posts: 6
Joined: Sat Apr 25, 2009 11:06 am

Re: form error

Post by wero86 »

xxx 
Last edited by wero86 on Mon May 04, 2009 9:42 am, edited 2 times in total.
wero86
Forum Newbie
Posts: 6
Joined: Sat Apr 25, 2009 11:06 am

Re: form error

Post by wero86 »

xxx
Last edited by wero86 on Mon May 04, 2009 9:41 am, edited 1 time in total.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: form error

Post by McInfo »

This is a quick reply to this code, then I will read your lengthy post.
wero86 wrote:

Code: Select all

<form action="Test/sendinfo.php" name="Contact" id="Contact">
The form is missing a method attribute.

Code: Select all

<form method="post" action="Test/sendinfo.php" name="Contact" id="Contact">
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 12:39 pm, edited 2 times in total.
wero86
Forum Newbie
Posts: 6
Joined: Sat Apr 25, 2009 11:06 am

Re: form error

Post by wero86 »

tried doing as you suggested didnt have any affect
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: form error

Post by McInfo »

Changing the method to POST should have cured these errors:
Notice: Undefined index: name in \\[...]\htdocs\sendinfo.php on line 3

Notice: Undefined index: email in \\[...]\htdocs\sendinfo.php on line 4

Notice: Undefined index: message in \\[...]\htdocs\sendinfo.php on line 5
Do you still see those errors?

To fix the other error, I think you need to change some of the $email_from variables to $email_to.

Code: Select all

$headers =
"From: $email_to .\n";
"Reply-To: $email_from .\n";
 
ini_set("sendmail_from", $email_to);
$sent = mail($email_to, $email_subject, $message, $headers, "-f" . $email_to);
Edit: This post was recovered from search engine cache.
Post Reply