neilcooper33 Posted December 2, 2008 Share Posted December 2, 2008 Hi All i am a newbie web developer and have created a few contact forms for websites. One of the sites is very strange, i am pretty sure i have done everything the same as the other contact forms on other sites, but the form keeps sending emails with no information. The contact form seems to work when i test it, and can only recreate the problem when i put a space ' ' into the fields i have made mandatory using dreamweaver MM_validateForm functions. Are people really putting a space in the fields and pressing submit all the time? (link removed) i have attached the php file.... If anyone could give me any advice, i would be most grateful thanks in advance Neil [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/135148-php-form-sending-emails-with-no-information/ Share on other sites More sharing options...
kenrbnsn Posted December 2, 2008 Share Posted December 2, 2008 Please post the source of the PHP file here. Most people are not going to download an unknown script. Make sure to put the tag before the source and after. Ken Link to comment https://forums.phpfreaks.com/topic/135148-php-form-sending-emails-with-no-information/#findComment-703912 Share on other sites More sharing options...
Gighalen Posted December 2, 2008 Share Posted December 2, 2008 It will send null content if the variable is not declared and your php.ini file has errors set to WARNINGS and not ALL. And depending on which version of PHP you are using, you may need to add quotes around the variable name inside the MAIL function. It can act funky sometimes. Link to comment https://forums.phpfreaks.com/topic/135148-php-form-sending-emails-with-no-information/#findComment-703959 Share on other sites More sharing options...
neilcooper33 Posted December 2, 2008 Author Share Posted December 2, 2008 Ah, sorry... here's the code... thanks for the response Gighalen, but would this cause problems all the time? as i said, when i test it, it works... could it be a problem with firefox and ie 6? havent been able to test this yet...? My hosting page says PHP5... where do i find the php.ini file? Many thanks... N I will lo <?php $EmailFrom = "Web Query"; $EmailTo = "[email protected]"; $Name = Trim(stripslashes($_POST['Name'])); $Email_Address = Trim(stripslashes($_POST['Email_Address'])); $Telephone_No = Trim(stripslashes($_POST['Telephone_No'])); $Query = Trim(stripslashes($_POST['Query'])); $Subject = "Web Query"; $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Email address: "; $Body .= $Email_Address; $Body .= "\n"; $Body .= "Telephone No: "; $Body .= $Telephone_No; $Body .= "\n"; $Body .= "Query: "; $Body .= $Query; $Body .= "\n"; $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> Link to comment https://forums.phpfreaks.com/topic/135148-php-form-sending-emails-with-no-information/#findComment-704074 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.