Go4Expert Founder
26Sep2011,13:13   #131
shabbir's Avatar
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?
Light Poster
30Sep2011,10:30   #132
shellz's Avatar
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
Light Poster
19Oct2011,12:19   #133
bobwarner01's Avatar
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
Newbie Member
9Nov2011,14:04   #134
iMustBeAlien's Avatar
so cool explained... happy to read it ,thanx for this bro