Reg.html
The reg.html page has an IFRAME tag, which is used by the IFRAME to request PHP verification that the user name is available.
<html><head><metacharset="Utf-8"><title>IFrame Local Refresh
title
>
Head
><body><formMethod="POST"action= "">User name:<inputtype="text"id="uname"name= ' username ' /><spanid="msg"style="color:red;" >
span
>
Form
><iframeBorder=' 0 'width=' 0 'height= ' 0 ' id=' myiframe ' >
iframe
><scripttype="Text/javascript">let the IFRAME request check_reg.php document.getElementById (' uname ') when the user name input box loses focus . onblur = function(){if(this. Value! = ") {Document.getelementby Id (' Myiframe '). src = ' check_reg.php?username= '+ this. value; } }
Script
>
Body
>
HTML
>
check_reg.php
header("content-type:text/html;charset=utf-8");$username = $_GET['username'];if($username == 'admin'){ $msg = '对不起,用户名已被使用!';}else{ $msg = '恭喜!该用户名可以使用。';}echo<<
<>< span="">
?>
<>
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above introduces PHP through the IFRAME to achieve local refresh, including the content of the IFRAME, I hope that the PHP tutorial interested in a friend helpful.