[PHP] $_POST index issues

2003-02-10 Thread James G Puckett


I have run into a problem with some of my code surrounding $_POST.


Below are excepts:

Sending PHP script (login.php)


Username

Password




Receiving script (verify_login.php)


foreach ($_POST as $key => $value ) {
echo "\n";
}

$db_connection = odbc_connect( $GLOBALS["db_dsn"],
$GLOBALS["db_username"], $GLOBALS["db_password"] );
echo "\n";
$query = "select username, active, password, clec_id from users
where USERNAME=\"$_POST['username_given']\"";


I get the following errors:

PHP Notice:  Undefined index:  'username_given' in
/var/www/e911.e-c-group.com/verify_login.php on line 19
PHP Notice:  Undefined index:  'username_given' in
/var/www/e911.e-c-group.com/verify_login.php on line 21

However, the for loop above produces the following output.





Any ideas what I am doing wrong?

James G Puckett
ECG, Inc.
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] $_POST index issues

2003-02-10 Thread James G Puckett
This indeed was the problem.  Case closed.

Thanks for the help.

James G Puckett
ECG, Inc.
 

> -Original Message-
> From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 10, 2003 10:55 AM
> To: James G Puckett
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] $_POST index issues
> 
> At 16:47 10.02.2003, James G Puckett spoke out and said:
> [snip]
> >   echo "\n";
> >   $query = "select username, active, password, clec_id from
users
> >where USERNAME=\"$_POST['username_given']\"";
> [snip]
> 
> I'm not sure if this is the source of your problems, but when
referencing
> an array from within a string you should put it in curly quotes:
> 
> echo "\n";
> $query = "select username, active, password, clec_id from
users
> where USERNAME=\"{$_POST['username_given']}\"";
> 
> 
> --
>>O Ernest E. Vogelsinger
>(\) ICQ #13394035
> ^ http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php