RE: [PHP-DB] Authenticate problem
| From: | Harpreet | Date: | Mon, 26 Nov 2001 15:19:27 +0000 |
| Subject: | RE: [PHP-DB] Authenticate problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14579@lists.php.net to get a copy of this message | ||
I tried doing the following it still deosnt work
<?php include('global1.inc');
$USER=($HTTP_POST_VARS["USER"]);
$PASSWORD=($HTTP_POST_VARS["PASSWORD"]);
$strconnectionuser=mysql_connect("123.345.567.789","$USER");
if ($strconnectionuser=="Resource id #1")
{
header("Location: http://123.345.567.789/frame_main.htm");
}
else
{
header("Location: http://123.345.567.789/notlogged.htm");
}
?>
How do i check for a valid connection??
He;p is appreciated,
regards,
Harpreet Kaur
Software Developer
Crispin Corporations Inc.
-----Original Message-----
From: Indioblanco [mailto:indioblanco@centralcoasthealing.net]
Sent: Wednesday, November 21, 2001 9:59 PM
To: harpreet@crispincorp.com
Subject: Re: [PHP-DB] Authenticate problem
Two things right off the top:
1. You won't execute the header functions if you exit (die) the script.
2. Your header functions won't work if you allow warnings to print..
Try testing for a valid connection, then passing the error string into
the redirection url of a header call if it returns false and then exit.
-ib