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
Post a Comment