Jump to content

[SOLVED] Loging Problems!! (Cant set it up)


mikebyrne

Recommended Posts

the sql for the table is:

 

CREATE TABLE `users` (

  `id` int(4) NOT NULL auto_increment,

  `name` varchar(65) NOT NULL default '',

  `address` varchar(65) NOT NULL default '',

  `address1` varchar(65) NOT NULL default '',

  `address2` varchar(65) NOT NULL default '',

  `address3` varchar(65) NOT NULL default '',

  `address4` varchar(65) NOT NULL default '',

  `county` varchar(25) NOT NULL default '',

  `zip` varchar(65) NOT NULL default '',

  `telephone` varchar(25) NOT NULL default '',

  `email` varchar(25) NOT NULL default '',

  `username` varchar(65) NOT NULL default '',

  `password` varchar(15) NOT NULL default '',

  `User` int(1) default '0',

  PRIMARY KEY  (`id`)

) ENGINE=MyISAM AUTO_INCREMENT=36 DEFAULT CHARSET=latin1;

 

The users field will always be 0 and any additional entry from the confirmation email wiil have a 1 in the users column

 

So 1= Users 0=Admin

 

Therefor when a user logs in they will have 1 in the user column and when an admin logs in they will have a 0 in the users column

 

 

Cap the U on User

<?php
	$row = mysql_fetch_assoc($result);
	// Register $myusername, $mypassword and redirect to file "login_success.php"
	$_SESSION['myusername'] = $row['username'];
	$_SESSION['mypassword'] = $row['password'];
	$_SESSION['type'] = ($row['User']==1)?"Emp":"Cust";
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.