Re: Trouble with PHP server script
| From: | Nirmalya Lahiri | Date: | Mon, 11 Feb 2008 03:20:19 +0000 |
| Subject: | Re: Trouble with PHP server script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269065@lists.php.net to get a copy of this message | ||
--- Robert Cox <Robert.Cox@utas.edu.au> wrote:
> Is it possible to use the "$_SERVER['PHP_AUTH_USER'];" construct in
> a URL
> forwarded site? I am trying to find the authorised user id so that
> I can
> access an SQL database with it. Anyone got some ideas?
>
> PHP looks like this....
>
> <?php
> //Get User
> $user = $_SERVER['PHP_AUTH_USER'];
>
> // Get User type
> $db = mysql_connect(localhost, ....., .....) or die("Can't
> connect to
> database: ".mysql_error());
> mysql_select_db(................) or die("Can't select
> database:
> ".mysql_error());
>
> $query = "SELECT * FROM user WHERE staffid LIKE $user";
> $result = mysql_query($query) or die ('Not a valid User: ' .
> mysql_error());
> ....
> ?>
>
Robert,
I think this link will help you to solve the problem.....
http://bugs.php.net/bug.php?id=29132
---
Nirmalya Lahiri
[+91-9433113536]
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ