473,395 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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;
}
?>

Apr 6 '06 #1
3 1691
El 6 Apr 2006 03:21:54 -0700
ti***********@gmail.com escribió:
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


well, you probably had register_globals On before, and php-5.1.2
changed it to off.

http://es.php.net/register_globals

just substitute $queryflag for $_POST['queryflag'] and everything
should work again


--
Juan José Gutiérrez de Quevedo
Director Técnico (ju****@iteisa.com)
ITEISA (http://www.iteisa.com)
942544036 - 637447953
Apr 6 '06 #2
Juan José Gutiérrez de Quevedo Pérez wrote:
El 6 Apr 2006 03:21:54 -0700
ti***********@gmail.com escribió:
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


well, you probably had register_globals On before, and php-5.1.2
changed it to off.

http://es.php.net/register_globals

just substitute $queryflag for $_POST['queryflag'] and everything
should work again


Hi Juan,

That was my first guess too, but futheron in the same script he is using the
$_POST to retrieve variables from the posting.

Maybe the coder changed his/her mind halfway the script. :-)

Regards,
Erwin Moller
Apr 6 '06 #3
Juan José Gutiérrez de Quevedo Pérez wrote:
well, you probably had register_globals On before, and php-5.1.2
changed it to off.


I concur.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Apr 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Chris Allen | last post by:
Hi I'm new to PHP and I'm trying to create a Login Form. Once the user has logged in then he shouldn't have to log in again. The trouble is I'm getting a new session ID between every page and so...
11
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option...
1
by: Orest Kinasevych | last post by:
Okay, I made sense of the earlier suggestions and realized I was on the right track -- I appreciate the feedback which got me to this point. The suggestions posted here indeed worked and...
5
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for...
9
by: Eric George | last post by:
Hi, Has anyone had any success using jscript submit method in their VS.NET projects? For example I have some client processing in a script function then call <form name>.submit(); This won't...
2
by: Pete | last post by:
Hi all... I sincerly hope one of the MS guys can clear this up for me... First some background... Ok, I have a web site which is fully translatable into several languages. All the strings...
0
by: Jason | last post by:
I have created a wizard like set of pages that carries over data submitted from one page to the next. I have created a user control (Searchsurveys) that consist of 4 listboxes which is used on...
0
by: Aws | last post by:
My crazy GridView !! I am using Visual Studio 2005, I have a problem with my GridView. I have one access .mdb table and when I update a record on the table EVERYTHING is perfect. I made a Web...
4
by: damn | last post by:
Hi, in short what I'm trying to do: pass a variable from a form that's posted to a certain page, to the same page. The variable is extracted with $_REQUEST. Next, another form in the same page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.