473,545 Members | 529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("user name",array_key s($bh)) )
{
reset($bh);
while( list($key,$val) = each($bh) )
echo ">$key< .... >$val<<br>";
die("Submittini g variables invalid...1");
}
if( !in_array("pass word",array_key s($bh)) )
{
reset($bh);
while( list($key,$val) = each($bh) )
echo ">$key< .... >$val<<br>";
die("Submittini g 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 2579

"S.Shaigany " <sh******@hotma il.com> wrote in message
news:46******** *************** ***@posting.goo gle.com...
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("user name",array_key s($bh)) )
{
reset($bh);
while( list($key,$val) = each($bh) )
echo ">$key< .... >$val<<br>";
die("Submittini g variables invalid...1");
}
if( !in_array("pass word",array_key s($bh)) )
{
reset($bh);
while( list($key,$val) = each($bh) )
echo ">$key< .... >$val<<br>";
die("Submittini g 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
3247
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"); ?> If I enter the url to the include file in my address bar, I can get
2
1675
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
2282
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
4311
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 result in any way. Who can help me, I thank you very very much. list.cpp(main program)...
1
2134
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) = each($HTTP_POST_VARS)) { if (!is_array($HTTP_POST_VARS)) { echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
6
9569
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 i have also other functions defined in that file, i can use the global in all functions, but once i split up the rest of the function in other...
3
2391
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 and are used thusly. <?php include ($_SERVER); ?//this is line 3 <?php include ($_SERVER); ?// line 5
5
3851
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 help me ?
5
6566
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
7805
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7416
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7752
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5325
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.