Hi, I know nothing about PHP. All I know is basic HTML. But I want a contact form on my website and finally found this PHP form:
http://www.html-form-guide.com/files/email-form/php-form-to-email.zip
I uploaded the folder to my webspace (only changed the email address in the .php file) and tested it. It worked fine.
I managed to incorporate the whole thing into my website. But when I clicked 'Submit', I got an error saying:
error; you need to submit the form!
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/my-webspace-name/contact/form-to-email.php:4) in /www/htdocs/my-webspace-name/contact/form-to-email.php on line 34
But I received the form email despite the error message.
When I removed
if(!isset($_POST['submit']))
{
echo "error; you need to submit the form!";
}
from the form, it worked fine again and the thank you page came up.
1st Question: Does anybody know why this is happening?
2nd Question: What does - if(!isset($_POST['submit'])) - do and do I actually need it for any security reasons, or can I just delete it?
My site is hosted on a Linux server, if that makes any difference.
Remember, I know nothing about PHP and using 'Old Fool' as a username isn't much of an exaggeration. Please take it easy on me.
Thanks, Robert