1 Replies - 728 Views - Last Post: 04 November 2012 - 09:09 AM Rate Topic: -----

#1 LightRanger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-November 11

registration form and login problem

Posted 04 November 2012 - 07:20 AM

someone please check this login validation php code and can say if it is correct or not

i am using sha encryption to store passwprd to table element name pass when i check the database it storing the pass encrypted with sha but when i try to validate the login with this code its not getting login giving password doesn't match whats wrong ???


and one more help needed can some body give me complete code for a registration form and login system similar to gmail, captcha is not necessary
<?php
	mysql_connect("localhost" , "root" , "");
	mysql_select_db("test");
	
	session_start();
	if(isset($_POST['email'])) {
		$email = $_POST['email'];
		$password = $_POST['password'];
		$pass1 = sha1($password);			
		$check = mysql_query("SELECT * FROM login1 WHERE email='$email' and pass='$pass1'");		
		if($row = mysql_fetch_array( $check )) {
			setcookie('email',$email,time()+3600);
			setcookie('name',$row['name'],time()+3600);
			echo "Logging in";
			header('Location:index.php');
		} else {
			setcookie('login_error', true, time()+60);
			header('Location:login.php');
					}
	}
?>

This post has been edited by Atli: 04 November 2012 - 08:47 AM


Is This A Good Question/Topic? 0
  • +

Replies To: registration form and login problem

#2 Jstall  Icon User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: registration form and login problem

Posted 04 November 2012 - 09:09 AM

Could we see the code you use to create accounts?

Quote

and one more help needed can some body give me complete code for a registration form and login system similar to gmail, captcha is not necessary


No.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1