0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by shellz View Post
Hi Mr Shabbir..
I'm really new in php.. i've tried this code, but it doesn't work.. Can you please help me?
Thanks..
Can you say what did not work?
0
shellz's Avatar, Join Date: Sep 2011
Light Poster
I am trying to make a login form and i've tried the coding that u gave... But it doesn't work.. Everytime I try to run the program "Parse error: syntax error, unexpected $end in C:\xampp\htdocs\login.php on line 89" always comes out.. i change the document of index into index1 as i also have another document in htdocs folder, but i also change the script in login.php
Code:
if ($username=="" or $password=="" )
	{
		echo "<h1>Username or password is blank</h1>";
		clearsessionscookies();
		header("location: login.php?returnurl=$returnurl");
	}
	else
	{
		if(confirmuser($username,md5($password))) // As pointed out by asgard2005
		{
			createsessions($username,$password);
			if ($returnurl<>"")
				header("location: $returnurl");
			else
			{
				header("Location: index1.php"); (this one from index.php into index1.php)
			}
		}
		else
		{
			echo "<h1>Invalid Username and/Or password</h1>";
			clearsessionscookies();
			header("location: login.php?returnurl=$returnurl");
		}
	}
	break;
case "logout":
	clearsessionscookies();
	header("location: index1.php"); (from index.php into index1.php)
	break;
Does it gives any effect? thanks for your explanation..

Last edited by shabbir; 30Sep2011 at 13:34.. Reason: Code blocks
0
bobwarner01's Avatar, Join Date: Oct 2011
Light Poster
Sessions and Cookies are really nice interesting topic to cover. Thanks for sharing mate. Actually i was searching the coding that you given, But now its all clear. I found 2-3 but was not applicable
0
iMustBeAlien's Avatar, Join Date: Nov 2011
Newbie Member
so cool explained... happy to read it ,thanx for this bro
0
javeed_nizar's Avatar, Join Date: Jun 2014
Newbie Member
how to prevent user multiple login with single account
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by javeed_nizar View Post
how to prevent user multiple login with single account
Create sessions based on user's current details like IP and then check if already logged in or session is live.