For a piece of vbs code about verification code judgment, convert it to php code VBScriptcode & lt; % 'to determine whether the confirmation button is pressed. if so, compare whether the verification code is entered correctly IfRequest. queryString (& quot; submit & quot;) & lt; & gt; & quot; a piece of vbs code for determining the verification code. convert it to php code.
VBScript code
<% 'Indicates whether the OK button is pressed. If yes, check whether the verification code is entered correctly If Request. queryString ("submit") <> "" Then Dim checkCode, sessionCode checkCode = Trim (Request. queryString ("checkCode") sessionCode = Session ("verifycode") 'the following two statements are used to convert all registration codes to uppercase, so that you can easily enter checkCode = UCase (checkCode) sessionCode = UCase (sessionCode) If checkCode = sessionCode Then Response. redirect ("http://www.hzynh.cn") ''here, after the verification is successful, you can jump to Else Response. write ("script" alert ('verification code error, please enter 'again); script ") End If %>
------ Solution --------------------
PHP code
------ Solution --------------------
If (isset ($ _ POST ['submit '])
{
$ CheckCode = Trim ($ _ POST ['checkcode']);
Session_start ();
$ SessionCode = $ _ SESSION ['verifycode'];
Session_destroy ();
$ CheckCode = UCase ($ checkCode );
$ SessionCode = UCase ($ sessionCode );
If ($ checkCode = $ sessionCode)
{
Header ("Location: http://www.hzynh.cn ");
}
Else
{
Echo "script" alert ('verification code error, please input it again '); script ";
}
}
?>
------ Solution --------------------
If you read the php session, you have not enabled the session.
Session_start ();
If you try to read the asp session, sorry, you cannot read it.