'Nick Holden', 'AA' => 'Nick Holden', 'QX' => 'Kevin Ma', 'AC' => 'Nick Holden', 'AE' => 'Sam Tisdale', 'AG' => 'Kevin Ma' ); // Regex patterns each parameter must adhere to. $patterns = array( 'sid' => "/^\\d{7}$/", 'section' => "/^" . implode('|', array_keys($tas)) . "$/", 'assignment' => "/^hw[1-3]$/" ); $valid = true; $student_name = ''; $sid = ''; $section = ''; $assignment = ''; if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Get 'sid', 'section', 'assignment' parameters. $student_name = get_param('name'); $sid = get_param('sid'); $section = get_param('section'); $assignment = get_param('assignment'); // Validate each parameter. foreach ($patterns as $paramname => $pattern) { if (!preg_match($pattern, $$paramname)) { $valid = false; } } } ?> CSE 154 Homework Turnin

CSE 154 Homework Turnin

ERROR: you filled it out wrong!

Tell me about you: Your name:
Your Student ID:
Your section:
Tell me about what you're turning in: Assignment: Code:
Academic integrity:

Thanks!