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=$_P OST["username"];
$ybuserpwd=$_PO ST["password"];
if ($ybusername==$ ybn AND $ybuserpwd==$yb p){
session_start() ;
$_SESSION["admin"]=true;
header("locatio n: 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.p hp">
<table width="474" height="89" border="0"
background="ima ge/log.gif">
<tr>
<td width="77" height="29">&nb sp;</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">&nbs p;</td>
<td width="125" valign="bottom" ><input name="password"
type="password" id="password" size="15"></td>
<td width="82" valign="bottom" ><input name="imageFiel d"
type="image" src="image/bt-login.gif" width="46" height="19" border="0"
onclick="this.f orm.queryflag.v alue=1"></td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
<tr>
<td height="26" colspan="5"><sp an class="style7"> username or
password error!</span></td>
</tr>
</table>
</form> </td>
</tr>
</table>
</body>
</html>
EOM;
}
} else if (!isset($queryf lag)){
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.p hp">
<table width="474" height="89" border="0"
background="ima ge/log.gif">
<tr>
<td width="77" height="29">&nb sp;</td>
<td width="114" valign="bottom" ><input name="username"
type="text" id="username" size="15"></td>
<td width="42">&nbs p;</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="imageFiel d"
type="image" src="image/bt-login.gif" width="46" height="19" border="0"
onclick="this.f orm.queryflag.v alue=1"></td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
<tr>
<td height="26" colspan="5">&nb sp;</td>
</tr>
</table>
</form> </td>
</tr>
</table>
</body>
</html>
EOM;
}
?>
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=$_P OST["username"];
$ybuserpwd=$_PO ST["password"];
if ($ybusername==$ ybn AND $ybuserpwd==$yb p){
session_start() ;
$_SESSION["admin"]=true;
header("locatio n: 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.p hp">
<table width="474" height="89" border="0"
background="ima ge/log.gif">
<tr>
<td width="77" height="29">&nb sp;</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">&nbs p;</td>
<td width="125" valign="bottom" ><input name="password"
type="password" id="password" size="15"></td>
<td width="82" valign="bottom" ><input name="imageFiel d"
type="image" src="image/bt-login.gif" width="46" height="19" border="0"
onclick="this.f orm.queryflag.v alue=1"></td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
<tr>
<td height="26" colspan="5"><sp an class="style7"> username or
password error!</span></td>
</tr>
</table>
</form> </td>
</tr>
</table>
</body>
</html>
EOM;
}
} else if (!isset($queryf lag)){
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.p hp">
<table width="474" height="89" border="0"
background="ima ge/log.gif">
<tr>
<td width="77" height="29">&nb sp;</td>
<td width="114" valign="bottom" ><input name="username"
type="text" id="username" size="15"></td>
<td width="42">&nbs p;</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="imageFiel d"
type="image" src="image/bt-login.gif" width="46" height="19" border="0"
onclick="this.f orm.queryflag.v alue=1"></td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
<tr>
<td height="26" colspan="5">&nb sp;</td>
</tr>
</table>
</form> </td>
</tr>
</table>
</body>
</html>
EOM;
}
?>
Comment