![]() |
| |||||||
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
| |||
| I had previously installed php-4.3.9 and apache-2.0.49 on my solaris9 server and written a php script for user login, it ran well until today...:-( today for some reasons I upgraded php to php-5.1.2, complied as apache's DSO module, and I found the script couldn't work when being accessed by IE. I didn't know why...It seemed php script hadn't transfered variables submmitted by web form to itself...now the following is my script: <?php if ($queryflag == 1) { $ybn="admin"; $ybp="111"; $ybusername=$_POST["username"]; $ybuserpwd=$_POST["password"]; if ($ybusername==$ybn AND $ybuserpwd==$ybp){ session_start(); $_SESSION["admin"]=true; header("location: testtest.php"); } else { echo <<<EOM <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>login</title> <style type="text/css"> <!-- ..style5 {font-size: 24px} ..style6 { font-family: "Times New Roman", Times, serif; color: #FF0000; } ..style7 { font-size: 14px; color: #FF0000; } --> </style> </head> <body> <table width="200" border="0" align="center"> <tr> <td height="68" colspan="2"> <form name="form1" method="post" action="login.php"> <table width="474" height="89" border="0" background="image/log.gif"> <tr> <td width="77" height="29"> </td> <input type=hidden name=queryflag value=0> <td width="114" valign="bottom"><input name="username" type="text" id="username" size="15"></td> <td width="42"> </td> <td width="125" valign="bottom"><input name="password" type="password" id="password" size="15"></td> <td width="82" valign="bottom"><input name="imageField" type="image" src="image/bt-login.gif" width="46" height="19" border="0" onclick="this.form.queryflag.value=1"></td> </tr> <tr> <td colspan="5"></td> </tr> <tr> <td height="26" colspan="5"><span class="style7">username or password error!</span></td> </tr> </table> </form> </td> </tr> </table> </body> </html> EOM; } } else if (!isset($queryflag)){ echo <<<EOM <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>login</title> <style type="text/css"> <!-- ..style5 {font-size: 24px} ..style6 { font-family: "Times New Roman", Times, serif; color: #FF0000; } ..style7 { font-size: 16px; color: #FF0000; } --> </style> </head> <body> <table width="200" border="0" align="center"> <tr> <td height="68" colspan="2"> <form name="form1" method="post" action="login.php"> <table width="474" height="89" border="0" background="image/log.gif"> <tr> <td width="77" height="29"> </td> <td width="114" valign="bottom"><input name="username" type="text" id="username" size="15"></td> <td width="42"> </td> <input type=hidden name=queryflag value=0> <td width="125" valign="bottom"><input name="password" type="password" id="password" size="15"></td> <td width="82" valign="bottom"><input name="imageField" type="image" src="image/bt-login.gif" width="46" height="19" border="0" onclick="this.form.queryflag.value=1"></td> </tr> <tr> <td colspan="5"></td> </tr> <tr> <td height="26" colspan="5"> </td> </tr> </table> </form> </td> </tr> </table> </body> </html> EOM; } ?> |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |