Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Contact Form

Featured Replies

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.

Is your form processed by php? if so we wont be able to see the code this end....

  • 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 by Sam G
added [code] tags

  • 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 by Sam G
added [code] tags

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 by Sam G
added [code] tags

Might want to check you spelling 'shirtly'? Presume you have solved this now :D What was the issue ... please share

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.