changing a login script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

changing a login script

Post by m2babaey »

SOLVED :wink:
Please have a look on the next post
Last edited by m2babaey on Wed Jun 27, 2007 5:35 am, edited 1 time in total.
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post by m2babaey »

Hi
Please look at the function below that I include and use it in my protected pages ( that requires login):

Code: Select all

function membersOnly() {
		if (!$_SESSION['logged']) {
			$_SESSION['log_to'] = $_SERVER['REQUEST_URI'];
			die('This page is available only to registered members,
				you have to <a href="login.php">login</a> first, if ' .
				"you haven't" . ' <a href="signup.php">registered</a> ' .
				 'yet you can do that for free.');
		}
	}
This makes the protected pages almost blank to users when they have not logged in. like this:
http://pedia.sys17.net/protected.htm
But it's too bad. and I want it like this:
http://pedia.sys17.net/wantprolikethis.htm
How can I do that?
Thanks
Post Reply