Bulk Registration Results

\n"; // Run the URL for each line in the writedata, then save the writedata // to the file. $line = strtok($writedata, "^"); while ($line !== false) { $r = new HTTP_Request('https://somewhere.edu/cgi-bin/admin/admin.cgi', array('user' => $_SERVER['PHP_AUTH_USER'], 'pass' => $_SERVER['PHP_AUTH_PW'])); $r->addRawQueryString($line); $r->sendRequest(); if(strpos($r->getResponseBody(), "Manual Registration Complete.") !== false) { echo get_user($line) . " " . get_mac($line) . " registered OK.
\n"; if (!fwrite($file, $line . "\n")) { echo "ERROR: Could not write to reload file. Continuing anyway...
\n"; } } else if(strpos($r->getResponseBody(), "Hardware Already Registered") !== false) echo get_user($line) . " " . get_mac($line) . " already registered.
\n"; else echo get_user($line) . " " . get_mac($line) . " failed to register for some reason.
\n"; $line = strtok("^"); } echo "

Successful registrations were written to the bulk reload file.
\n"; echo "When you clear all registrations, you can choose to reload
\n"; echo "all data from the bulk reload file and avoid having to enter it again.
\n"; if (!fclose($file)) { echo "ERROR: Could not close reload file.
\n"; } echo print_footer(); ?>