Re: Trouble with PHP server script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Cox 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,

print_r($_SERVER); will answer all your questions :)

Nathan

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux