ok,
my Hosting company have informed me that my new websites are on servers using php5 and the simple forms i have used on previous php4 based websites do not work.
So although i have pretty much zero knowledge of php i have searched around to find the answer to the problem. Well the answer to the problem seems to be it is something to with Global Variables.....that means zilch to me.
So if someone could take a look at this simple php4 code and then retype it for me in php5 compatible script im sure i could work out what to change on my other forms.
So for example lets take my page on my php4 website: http://www.weddingpartyinvitations.com/ContactUs.htm
We have a TextField called: Name
a TextField called: Email
a TextField called: Subject
a TextField called: Question
and a submit button called: Submit
it uses the code line: "<form id="QuickEnquiry" name="QuickEnquiry" method="post" action="QuickEnquiryMail.php">"
Then my php on the quick enquiry page looks like this:
<?
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}
$Name=$POST['Name'];
checkOK($Name);
$Email=$POST['Email'];
checkOK($Email);
$Subject=$POST['Subject'];
checkOK($Subject);
$Question=$POST['Question'];
checkOK($Question);
$to="info@myemailaddress";
$message="
A Quick Enquiry has been submitted from www.WeddingPartyInvitations.com
Here are the details:
Name: $Name
Email: $Email
Subject: $Subject
Question: $Question
";
if(mail($to,"Quick Enquiry: $Email $Name" ,$message,"From: $Email\n")) {
echo "";
} else {
echo; "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
So if somebody could retype this php script for me in way that will work on php5 servers i would appreciate it. From here i can analyse the changes then fix the more complex forms myself.
I intend to use the same contact form here on my new website: http://www.weddingfavoursworld.com/Contact-Us.htm So once i have a workaround i can test it to see if it works.
So thanks in advance for any help.