[Phpwm] .htaccess auth question

pete graham petegraham1 at gmail.com
Mon Aug 6 18:12:00 BST 2007


> Can you run PHP (or another form of call) from within an .htaccess file
> that's capable of retrieving that data from a file / database?

I don't think it's possible to put php code inside a .htaccess file,
although there may be some amazing technique for doing it that I've
never heard of.

I now have my application working so that it logs the users into the
dev sites without a password prompt. One thing I noticed is that
passing the username and password causes a slightly irritating prompt
in firefox. So I added a check like this before the redirect:

	function testUrl($uri)
	{	
		$client = new Zend_Http_Client();
		$client->setUri($uri);
		$response = $client->request();
		$status = $response->getStatus();
		
		return ($status == '200');
	}

I only pass the username and password when the http status is not 200,
if it's 200 the site doesn't require authentication for this user
currently.

Pete



More information about the Phpwm mailing list