Just wondering.. Cpanel has Password protect directories. I assigned a username and a password to protect a file. Is it possible to get the username and print on the protected page ? Like "Hello Hasbehas.." . Presuming username is "hasbehas" Is it possible to get this data, or Would I need a new script to do this ?
I'm not sure how cpanel implement their logins, but if you were to create a php page, behind the secure login, with something like <pre><? print_r($_SERVER); ?></pre> PHP: You will be able to find out the variables the server has stored.. You might need $_SERVER["PHP_AUTH_USER"], and can show it on a page using <?=$_SERVER["PHP_AUTH_USER"];?> PHP:
print_r($_SERVER); // is your best friend for this you can see all the data the server has on the current HTTP request.