Forums

PHP

This topic is locked

user login

Posted 08 Nov 2006 13:33:57
1
has voted
08 Nov 2006 13:33:57 alex webb posted:
Hello there

I have a php login script that works perfect the only thing i need it to do now is recognise if a user is a customer or a supplier

so in the sign up procces the user will select wether they are a customer or a supplier

and when they go to login they will be redirected to either a customer area or a supplier area

i have managed to get this value into the database (mysql) but when they login it redirects them to index.php (no matter wethere there a cutomer or supplier)

so my question is how can i make it so customers get redirected to customers.php

and suppliers get redirected to suppliers.php

Any help will be much appreciated


Thanks
Alex

Replies

Replied 09 Nov 2006 03:09:34
09 Nov 2006 03:09:34 LorD ExoskeletoN replied:
hi there you must have an if statement for that...or select case

if ($user == 'customer') {

header('Location: customer.php');

} else {

header('Location: supplier.php');

}

Hope this helps...good luck!!!
Replied 11 Nov 2006 09:09:39
11 Nov 2006 09:09:39 Jacks J replied:
Hi

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>1)First of all take a select box add the list as customer and supplier. While logging into customer page select the customer from list or if you want to login to supplier page just select the supplier from the list
2) Just check the if condition whther it is customer or supplier if customer redirect it to customer.php page or supplier.php
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Moreover for this I have gone through the excellent php templates in the below site. Just have a look on this
classicwebsites.org/php/index.htm

Thanks <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic