Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Just discovered web form stopped working
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Just discovered web form stopped working
Just discovered web form stopped working
13-09-2010 2:02 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi All,
I've just discovered that my PHP webform has stopped working and I finally understand why the number of website enquiries has dried up!
I've read a few threads on getting a form to work with method="post" but as I have limited PHP knowledge, I'm struggling.
I have a simple PHP form handler on my CCGI space and a couple of forms on my standard webspace that use the form handler.
I was using <form action="http://ccgi.bestpump.plus.com/form_handler.php" method="POST"> and I have no .htaccess file in place.
The PHP form handler is like this:
<?php
// your email address
$youremail = "xxx@xxx.com";
// field validation
if ($name=="" || $company_name=="" || $telephone=="" || $email=="" || $fluid=="" || $viscosity=="" || $temperature=="" || $flowrate=="" || $discharge=="" || $pipework=="" || $connection=="" || $air=="" || $comments=="")
{
print ("<p>Please complete required fields! <a href='#' onclick='history.go(-1);return false;'>Go back</a> to re-enter or <a href='http://www.bestpump.co.uk/company_profile/contact_bestpump.html'>start again</a>.</p>");
}
else {
// email validation
if(!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$', $email)) {
print ("<p>Your email address does not appear to be valid. Please <a href='#' onclick='history.go(-1);return false;'>go back</a> to re-enter or <a href='http://www.bestpump.co.uk/products/pump_enquiry_form.html'>start again</a>.</p>");
exit;
}
// send email
$headers = "From: \"$name\" <$email>\n";
$subject = "BestPump.co.uk Pump Enquiry";
$message = "The following pump enquiry has come in from the BestPump website. \n \nPlease follow up ASAP! \n \nName: $name \nCompany: $company_name \nTelephone: $telephone \nFax: $fax \nComments: $comments";
mail ("$youremail", "$subject", $message, $headers);
print ("<h2>Thank you for your enquiry</h2><p>Thank you $name, your enquiry has been received and we will respond to you as soon as possible.</p><p>Please return to our home page by <a href='http://www.bestpump.co.uk/index.html'>clicking here</a>.</p>");
}
?>
Could anyone quickly tell me what I need to change to get the form working again and how to do it?
Many thanks,
Jeff
I've just discovered that my PHP webform has stopped working and I finally understand why the number of website enquiries has dried up!
I've read a few threads on getting a form to work with method="post" but as I have limited PHP knowledge, I'm struggling.
I have a simple PHP form handler on my CCGI space and a couple of forms on my standard webspace that use the form handler.
I was using <form action="http://ccgi.bestpump.plus.com/form_handler.php" method="POST"> and I have no .htaccess file in place.
The PHP form handler is like this:
<?php
// your email address
$youremail = "xxx@xxx.com";
// field validation
if ($name=="" || $company_name=="" || $telephone=="" || $email=="" || $fluid=="" || $viscosity=="" || $temperature=="" || $flowrate=="" || $discharge=="" || $pipework=="" || $connection=="" || $air=="" || $comments=="")
{
print ("<p>Please complete required fields! <a href='#' onclick='history.go(-1);return false;'>Go back</a> to re-enter or <a href='http://www.bestpump.co.uk/company_profile/contact_bestpump.html'>start again</a>.</p>");
}
else {
// email validation
if(!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$', $email)) {
print ("<p>Your email address does not appear to be valid. Please <a href='#' onclick='history.go(-1);return false;'>go back</a> to re-enter or <a href='http://www.bestpump.co.uk/products/pump_enquiry_form.html'>start again</a>.</p>");
exit;
}
// send email
$headers = "From: \"$name\" <$email>\n";
$subject = "BestPump.co.uk Pump Enquiry";
$message = "The following pump enquiry has come in from the BestPump website. \n \nPlease follow up ASAP! \n \nName: $name \nCompany: $company_name \nTelephone: $telephone \nFax: $fax \nComments: $comments";
mail ("$youremail", "$subject", $message, $headers);
print ("<h2>Thank you for your enquiry</h2><p>Thank you $name, your enquiry has been received and we will respond to you as soon as possible.</p><p>Please return to our home page by <a href='http://www.bestpump.co.uk/index.html'>clicking here</a>.</p>");
}
?>
Could anyone quickly tell me what I need to change to get the form working again and how to do it?
Many thanks,
Jeff
Message 1 of 2
(860 Views)
1 REPLY 1
Re: Just discovered web form stopped working
13-09-2010 2:12 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Just changed the permissions to 700 and it works again.
Months and months of potential enquiries lost for such a small issue - thanks a lot!
Jeff
Months and months of potential enquiries lost for such a small issue - thanks a lot!
Jeff
Message 2 of 2
(274 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Just discovered web form stopped working