<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head><br /><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><br /><title>CET查分小工具 | RockDai.com</title><br /><mce:style type="text/css" media="all"><!--<br />.red {<br />color: red;<br />}<br />#result li {<br />list-style: none;<br />}<br />--></mce:style><style type="text/css" media="all" mce_bogus="1">.red {<br />color: red;<br />}<br />#result li {<br />list-style: none;<br />}</style><br /></head><br /><body><br /><div id="wrapper"><br /><h1><em>CET查分小工具201003</em></h1><br /><form action="<?php $_SERVER['PHP_SELF'];?>" method="post"><br /><p>從<input type="text" name="sNum" size="20" />號 到 <input type="text" name="eNum" size="20" />號</p><br /><p><input type="submit" name="submit" value=" 查 詢 " /></p><br /><input type="hidden" name="submitted" value="TRUE" /><br /></form><br /><ol><br /><li>前6位是地區號.(可以問與你同一城市報名的任何一人)</li><br /><li>然後是091 (表示09年的第1次,即09年6月份的)</li><br /><li>然後是1或2 (1代表四級,2代表6級)</li><br /><li>然後的三位是你的考場號,多為0**或1**</li><br /><li>最後兩位是你的座位</li><br /></ol><br /><?php<br />if(isset($_POST['submitted'])) {</p><p>$trimmed = array_map('trim',$_POST);</p><p>if(empty($trimmed['sNum'])||empty($trimmed['eNum'])||$trimmed['sNum']-$trimmed['eNum']>0||(!is_numeric($trimmed['sNum']))||(!is_numeric($trimmed['eNum']))) {<br />echo '<p class="red">別搗亂!</p>';<br />exit();<br />} else if($trimmed['eNum']-$trimmed['sNum']>100) {<br />echo '<p class="red">為了防止逾時,每次查詢請不要超過100個考號</p>';<br />exit();<br />}</p><p>echo '<p><strong>查詢結果</strong></p>';</p><p>for($post_string = $trimmed['sNum'];$post_string <= $trimmed['eNum'];$post_string++)<br />{<br />$post_string = sprintf("%.0f",$post_string);</p><p>if((substr($post_string, 13, 2) == "00")||(substr($post_string, 13, 2) > "30")) {<br />echo '<p>'.$post_string.'該考號為空白</p>';<br />continue;<br />}</p><p>$remote_server = 'http://cet.99sushe.com/getscore.html';<br />$ch = curl_init();<br /> curl_setopt($ch,CURLOPT_URL,$remote_server);<br />curl_setopt($ch,CURLOPT_REFERER,'http://cet.99sushe.com');<br /> curl_setopt($ch,CURLOPT_POSTFIELDS,'id='.$post_string.'&vc=novcversion');<br /> curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);<br /> $data = curl_exec($ch);<br /> curl_close($ch);<br />if($data=='') {<br />echo '<p>'.$post_string.'該考號為空白</p>';<br />} else {<br />$result = explode(",", $data);<br />if($result[4]>=425)<br />echo '<ul id="result" class="red">';<br />else echo '<ul id="result">';<br /> echo '<li>學校:'.$result[5].'</li><li>姓名:'.$result[6].'</li><li>准考證號:'.$post_string.'</li><li>總分:'.$result[4].'</li><li>聽力:'.$result[0].'</li><li>閱讀:'.$result[1].'</li><li>綜合:'.$result[2].'</li><li>寫作:'.$result[3].'</li></ul>';<br />}<br />}<br />}<br />?><br /><p> RockDai.com | <a href="http://www.rockdai.com/?p=266" mce_href="http://www.rockdai.com/?p=266" target="_blank">原始碼下載</a></p><br /></div><br /></body><br /></html><br />
網上找了個查詢成績的代碼,另存新檔 xxx.php 直接使用。