Quick and dirty Test verifier

= '0' && $Char <= '9') || ($Char >= 'A' && $Char <= 'F')) { $CertSerial = $CertSerial . $Char; } } if (substr($CertSerial, 0, 2) === "00") { $CertSerial = substr($CertSerial, 2); } } if (strlen($CertSerial)<4 || strlen($CertSerial)>8) { echo "Sorry, invalid serial number '$CertSerial'!\n"; } elseif (strlen(stristr($_SERVER['SSL_CLIENT_S_DN'], "/emailAddress=education@cacert.org"))<1) { echo "Sorry, a client certificate with emailAddress=education@cacert.org is needed!\n"; } elseif (strlen($CertSerial) > 0) { require_once("includes/db_connect.inc"); $statement="SELECT t.t_id, t.topic, ". " (SELECT max(lp.date) FROM learnprogress lp WHERE lp.t_id=t.t_id AND lp.user_id='$CertSerial' AND lp.percentage >= t.percentage) Time ". "FROM topics t ". "WHERE EXISTS(SELECT 1 FROM learnprogress lp WHERE lp.user_id='$CertSerial' AND lp.t_id=t.t_id AND lp.percentage >= t.percentage)"; $query = mysql_query($statement); echo "

Passed tests by certificate '$CertSerial'

\n"; echo "\n"; while($row = mysql_fetch_assoc($query)) { echo "\n"; } echo "
TopicIDTopicNameLast Success
".$row['t_id']."".$row['topic']."".$row['Time']."
\n"; } ?>

Cert serial: