Garayed.com  

Go Back   Garayed.com > PHP
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-2006, 11:21 AM
tigerwang1974@gmail.com
 
Posts: n/a
Default I'm crazy, why php doesn't transfer variable submitted by web form?

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">&nbsp;</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">&nbsp;</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">&nbsp;</td>
<td width="114" valign="bottom"><input name="username"
type="text" id="username" size="15"></td>
<td width="42">&nbsp;</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">&nbsp;</td>
</tr>
</table>
</form> </td>
</tr>
</table>
</body>
</html>
EOM;
}
?>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:43 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.