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

 

 

Link to comment
Share on other sites

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";
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.