diff --git a/signup/submit.php b/signup/submit.php index 2c185ebe3..35c972a40 100644 --- a/signup/submit.php +++ b/signup/submit.php @@ -54,32 +54,32 @@ function fillVars () initVars (); global $vars; - $vars[name] = stripslashes($_POST[name]); - $vars[address] = stripslashes($_POST[address]); - $vars[phone] = stripslashes($_POST[phone]); - $vars[kinname] = stripslashes($_POST[kinname]); - $vars[kinaddress] = stripslashes($_POST[kinaddress]); - $vars[phone] = stripslashes($_POST[phone]); - $vars[kinphone] = stripslashes($_POST[kinphone]); - $vars[email] = stripslashes($_POST[email]); - $vars[kinemail] = stripslashes($_POST[kinemail]); - $vars[relation] = stripslashes($_POST[relation]); - $vars[veggie] = stripslashes($_POST[veggie]); - $vars[student] = stripslashes($_POST[student]); - $vars[transport_ok] = stripslashes($_POST[transport_ok]); - $vars[from_uk] = stripslashes($_POST[from_uk]); - $vars[returning_uk] = stripslashes($_POST[returning_uk]); - $vars[tent] = stripslashes($_POST[tent]); - $vars[top_tent_cap] = stripslashes($_POST[top_tent_cap]); - $vars[btent] = stripslashes($_POST[btent]); - $vars[base_tent_cap] = stripslashes($_POST[base_tent_cap]); - $vars[medic_info] = stripslashes($_POST[medic_info]); - $vars[extra_info] = stripslashes($_POST[extra_info]); - $vars[aims] = stripslashes($_POST[aims]); - $vars[transport_info] = stripslashes($_POST[transport_info]); - $vars[medication] = stripslashes($_POST[medication]); - $vars[allergies] = stripslashes($_POST[allergies]); - $vars[bivvy] = stripslashes($_POST[bivvy]); + $vars["name"] = stripslashes($_POST["name"]); + $vars["address"] = stripslashes($_POST["address"]); + $vars["phone"] = stripslashes($_POST["phone"]); + $vars["kinname"] = stripslashes($_POST["kinname"]); + $vars["kinaddress"] = stripslashes($_POST["kinaddress"]); + $vars["phone"] = stripslashes($_POST["phone"]); + $vars["kinphone"] = stripslashes($_POST["kinphone"]); + $vars["email"] = stripslashes($_POST["email"]); + $vars["kinemail"] = stripslashes($_POST["kinemail"]); + $vars["relation"] = stripslashes($_POST["relation"]); + $vars["veggie"] = stripslashes($_POST["veggie"]); + $vars["student"] = stripslashes($_POST["student"]); + $vars["transport_ok"] = stripslashes($_POST["transport_ok"]); + $vars["from_uk"] = stripslashes($_POST["from_uk"]); + $vars["returning_uk"] = stripslashes($_POST["returning_uk"]); + $vars["tent"] = stripslashes($_POST["tent"]); + $vars["top_tent_cap"] = stripslashes($_POST["top_tent_cap"]); + $vars["btent"] = stripslashes($_POST["btent"]); + $vars["base_tent_cap"] = stripslashes($_POST["base_tent_cap"]); + $vars["medic_info"] = stripslashes($_POST["medic_info"]); + $vars["extra_info"] = stripslashes($_POST["extra_info"]); + $vars["aims"] = stripslashes($_POST["aims"]); + $vars["transport_info"] = stripslashes($_POST["transport_info"]); + $vars["medication"] = stripslashes($_POST["medication"]); + $vars["allergies"] = stripslashes($_POST["allergies"]); + $vars["bivvy"] = stripslashes($_POST["bivvy"]); } function errorPage ($err) @@ -100,31 +100,31 @@ function securityChecks () $error = ""; - if ($vars[name] == "") $error = "You must specify your full name."; - elseif ($vars[address] == "") $error = "You must specify your address."; - elseif ($vars[kinname] == "") $error = "You must specify the name of your next-of-kin."; - elseif ($vars[kinaddress] == "") $error = "You must specify your next-of-kin's address."; - elseif ($vars[kinphone] == "") $error = "You must specify your next-of-kin's phone number."; - elseif ($vars[email] != "" && !ereg( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $vars[email])) $error = "Invalid email address (leave blank if you don't have one)."; - elseif ($vars[kinemail] != "" && !ereg( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $vars[kinemail])) $error = "Invalid next-of-kin email address (leave blank if they don't have one)."; - elseif ($vars[veggie] != "yes" && $vars[veggie] != "no" && $vars[veggie] != "mostly") $error = "Invalid veggie specification."; - elseif ($vars[student] != "yes" && $vars[student] != "no") $error = "Invalid student specification."; - elseif ($vars[transport_ok] != "yes" && $vars[transport_ok] != "no") $error = "Invalid transport specification given."; - elseif ($vars[bivvy] != "" && $vars[bivvy] != "yes") $error = "Invalid bivvy specification."; - elseif ($vars[tent] != "" && $vars[tent] != "yes") $error = "Invalid Top Camp tent specification."; - elseif ($vars[btent] != "" && $vars[btent] != "yes") $error = "Invalid Base Camp tent specification."; - elseif ($vars[tent] == "yes" && ($vars[top_tent_cap] < 1 || $vars[top_tent_cap] > 9)) $error = "Invalid Top Camp tent capacity given."; - elseif ($vars[btent] == "yes" && ($vars[base_tent_cap] < 1 || $vars[base_tent_cap] > 9)) $error = "Invalid Base Camp tent capacity given."; + if ($vars["name"] == "") $error = "You must specify your full name."; + elseif ($vars["address"] == "") $error = "You must specify your address."; + elseif ($vars["kinname"] == "") $error = "You must specify the name of your next-of-kin."; + elseif ($vars["kinaddress"] == "") $error = "You must specify your next-of-kin's address."; + elseif ($vars["kinphone"] == "") $error = "You must specify your next-of-kin's phone number."; + elseif ($vars["email"] != "" && !ereg( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $vars["email"])) $error = "Invalid email address (leave blank if you don't have one)."; + elseif ($vars["kinemail"] != "" && !ereg( '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $vars[kinemail])) $error = "Invalid next-of-kin email address (leave blank if they don't have one)."; + elseif ($vars["veggie"] != "yes" && $vars["veggie"] != "no" && $vars["veggie"] != "mostly") $error = "Invalid veggie specification."; + elseif ($vars["student"] != "yes" && $vars["student"] != "no") $error = "Invalid student specification."; + elseif ($vars["transport_ok"] != "yes" && $vars["transport_ok"] != "no") $error = "Invalid transport specification given."; + elseif ($vars["bivvy"] != "" && $vars["bivvy"] != "yes") $error = "Invalid bivvy specification."; + elseif ($vars["tent"] != "" && $vars["tent"] != "yes") $error = "Invalid Top Camp tent specification."; + elseif ($vars["btent"] != "" && $vars["btent"] != "yes") $error = "Invalid Base Camp tent specification."; + elseif ($vars["tent"] == "yes" && ($vars["top_tent_cap"] < 1 || $vars["top_tent_cap"] > 9)) $error = "Invalid Top Camp tent capacity given."; + elseif ($vars["btent"] == "yes" && ($vars["base_tent_cap"] < 1 || $vars["base_tent_cap"] > 9)) $error = "Invalid Base Camp tent capacity given."; if ($error != "") { - echo "