April 22, 200917 yr Hi All, Can anyone see why my contact form isn't working?? I get an error A file permissions error has occurred. Please check the permissions on the script and the directory it is in and try again.
April 22, 200917 yr Is your form processed by php? if so we wont be able to see the code this end....
April 22, 200917 yr Author the php <?php $EmailFrom = "Vanilla pod enquiry"; $EmailTo = "vanillapodstudio@hotmail.co.uk"; $Subject = "Vanilla pod enquiry"; $name = Trim(stripslashes($_POST['name'])); $email = Trim(stripslashes($_POST['email'])); $telephone = Trim(stripslashes($_POST['telephone'])); $comments = Trim(stripslashes($_POST['comments'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "name: "; $Body .= $name; $Body .= "\n"; $Body .= "email: "; $Body .= $email; $Body .= "\n"; $Body .= "telephone: "; $Body .= $telephone; $Body .= "\n"; $Body .= "comments: "; $Body .= $comments; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=contactedok.htm\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> HTML <form method="POST" action="contact.php"> <p><input name="name" type="text" class="form_box"></p> <p><input name="email" type="text" class="form_box"></p> <p><input name="telephone" type="text" class="form_box"></p> <p><textarea name="comments" cols="10" rows="10" class="form_box"></textarea></p> <input type="submit" name="submit" value="Submit"> </form> Edited January 31, 201016 yr by Sam G added [code] tags
April 22, 200917 yr Author where is the validation you refer to? I didn't want any vaildation.... I have taken it out of the php code now.. <?php $EmailFrom = "Vanilla pod enquiry"; $EmailTo = "vanillapodstudio@hotmail.co.uk"; $Subject = "Vanilla pod enquiry"; $name = Trim(stripslashes($_POST['name'])); $email = Trim(stripslashes($_POST['email'])); $telephone = Trim(stripslashes($_POST['telephone'])); $comments = Trim(stripslashes($_POST['comments'])); // prepare email body text $Body = ""; $Body .= "name: "; $Body .= $name; $Body .= "\n"; $Body .= "email: "; $Body .= $email; $Body .= "\n"; $Body .= "telephone: "; $Body .= $telephone; $Body .= "\n"; $Body .= "comments: "; $Body .= $comments; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=contactedok.htm\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> Edited January 31, 201016 yr by Sam G added [code] tags
April 22, 200917 yr I'm guessing it might be related to these? print "<meta http-equiv=\"refresh\" content=\"0;URL=contactedok.htm\">"; print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; Have you tested it locally to see if any php errors are given? The permissions bit makes me think something to do with htdocs... (edit sorry htaccess ) Maybe try coping the error given and google it? Edited January 31, 201016 yr by Sam G added [code] tags
April 22, 200917 yr Might want to check you spelling 'shirtly'? Presume you have solved this now What was the issue ... please share
Create an account or sign in to comment