473,396 Members | 1,996 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,396 software developers and data experts.

HTTP_POST_VARS include wrong variables

Hi everybody,

Please help me. I have a problem with my login page, which worked fine
during the last one month. I have'nt made any changes in it. but from
yesterday on, it seems that my PHP code receives wrong POST variables.
This is my HTML code piece which just produces login form:

<form name="login" action="default.php" method="post">

UserName:<input type="text" name="username" size="15" maxlength="20"
/>
Password:<input type="password" name="password" size="15"
maxlength="20" />
.....
</form>

and this is a piece of PHP code, in default.php, in which I have made
some changes to be able to track the problem:

$bh=$HTTP_POST_VARS;
if( count($bh) )
{
if( !in_array("username",array_keys($bh)) )
{
reset($bh);
while( list($key,$val) = each($bh) )
echo ">$key< .... >$val<<br>";
die("Submittinig variables invalid...1");
}
if( !in_array("password",array_keys($bh)) )
{
reset($bh);
while( list($key,$val) = each($bh) )
echo ">$key< .... >$val<<br>";
die("Submittinig variables invalid...2");
}
....
....
....
}

and this is the result:
username+AAA-'cc.. some junk characters< .... >test<
password+AAA-y.. some junc characters< .... >test<

.....
Submitting variables invalid...1
any idea? please help...

Thanks,
-Shaigany
Jul 17 '05 #1
1 2566

"S.Shaigany" <sh******@hotmail.com> wrote in message
news:46**************************@posting.google.c om...
Hi everybody,

Please help me. I have a problem with my login page, which worked fine
during the last one month. I have'nt made any changes in it. but from
yesterday on, it seems that my PHP code receives wrong POST variables.
This is my HTML code piece which just produces login form:

<form name="login" action="default.php" method="post">

UserName:<input type="text" name="username" size="15" maxlength="20"
/>
Password:<input type="password" name="password" size="15"
maxlength="20" />
....
</form>

and this is a piece of PHP code, in default.php, in which I have made
some changes to be able to track the problem:

$bh=$HTTP_POST_VARS;
if( count($bh) )
{
if( !in_array("username",array_keys($bh)) )
{
reset($bh);
while( list($key,$val) = each($bh) )
echo ">$key< .... >$val<<br>";
die("Submittinig variables invalid...1");
}
if( !in_array("password",array_keys($bh)) )
{
reset($bh);
while( list($key,$val) = each($bh) )
echo ">$key< .... >$val<<br>";
die("Submittinig variables invalid...2");
}
....
....
....
}

and this is the result:
username+AAA-'cc.. some junk characters< .... >test<
password+AAA-y.. some junc characters< .... >test<

....
Submitting variables invalid...1
any idea? please help...

Thanks,
-Shaigany


Point your form to phpinfo(); and recheck the variables names, and values...
that might help you somewhat....

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
Jul 17 '05 #2

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

Similar topics

1
by: james | last post by:
I can't seem to access sessions variables from include files. If I use the include file like this it I cant get the session variables: <?php session_start(); require("url/to/inc/file.php");...
2
by: WindAndWaves | last post by:
SHould I write $HTTP_POST_VARS or $HTTP_POST_VARS or $HTTP_POST_VARS It seems that both of them (with or without quotes) work... Sorry I am sure this is a very stupid question... - Nicolaas
9
by: Andy Jacobs | last post by:
Hi All I've tried as many combinations as I can think of but I'm not getting any where. This is what I have: <? $menu = 'menus/' . $HTTP_GET_VARS . '.inc'; echo $menu; ?>
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
1
by: frey | last post by:
the code is used for repost $HTTP_POST_VARS from a form to the insert page at the "preview" page <?php /* Re-Post all POST'ed variables */ reset($HTTP_POST_VARS); while (list($key, $value) =...
6
by: atv | last post by:
Alright, i have some questions concerning include files en global variables.I hope someone is willing to answer these. 1).Why is it that if i define a global variable in a file, say main.c, and...
3
by: Dave Kelly | last post by:
From a html page menu I need to pass 2 variables. <a href="signup.php?var1=list-PINSS.php&var2=blurb-PINSS.php"><h3>Padre Island National Sea Shore</h3></a><br> These go to a php web page...
5
sanjay123456
by: sanjay123456 | last post by:
Hello friend , In the following code when user click submit i want to to radio buttton option means user click 1 ,2 ,3 or 4 means its print tha option but it snot print can any body...
5
by: vinnie | last post by:
Does anyone may help in understanding how these functions work, with an easy example? a) $HTTP_POST_VARS; b) stripslashes(); c) addslashes(); thanks a lot
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.