www authenticate - Is this deprecated? (PHP send www-auth) -


i'm wondering if still supported. sorry i'm still learning php bear me.

<?php // force https if($_server["https"] != "on") {     header("location: https://" . $_server["http_host"] . $_server["request_uri"]);     exit(); }  // set credentials $user="user"; $pass="pass";  // send header header("location: https://$user:$pass@localhost/protected");   ?> 

there nothing in code deprecated.

including credentials in url doesn't have php. caution though use urlencode() if has reserved character in username or password, isn't misinterpreted.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -