Get Involved and Make a Difference: Join the staff at METNY Encampment
//start PHP Code //Server Access Variables $host = "mysql2.uscjhost.net"; //location of the MySQL database host $user = "metnyus_main"; //MySQL database username $pass = "guess"; //MySQL database password $db = "metnyus_staffsection"; //MySQL database name if(isset($_POST['check'])){ // get form input and check that the required information is there by setting variables equal to the POST data $fname = empty($_POST['fname']) ? die ("ERROR: Enter Your First Name") : mysql_escape_string($_POST['fname']); $lname = empty($_POST['lname']) ? die ("ERROR: Enter Your Last Name") : mysql_escape_string($_POST['lname']); $email = empty($_POST['email']) ? die ("ERROR: Please enter your email address. It will only be used to send you updates and such.") : mysql_escape_string($_POST['email']); $address = empty($_POST['address']) ? die ("ERROR: Enter Your Home Address") : mysql_escape_string($_POST['address']); $city = empty($_POST['city']) ? die ("ERROR: Enter Your City") : mysql_escape_string($_POST['city']); $zip = empty($_POST['zip']) ? die ("ERROR: Enter Your Zip Code") : mysql_escape_string($_POST['zip']); $phone = empty($_POST['phone']) ? die ("ERROR: Enter Your Phone Number (Home or Cell)") : mysql_escape_string($_POST['phonw']); $gradyear = empty($_POST['gradyear']) ? die ("ERROR: Enter Your Graduation Year") : mysql_escape_string($_POST['gradyear']); $college = empty($_POST['college']) ? die ("ERROR: Enter Your Current College") : mysql_escape_string($_POST['college']); $staffE = $_POST['staffE']; $staffYD = $_POST['staffYD']; $ip = $_POST['ip']; //for saftey, the form tracks IP addresses; this is done using a hidden field, so there's no need for it to be required echo "Data Confirmation
"; echo "Before we input your data into the database, we would like you to take one more look at it to confirm that it is all correct. If you see an error, use your browser's back button to change the data and return here. If it is all correct, you can submit the information using the button below.
"; echo "Name: ".$fname." ".$lname."
";
echo "Address: ".$address." ".$city.", NY ".$zip."
";
echo "Home Phone: ".$phone."
";
echo "E-mail Address: ".$email."
";
echo "HS Graduation Year: ".$gradyear."
";
echo "College: ".$college."
";
echo "Sending information about Staffing USY events: ".$staffE."
";
echo "Sending information about becoming a Youth Director or Advisor: ".$staffYD."
For saftey, your IP address has been recorded. If you see any error, please use your browser's back button and correct it. } //Check to See if anything needs to get inserted elseif(isset($_POST['submit'])){ // get form input and check that the required information is there by setting variables equal to the POST data $fname = empty($_POST['fname']) ? die ("ERROR: Enter Your First Name") : mysql_escape_string($_POST['fname']); $lname = empty($_POST['lname']) ? die ("ERROR: Enter Your Last Name") : mysql_escape_string($_POST['lname']); $email = empty($_POST['email']) ? die ("ERROR: Please enter your email address. It will only be used to send you updates and such.") : mysql_escape_string($_POST['email']); $address = empty($_POST['address']) ? die ("ERROR: Enter Your Home Address") : mysql_escape_string($_POST['address']); $city = empty($_POST['city']) ? die ("ERROR: Enter Your City") : mysql_escape_string($_POST['city']); $zip = empty($_POST['zip']) ? die ("ERROR: Enter Your Zip Code") : mysql_escape_string($_POST['zip']); $phone = empty($_POST['phone']) ? die ("ERROR: Enter Your Phone Number (Home or Cell)") : mysql_escape_string($_POST['phonw']); $gradyear = empty($_POST['gradyear']) ? die ("ERROR: Enter Your Graduation Year") : mysql_escape_string($_POST['gradyear']); $college = empty($_POST['college']) ? die ("ERROR: Enter Your Current College") : mysql_escape_string($_POST['college']); $ip = $_POST['ip']; //for saftey, the form tracks IP addresses; this is done using a hidden field, so there's no need for it to be required // open connection $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!"); // select database mysql_select_db($db) or die ("Unable to select database!"); // create query // this query will insert the data into the table 'staffsection'; to use another name, change the value between the single quotes $query = "INSERT INTO `staffsection` (`id`, `fname`, `lname`, `address`, `city`, `zip`, `phone`, `email`, `gradyear`, `college`, `staffE`, `staffYD`, `ip`) VALUES ('', '$fname', '$lname', '$address', '$city', '$zip', '$phone', '$email', '$gradyear', '$college', '$staffE', '$staffYD', '$ip')"; // execute query $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); // print message with ID of inserted record echo "Thank you for submitting your information. It has been inserted into the database."; echo ""; // close connection mysql_close($connection); } else{ echo ""; ?> All Fields are Mandatory. } // free result set memory mysql_free_result($result); // close connection mysql_close($connection); ?>
If you have any questions about staffing USY events or reconnecting with other METNY USYers, please contact Lindsay Unger at ilovjeter247@gmail.com
| Application for Returning Staff (.doc) (.PDF) |
| Application for New Staff (.doc) (.PDF) |
Useful Links for Youth Directors and Advisors:
Membership Submission Forms (USY), Membership Submission Forms (KADIMA), Advisor Listserve, Online Program Bank, Jewish Youth Directors Association.
