HTTP_POST_VARS include wrong variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • S.Shaigany

    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:
    [color=blue]
    >username+AAA-'cc.. some junk characters< .... >test<
    >password+AAA-y.. some junc characters< .... >test<[/color]
    .....
    Submitting variables invalid...1


    any idea? please help...

    Thanks,
    -Shaigany
  • Randell D.

    #2
    Re: HTTP_POST_VARS include wrong variables


    "S.Shaigany " <shaigany@hotma il.com> wrote in message
    news:466a07b9.0 309250642.4f760 0b4@posting.goo gle.com...[color=blue]
    > 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:
    >[color=green]
    > >username+AAA-'cc.. some junk characters< .... >test<
    > >password+AAA-y.. some junc characters< .... >test<[/color]
    > ....
    > Submitting variables invalid...1
    >
    >
    > any idea? please help...
    >
    > Thanks,
    > -Shaigany[/color]

    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?


    Comment

    Working...