Access 401 authentication with Curl

When we implement Curl for an URL where 401 authentication is made (The pop-up for username and password when we access that url through browser), we can pass the username and password parameter along with the calling URL. For example: for your url, www.abc.com to by pass authentication in one go, we can use, http://username:password@www.abc.c [...]

0 Comments , , , ,

HTTP authentication from PHP

Do you know you can implement http authentication using php code? HTTP authentications are those you see when  you open control panel or administrative backend website, prompting for username and password in html  authentication prompt. This can be done in php using following code: <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header(‘WWW-Authenticate: Basic realm=”My Realm”‘); header(‘HTTP/1.0 401 Unauthorized’); [...]

1 Comments , , , , , , , , , , ,