- 05-12-2009 07:59 PM #1
How to Pass user authentication information from htaccess/htpasswd to PHPPassing user authentication information to PHP
The best way to protect your directory is with htaccess/htpasswd protection. But you may also want to pass the user information to your php scripts so you can do custom processing based on who logged in. You can retrieve the current authenticated user with one php line. Put this in the target script in the protected directory (used in the script after authentication).
You can download this script as a .txt file. Remember to rename the file as a .php file.
كود PHP:
- - Start Script Here - -
<?php
$user = $_SERVER['REMOTE_USER'];
?>
- - End Script Here - -التعديل الأخير تم بواسطة bahattab ; 05-12-2009 الساعة 08:06 PM
--------------------------------------
نشكركم لمشاركتكم في المنتدى
تحياتي
Adds Circuit advertisement- تاريخ التسجيل
- Always
- المشاركات
- Many






رد مع اقتباس

مواقع النشر (المفضلة)