'; $body .= '

Name: ' . $_POST['first'] . ' ' . $_POST['last'] . '

'; $body .= '

Organization: ' . $_POST['org'] . '

'; $body .= '

Email: ' . $_POST['email'] . '

'; if($_POST['attendBefore'] == 0) $attendBefore = 'No'; else $attendBefore = 'Yes'; $body .= '

Attended Before: ' . $attendBefore . '

'; if($_POST['friday'] == 0) $friday = 'No'; else $friday = 'Yes'; $body .= '

Attend dinner?: ' . $friday . '

'; if($_POST['meal'] == 0) $meal = 'No'; else $meal = 'Yes'; $body .= '

Vegetarian Meal: ' . $meal . '

'; $body .= "

Interests: " . $_POST['comments'] . '

'; $body .= ''; $headers = 'From: tonic@nondot.org' . "\r\n"; $headers .= 'Content-Type: text/html; charset="iso-8859-1"'."\n"; mail($to, $subject, $body, $headers); } function my_escape_string(&$item, $key) { $item = mysql_real_escape_string($item); } function processForm() { array_walk($_POST, 'my_escape_string'); if($_POST['attendBefore'] == 0) $attend = 2; else $attend = 1; if ($_POST['friday'] == 0) $friday = 2; else $friday = 1; if ($_POST['meal'] == 0) $meal = 2; else $meal = 1; $sql = "INSERT into attendees (lastName, firstName, organization, email, location, attendBefore, fridayDinner, mealVeg, comments) VALUES('$_POST[last]', '$_POST[first]', '$_POST[org]', '$_POST[email]', '$_POST[location]','$attend', '$friday', '$meal', '$_POST[comments]')"; mysql_query($sql) or die(mysql_error()); print 'Congratulations! You are now registered for the 2009 LLVM Developers\' Meeting.

Please sign up for the LLVM Developers\' Meeting mailing list to receive announcements about the event.

'; notify(); } function validateForm() { $errors = array(); // First name must be set. if ($_POST['first'] == "") array_push($errors, "First name must be provided"); if ($_POST['last'] == "") { array_push($errors, "Last name must be provided"); } if ($_POST['email'] == "") array_push($errors, "Email must be provided"); if ($_POST['org'] == "") array_push($errors, "Organization must be provided"); if ($_POST['location']=="") array_push($errors, "Location name must be provided"); if ($_POST['comments'] == "") array_push($errors, "Please specify interests."); return $errors; } // Print single line text box. function inputText($element_name, $size, $maxLength, $values) { print ''; } // Print text area. function inputTextarea($element_name, $row, $column, $values) { print ''; } // Print radio box. function inputRadiocheck($element_name, $values, $element_value) { print ''; } function showForm($errors) { if($errors) { print ''; print '

Errors:

'; print'
'; } print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
First Name: '; inputText("first", 50, 50, $_POST); print '
Last Name: '; inputText("last", 50, 50, $_POST); print'
Email: '; inputText("email", 50, 75, $_POST); print '
Organization: '; inputText("org", 50, 100, $_POST); print '
Where are you located? (City/State/Country): '; inputText("location", 50, 100, $_POST); print '
'; print '

Require vegetarian meals: '; inputRadioCheck("meal", $_POST, 0); print ' No '; inputRadioCheck("meal", $_POST, 1); print ' Yes

'; print '

Would you attend a group dinner afterwards?'; inputRadioCheck("friday", $_POST, 0); print ' No '; inputRadioCheck("friday", $_POST, 1); print ' Yes

'; print '

Have you attended a LLVM developers\' meeting before?'; inputRadioCheck("attendBefore", $_POST, 0); print ' No '; inputRadioCheck("attendBefore", $_POST, 1); print ' Yes

'; print '

What are you most interested in learning at the LLVM developers\' meeting? '; print '(i.e. general optimizations, llvm internals, clang, backend, not sure, etc)

'; print '

'; inputTextArea("comments", 5, 60, $_POST); print '

'; print '

'; print ''; print '
'; } ?>
LLVM Developers' Meeting - Registration
= 190){ print '

Registration is now closed.

'; exit; } ?>