suchen
Heimphp教程php手册大学英语四六级成绩查询系统核心代码

查询系统

  • 前几天做了个大学英语四六级成绩查询系统,一个 phprpc 版本,一个 wap 版本。它们的核心代码都是相同的。下面就是从 etang.cet 获取大学英语四六级成绩的核心代码:

    下载: cetquery.php
    1. function query($examid, $examtype) {
    2.     $examid = trim($examid);
    3.     $examtype = trim($examtype);
    4.     if (!is_numeric($examid)) {
    5.         return '准考证号码必须是数字';
    6.     }
    7.     if (strlen($examid) != 15) {
    8.         return '准考证号码不正确';
    9.     }
    10.     if ($examtype == '1') {
    11.         if ((substr($examid, 6, 4) != '0521') &&
    12.             (substr($examid, 6, 4) != '1052')) {
    13.             return '准考证号码与考试类型不符';
    14.         }
    15.     }
    16.     if ($examtype == '2') {
    17.         if ((substr($examid, 6, 4) != '0512') &&
    18.             (substr($examid, 6, 4) != '0522') &&
    19.             (substr($examid, 6, 4) != '2052')) {
    20.             return '准考证号码与考试类型不符';
    21.         }
    22.     }
    23.     $examid1 = substr($examid, 0, 6) . $examtype . '052' . substr($examid, 10, 5);
    24.     $request = "examtype=$examtype&examid=$examid&image.x=23&image.y=32";
    25.     $content_len = strlen($request);
    26.     $handle = @fsockopen('cet.etang.com', 80, $errno, $errstr, 10);
    27.     $buf = '';
    28.     $id = base_convert(mt_rand().mt_rand(), 10, 36);
    29.     if ($handle) {
    30.         $http_request =
    31.             "POST /dog/cet HTTP/1.0\r\n" .
    32.             "Accept: */*\r\n" .
    33.             "Referer: http://cet.etang.com/cet_girldemand_$id.htm\r\n" .
    34.             "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar)\r\n" .
    35.             "Host: cet.etang.com\r\n" .
    36.             "Content-Type: application/x-www-form-urlencoded\r\n" .
    37.             "Content-Length: $content_len\r\n" .
    38.             "Cache-Control: no-cache\r\n" .
    39.             "Cookie: zi=A; examid1=$examid; examtype1=$examtype; sex=girl; examid=$examid1; examtype=$examtype\r\n" .
    40.             "\r\n" .
    41.             $request;
    42.         fputs($handle, $http_request, strlen($http_request));
    43.         while (!feof($handle)) {
    44.             $buf .= fgets($handle, 128);
    45.         }
    46.         fclose($handle);
    47.     }
    48.     else {
    49.         return "查询服务器暂时无法连接";
    50.     }
    51.     $buf = explode("\r\n", $buf);
    52.     $buf = $buf[11];
    53.     $score = "";
    54.     if (substr($buf, 0, 18) == 'Set-Cookie: score=') {
    55.         $score = substr($buf, 18, strpos($buf, ';') - 18);
    56.     }
    57.     if (($score != '') and ($score != 'error')) {
    58.         $score = explode(',', $score);
    59.     }
    60.     else {
    61.         return '你所查询的准考证号码不存在';
    62.     }
    63.     return $score;
    64. }


  • Stellungnahme
    Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

    Heiße KI -Werkzeuge

    Undresser.AI Undress

    Undresser.AI Undress

    KI-gestützte App zum Erstellen realistischer Aktfotos

    AI Clothes Remover

    AI Clothes Remover

    Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

    Undress AI Tool

    Undress AI Tool

    Ausziehbilder kostenlos

    Clothoff.io

    Clothoff.io

    KI-Kleiderentferner

    AI Hentai Generator

    AI Hentai Generator

    Erstellen Sie kostenlos Ai Hentai.

    Heißer Artikel

    R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
    1 Monate vorBy尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O. Beste grafische Einstellungen
    1 Monate vorBy尊渡假赌尊渡假赌尊渡假赌
    Will R.E.P.O. Crossplay haben?
    1 Monate vorBy尊渡假赌尊渡假赌尊渡假赌

    Heiße Werkzeuge

    Senden Sie Studio 13.0.1

    Senden Sie Studio 13.0.1

    Leistungsstarke integrierte PHP-Entwicklungsumgebung

    WebStorm-Mac-Version

    WebStorm-Mac-Version

    Nützliche JavaScript-Entwicklungstools

    SublimeText3 Mac-Version

    SublimeText3 Mac-Version

    Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

    DVWA

    DVWA

    Damn Vulnerable Web App (DVWA) ist eine PHP/MySQL-Webanwendung, die sehr anfällig ist. Seine Hauptziele bestehen darin, Sicherheitsexperten dabei zu helfen, ihre Fähigkeiten und Tools in einem rechtlichen Umfeld zu testen, Webentwicklern dabei zu helfen, den Prozess der Sicherung von Webanwendungen besser zu verstehen, und Lehrern/Schülern dabei zu helfen, in einer Unterrichtsumgebung Webanwendungen zu lehren/lernen Sicherheit. Das Ziel von DVWA besteht darin, einige der häufigsten Web-Schwachstellen über eine einfache und unkomplizierte Benutzeroberfläche mit unterschiedlichen Schwierigkeitsgraden zu üben. Bitte beachten Sie, dass diese Software

    Dreamweaver Mac

    Dreamweaver Mac

    Visuelle Webentwicklungstools