PHP Form Help Needed
Posted: Fri Jan 23, 2009 12:08 pm
I don't know much about PHP.
We are a youth hockey league that uses a php webform that emails the results, writes to a mysql database and a csv file.
2 weeks ago our web hosting company relocated servers. Since then the form hasn't worked. All form fields are required. The problem is when all the fields are filled out correctly, the form sends the user to the default error page telling them to go back and re-do the form, yadda yadda. The code looks the same to me as it did when it worked.
We need this form to work badly. Any free help would be truly appreciated! Thanks in advance.
The code is attached.
the form url is http://glghl.com/GLGHL_High_School_Hockey_Form.html
THIS IS THE WRONG CODE! I pasted the right code below. Sorry!!!!
We are a youth hockey league that uses a php webform that emails the results, writes to a mysql database and a csv file.
2 weeks ago our web hosting company relocated servers. Since then the form hasn't worked. All form fields are required. The problem is when all the fields are filled out correctly, the form sends the user to the default error page telling them to go back and re-do the form, yadda yadda. The code looks the same to me as it did when it worked.
We need this form to work badly. Any free help would be truly appreciated! Thanks in advance.
The code is attached.
the form url is http://glghl.com/GLGHL_High_School_Hockey_Form.html
THIS IS THE WRONG CODE! I pasted the right code below. Sorry!!!!
Code: Select all
<?php
# ----------------------------------------------------
# -----
# ----- This script was generated by the demo version of PHP-Form Wizard 1.2.6 on 11/2/2007 at 12:04:17 AM
# -----
# ----- http://www.tools4php.com
# -----
# ----------------------------------------------------
# -----
# ----- Many Features are available only in the Full version, to order please follow this link :
# -----
# ----- http:// http://www.tools4php.com/form-wizard/index.html
# -----
# ----------------------------------------------------
// Receiving variables
@$pfw_ip= $_SERVER['REMOTE_ADDR'];
@$Position = addslashes($_POST['Position:']);
@$Position_Other = addslashes($_POST['Position_Other:']);
@$Name = addslashes($_POST['Name']);
@$Address = addslashes($_POST['Address']);
@$City = addslashes($_POST['City']);
@$State = addslashes($_POST['State']);
@$Zip = addslashes($_POST['Zip']);
@$Email = addslashes($_POST['Email']);
@$Home_Phone = addslashes($_POST['Home_Phone']);
@$Work_Phone = addslashes($_POST['Work_Phone']);
@$Cell_Phone = addslashes($_POST['Cell_Phone']);
@$Division = addslashes($_POST['Division']);
@$Home_Team = addslashes($_POST['Home_Team']);
@$Team_Other = addslashes($_POST['Team_Other']);
@$Team_Level = addslashes($_POST['Team_Level:']);
@$secnumber = addslashes($_POST['secnumber']);
@$checksum = addslashes($_POST['checksum']);
@$Additional_Info = addslashes($_POST['Additional_Info']);
// Validation
if (strlen($Position) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($Name) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($Address) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($City) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($State) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($Zip) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($Email) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($Home_Phone) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($Division) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($Home_Team) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($Team_Level) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
if (strlen($secnumber) == 0 )
{
header("Location: http://glghl.com/error.html");
exit;
}
//Sending Email to form owner
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "GLGHL Rep Contact Form";
$pfw_email_to = "bpavone@glghl.com";
$pfw_message = "Visitor's IP: $pfw_ip\n"
. "Position: $Position\n"
. "Position_Other: $Position_Other\n"
. "Name: $Name\n"
. "Address: $Address\n"
. "City: $City\n"
. "State: $State\n"
. "Zip: $Zip\n"
. "Email: $Email\n"
. "Home_Phone: $Home_Phone\n"
. "Work_Phone: $Work_Phone\n"
. "Cell_Phone: $Cell_Phone\n"
. "Division: $Division\n"
. "Home_Team: $Home_Team\n"
. "Team_Other: $Team_Other\n"
. "Team_Level:: $Team_Level:\n"
. "secnumber: $secnumber\n"
. "checksum: $checksum\n"
. "Additional_Info: $Additional_Info\n"
. "This message was sent by the trial version of PHP-Form Wizard, To Get the full version please use this link: http://tools4php.com/form-wizard/order.html";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
//Sending auto respond Email to visitor
$pfw_header = "From: bpavone@glghl.com"
. "Reply-To: bpavone@glghl.com";
$pfw_subject = "GLGHL Rep Contact Form";
$pfw_email_to = $Email;
$pfw_message = "Thank you for your submission. Your form data has been submitted.\n"
."This is what we have received: \n"
. "................................................. \n"
. "Position: $Position\n"
. "Position_Other: $Position_Other\n"
. "Name: $Name\n"
. "Address: $Address\n"
. "City: $City\n"
. "State: $State\n"
. "Zip: $Zip\n"
. "Email: $Email\n"
. "Home_Phone: $Home_Phone\n"
. "Work_Phone: $Work_Phone\n"
. "Cell_Phone: $Cell_Phone\n"
. "Division: $Division\n"
. "Home_Team: $Home_Team\n"
. "Team_Other: $Team_Other\n"
. "Team_Level:: $Team_Level:\n"
. "secnumber: $secnumber\n"
. "checksum: $checksum\n"
. "Additional_Info: $Additional_Info\n"
. "If any additional info is required we shall get back to you as soon as possible.\n"
. "GLGHL Webmaster.\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: http://glghl.com/thank_you.html");
?>