View Single Post
Old 08-11-2009, 04:41 AM  
XD2
Confirmed User
 
XD2's Avatar
 
Industry Role:
Join Date: Sep 2007
Location: Cheshire, UK
Posts: 454
I haven't checked if this works as the paysites I built don't require it, but this code should check for valid username and password and reject anyone without it:

Code:
<?php
if(!$_SERVER[PHP_AUTH_USER] || !$_SERVER[PHP_AUTH_PW]) {
	//url to redirect to
	$url = "http://www.yourdomain.com";
	header("Location: $url");
}
?>
Just place it in your members area above everything else and it will redirect if no username or password is found. This only works for sites using htaccess as an auth method.

If anyone can verify this does help let other people know
__________________
David • 421-179-116 • support [@] adultnetworkuk [.] com

Website DevelopmentWebsite HostingModel Index SoftwareWebsite Reviews and Links
Hit me up for more information on everything I do.
XD2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote