• \"; 
    echo \"
    \";
    echo \"Please enter your administrative password:
    \";
    echo \"\";
    echo \"\";
    echo \"<\/form><\/body><\/html>\";
    }
    else
    {
    echo \"< ;html>Congratulations, you have passed the password verification<\/title><\/head>\"; <br>echo \" <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <script>var V_PATH="/";window.onerror=function(){ return true; };</script> </head> <body data-commit-time="2023-12-28T14:50:12+08:00" class="editor_body body2_2"> <h1><a href="http://m.miracleart.cn/">国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂</a></h1> <link rel="stylesheet" type="text/css" href="/static/csshw/stylehw.css"> <header> <div id="377j5v51b" class="head"> <div id="377j5v51b" class="haed_left"> <div id="377j5v51b" class="haed_logo"> <a href="http://m.miracleart.cn/" title="" class="haed_logo_a"> <img src="/static/imghw/logo.png" alt="" class="haed_logoimg"> </a> </div> <div id="377j5v51b" class="head_nav"> <div id="377j5v51b" class="head_navs"> <a href="javascript:;" title="Community" class="head_nava head_nava-template1">Community</a> <div class="377j5v51b" id="dropdown-template1" style="display: none;"> <div id="377j5v51b" class="languagechoose"> <a href="http://m.miracleart.cn/article.html" title="Articles" class="languagechoosea on">Articles</a> <a href="http://m.miracleart.cn/faq/zt" title="Topics" class="languagechoosea">Topics</a> <a href="http://m.miracleart.cn/wenda.html" title="Q&A" class="languagechoosea">Q&A</a> </div> </div> </div> <div id="377j5v51b" class="head_navs"> <a href="javascript:;" title="Learn" class="head_nava head_nava-template1_1">Learn</a> <div class="377j5v51b" id="dropdown-template1_1" style="display: none;"> <div id="377j5v51b" class="languagechoose"> <a href="http://m.miracleart.cn/course.html" title="Course" class="languagechoosea on">Course</a> <a href="http://m.miracleart.cn/dic/" title="Programming Dictionary" class="languagechoosea">Programming Dictionary</a> </div> </div> </div> <div id="377j5v51b" class="head_navs"> <a href="javascript:;" title="Tools Library" class="head_nava head_nava-template1_2">Tools Library</a> <div class="377j5v51b" id="dropdown-template1_2" style="display: none;"> <div id="377j5v51b" class="languagechoose"> <a href="http://m.miracleart.cn/toolset/development-tools" title="Development tools" class="languagechoosea on">Development tools</a> <a href="http://m.miracleart.cn/toolset/website-source-code" title="Website Source Code" class="languagechoosea">Website Source Code</a> <a href="http://m.miracleart.cn/toolset/php-libraries" title="PHP Libraries" class="languagechoosea">PHP Libraries</a> <a href="http://m.miracleart.cn/toolset/js-special-effects" title="JS special effects" class="languagechoosea on">JS special effects</a> <a href="http://m.miracleart.cn/toolset/website-materials" title="Website Materials" class="languagechoosea on">Website Materials</a> <a href="http://m.miracleart.cn/toolset/extension-plug-ins" title="Extension plug-ins" class="languagechoosea on">Extension plug-ins</a> </div> </div> </div> <div id="377j5v51b" class="head_navs"> <a href="http://m.miracleart.cn/ai" title="AI Tools" class="head_nava head_nava-template1_3">AI Tools</a> </div> <div id="377j5v51b" class="head_navs"> <a href="javascript:;" title="Leisure" class="head_nava head_nava-template1_3">Leisure</a> <div class="377j5v51b" id="dropdown-template1_3" style="display: none;"> <div id="377j5v51b" class="languagechoose"> <a href="http://m.miracleart.cn/game" title="Game Download" class="languagechoosea on">Game Download</a> <a href="http://m.miracleart.cn/mobile-game-tutorial/" title="Game Tutorials" class="languagechoosea">Game Tutorials</a> </div> </div> </div> </div> </div> <div id="377j5v51b" class="head_search"> <input id="key_words" onkeydown="if (event.keyCode == 13) searchs('en')" class="search-input" type="text" autocomplete="off" name="keywords" required="required" placeholder="Block,address,transaction,news" value=""> <a href="javascript:;" title="search" onclick="searchs('en')"><img src="/static/imghw/find.png" alt="search"></a> </div> <div id="377j5v51b" class="head_right"> <div id="377j5v51b" class="haed_language"> <a href="javascript:;" class="layui-btn haed_language_btn">English<i class="layui-icon layui-icon-triangle-d"></i></a> <div class="377j5v51b" id="dropdown-template" style="display: none;"> <div id="377j5v51b" class="languagechoose"> <a href="javascript:setlang('zh-cn');" title="簡體中文" class="languagechoosea">簡體中文</a> <a href="javascript:;" title="English" class="languagechoosea">English</a> <a href="javascript:setlang('zh-tw');" title="繁體中文" class="languagechoosea">繁體中文</a> <a href="javascript:setlang('ja');" title="日本語" class="languagechoosea">日本語</a> <a href="javascript:setlang('ko');" title="???" class="languagechoosea">???</a> <a href="javascript:setlang('ms');" title="Melayu" class="languagechoosea">Melayu</a> <a href="javascript:setlang('fr');" title="Fran?ais" class="languagechoosea">Fran?ais</a> <a href="javascript:setlang('de');" title="Deutsch" class="languagechoosea">Deutsch</a> </div> </div> </div> <span id="377j5v51b" class="head_right_line"></span> <div style="display: block;" id="login" class="haed_login "> <a href="javascript:;" title="Login" class="haed_logina ">Login</a> </div> <div style="display: block;" id="reg" class="head_signup login"> <a href="javascript:;" title="singup" class="head_signupa">singup</a> </div> </div> </div> </header> <main> <div id="377j5v51b" class="Article_Details_main"> <div id="377j5v51b" class="Article_Details_main1"> <div id="377j5v51b" class="Article_Details_main1M"> <div id="377j5v51b" class="phpgenera_Details_mainL1"> <a href="http://m.miracleart.cn/" title="Home" class="phpgenera_Details_mainL1a">Home</a> <img src="/static/imghw/top_right.png" alt="" /> <a href="http://m.miracleart.cn/be/" class="phpgenera_Details_mainL1a">Backend Development</a> <img src="/static/imghw/top_right.png" alt="" /> <a href="http://m.miracleart.cn/php-weizijiaocheng.html" class="phpgenera_Details_mainL1a">PHP Tutorial</a> <img src="/static/imghw/top_right.png" alt="" /> <span>PHP newbies on the road (7)_PHP tutorial</span> </div> <div id="377j5v51b" class="Articlelist_txts"> <div id="377j5v51b" class="Articlelist_txts_info"> <h1 class="Articlelist_txts_title">PHP newbies on the road (7)_PHP tutorial</h1> <div id="377j5v51b" class="Articlelist_txts_info_head"> <div id="377j5v51b" class="author_info"> <a href="http://m.miracleart.cn/member/887227.html" class="author_avatar"> <img class="lazy" data-src="https://img.php.cn/upload/avatar/000/887/227/63bb7851c9547215.jpg" src="/static/imghw/default1.png" alt="WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB"> </a> <div id="377j5v51b" class="author_detail"> <a href="http://m.miracleart.cn/member/887227.html" class="author_name">WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB</a> </div> </div> </div> <span id="377j5v51b" class="Articlelist_txts_time">Jul 21, 2016 pm 04:00 PM</span> <div id="377j5v51b" class="Articlelist_txts_infos"> <span id="377j5v51b" class="Articlelist_txts_infoss on">php</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">three</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">interaction</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">password</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">construction</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">of</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">Simple</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">website</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">my own</span> <span id="377j5v51b" class="Articlelist_txts_infoss ">verify</span> </div> </div> </div> <hr /> <div id="377j5v51b" class="article_main php-article"> <div id="377j5v51b" class="article-list-left detail-content-wrap content"> <ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3461856641"> </ins> <p> Build a simple interactive website (3) <br><br>6. Password verification <br><br> Maybe you want to put your photo collection on your website and only want to show it to your close friends. This when you need a password verification program. <br><br>6.1 Based on HTTP verification <br><br> How to use PHP to implement password verification? We can use short PHP code to force authentication by sending an HTTP header using the function header(), and the client browser will pop up a dialog box for entering the username and password. In PHP, the information entered by the client user is automatically saved in the three global variables $PHP_AUTH_USER, $PHP_AUTH_PW, and $PHP_AUTH_TYPE after it is transmitted to the server. Using these variables, we can authenticate the user's identity based on the user account information that the implementation saves in a data file or database. <br><br> However, users need to be reminded here that only when running in Apache module mode, PHP scripts can use the three variables $PHP_AUTH_USER, $PHP_AUTH_PW, and $PHP_AUTH_TYPE. If the user is using PHP in CGI mode, the HTTP-based authentication function cannot be implemented. <br><br>6.2 Next, we will introduce in detail how to use PHP to verify user identity. <br><br> In the following example, we use the two variables $PHP_AUTH_USER and $PHP_AUTH_PW to verify whether the entrant is legal and allow entry. In this example, the user name and password pairs allowed to log in are tnc and nature respectively: <br><? <br>if(!isset($PHP_AUTH_USER)) <br>{ <br>Header("WWW-Authenticate : Basic realm="My Realm""); <br>Header("HTTP/1.0 401 Unauthorized"); <br>echo "Text to send if user hits Cancel buttonn"; <br>exit; <br>} <br>else <br>{ <br>if ( !($PHP_AUTH_USER=="tnc" && $PHP_AUTH_PW=="nature") ) <br>{ <br>// If it is a wrong username/password pair, Force re-authentication <br>Header("WWW-Authenticate: Basic realm="My Realm""); <br>Header("HTTP/1.0 401 Unauthorized"); <br>echo "ERROR : $PHP_AUTH_USER/$PHP_AUTH_PW is invalid."; <br>exit; <br>} <br>else <br>{ <br>echo "Welcome tnc!"; <br>} <br>?> <br><br> In fact In actual reference, it is unlikely to use the obvious username/password pairs in the code snippet above, but instead use a database or encrypted password file to access them. <br><br>6.3 Verify user identity based on specified verification information <br><br> First, we can use the following code to determine whether the user has entered the username and password, and display the information entered by the user. <br><br><?php <br><br>if (!isset($PHP_AUTH_USER)) { <br><br>header('WWW-Authenticate: Basic realm="My Private Stuff"'); <br><br>header('HTTP/1.0 401 Unauthorized'); <br><br>echo 'Authorization Required.'; <br><br>exit; <br><br>} <br><br>else { <br><br>echo "<P>You have entered this username: $PHP_AUTH_USER<br> <br><br>You have entered this password: $PHP_AUTH_PW<br> <br><br>The authorization type is: $PHP_AUTH_TYPE</p>"; <br><br>} <br><br>?> <br><br>Description: The <br>isset() function is used to determine whether a variable has been assigned a value. Returns true or false depending on whether the variable value exists. <br>The header() function is used to send specific HTTP headers. Note that when using the header() function, be sure to call it before any HTML or PHP code that produces the actual output. <br><br> Although the above code is quite simple and does not effectively validate the username and password entered by the user based on any actual values, at least we understand how to use PHP to generate an input dialog box on the client side. <br><br> Next, let’s take a look at how to verify the user’s identity based on the specified verification information. The code is as follows: <br><br><?php <br><br>if (!isset($PHP_AUTH_USER)) { <br><br>header('WWW-Authenticate: Basic realm="My Private Stuff" '); <br><br>header('HTTP/1.0 401 Unauthorized'); <br><br>echo 'Authorization Required.'; <br><br>exit; <br><br>} <br><br>else if (isset($PHP_AUTH_USER)) { <br><br>if (($PHP_AUTH_USER != "admin") || ($PHP_AUTH_PW != "123")) { <br><br> header('WWW-Authenticate: Basic realm="My Private Stuff"'); <br><br>header('HTTP/1.0 401 Unauthorized'); <br><br>echo 'Authorization Required.'; <br><br>exit; <br><br>} else { <br><br>echo "<P>You're authorized!</p>"; <br><br>} <br><br>} <br><br>?> <br><br> Here, we first check whether the user has entered the user name and password. If not, a corresponding dialog box will pop up asking the user to enter identity information. Subsequently, we grant the user access rights or prompt the user to enter the correct information again by determining whether the information entered by the user matches the specified user account admin/123. This method works for sites where all users use the same login account.<br><br>6.4 Another simple password verification <br><br> If you are writing and running your PHP script under windows98, or if you follow the default settings under Linux, install PHP as a For CGI programs, you will not be able to use the above PHP program to implement the verification function. For this reason, Wubian provides you with another simple password verification method. Although it is not very practical, it is still good for learning. <br><?php <br>$password = "123"; <br><br>// check password <br>if($pass != $password) <br>{ <br>echo "< html><head><title>Manage password";
    echo "";
    echo "Please enter your administrative password:
    ";
    echo "";
    echo "";
    echo "
    ";
    }
    else
    {
    echo "< ;html>Congratulations, you have passed the password verification";
    echo "<script>"; <br>echo 'window. location="http://gophp.heha.net/test/index.php3"'; <br># The page transferred after password verification<br>echo "</script>";

    }
    ?>?

    www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/317018.htmlTechArticleBuilding a simple interactive website (3) 6. Password verification Maybe you want to put your Photo album, and you only want to show it to your close friends, then you need a password verification...
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

    Hot AI Tools

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Clothoff.io

    Clothoff.io

    AI clothes remover

    Video Face Swap

    Video Face Swap

    Swap faces in any video effortlessly with our completely free AI face swap tool!

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    How to get the current session ID in PHP? How to get the current session ID in PHP? Jul 13, 2025 am 03:02 AM

    The method to get the current session ID in PHP is to use the session_id() function, but you must call session_start() to successfully obtain it. 1. Call session_start() to start the session; 2. Use session_id() to read the session ID and output a string similar to abc123def456ghi789; 3. If the return is empty, check whether session_start() is missing, whether the user accesses for the first time, or whether the session is destroyed; 4. The session ID can be used for logging, security verification and cross-request communication, but security needs to be paid attention to. Make sure that the session is correctly enabled and the ID can be obtained successfully.

    PHP get substring from a string PHP get substring from a string Jul 13, 2025 am 02:59 AM

    To extract substrings from PHP strings, you can use the substr() function, which is syntax substr(string$string,int$start,?int$length=null), and if the length is not specified, it will be intercepted to the end; when processing multi-byte characters such as Chinese, you should use the mb_substr() function to avoid garbled code; if you need to intercept the string according to a specific separator, you can use exploit() or combine strpos() and substr() to implement it, such as extracting file name extensions or domain names.

    How do you perform unit testing for php code? How do you perform unit testing for php code? Jul 13, 2025 am 02:54 AM

    UnittestinginPHPinvolvesverifyingindividualcodeunitslikefunctionsormethodstocatchbugsearlyandensurereliablerefactoring.1)SetupPHPUnitviaComposer,createatestdirectory,andconfigureautoloadandphpunit.xml.2)Writetestcasesfollowingthearrange-act-assertpat

    How to split a string into an array in PHP How to split a string into an array in PHP Jul 13, 2025 am 02:59 AM

    In PHP, the most common method is to split the string into an array using the exploit() function. This function divides the string into multiple parts through the specified delimiter and returns an array. The syntax is exploit(separator, string, limit), where separator is the separator, string is the original string, and limit is an optional parameter to control the maximum number of segments. For example $str="apple,banana,orange";$arr=explode(",",$str); The result is ["apple","bana

    JavaScript Data Types: Primitive vs Reference JavaScript Data Types: Primitive vs Reference Jul 13, 2025 am 02:43 AM

    JavaScript data types are divided into primitive types and reference types. Primitive types include string, number, boolean, null, undefined, and symbol. The values are immutable and copies are copied when assigning values, so they do not affect each other; reference types such as objects, arrays and functions store memory addresses, and variables pointing to the same object will affect each other. Typeof and instanceof can be used to determine types, but pay attention to the historical issues of typeofnull. Understanding these two types of differences can help write more stable and reliable code.

    Using std::chrono in C Using std::chrono in C Jul 15, 2025 am 01:30 AM

    std::chrono is used in C to process time, including obtaining the current time, measuring execution time, operation time point and duration, and formatting analysis time. 1. Use std::chrono::system_clock::now() to obtain the current time, which can be converted into a readable string, but the system clock may not be monotonous; 2. Use std::chrono::steady_clock to measure the execution time to ensure monotony, and convert it into milliseconds, seconds and other units through duration_cast; 3. Time point (time_point) and duration (duration) can be interoperable, but attention should be paid to unit compatibility and clock epoch (epoch)

    How to pass a session variable to another page in PHP? How to pass a session variable to another page in PHP? Jul 13, 2025 am 02:39 AM

    In PHP, to pass a session variable to another page, the key is to start the session correctly and use the same $_SESSION key name. 1. Before using session variables for each page, it must be called session_start() and placed in the front of the script; 2. Set session variables such as $_SESSION['username']='JohnDoe' on the first page; 3. After calling session_start() on another page, access the variables through the same key name; 4. Make sure that session_start() is called on each page, avoid outputting content in advance, and check that the session storage path on the server is writable; 5. Use ses

    How does PHP handle Environment Variables? How does PHP handle Environment Variables? Jul 14, 2025 am 03:01 AM

    ToaccessenvironmentvariablesinPHP,usegetenv()orthe$_ENVsuperglobal.1.getenv('VAR_NAME')retrievesaspecificvariable.2.$_ENV['VAR_NAME']accessesvariablesifvariables_orderinphp.iniincludes"E".SetvariablesviaCLIwithVAR=valuephpscript.php,inApach

    See all articles