NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Help with a small php login form

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-02-2005, 02:34 PM THREAD STARTER               #1 (permalink)
TWM
Web Marketing Specialist
Join Date: Oct 2003
Location: Texas, USA
Posts: 1,335
TWM is a jewel in the roughTWM is a jewel in the roughTWM is a jewel in the rough
 



Help with a small php login form


I have

Code:
<?
$adminuser = "admin";
$clientuser = "client";
$adminpass = "admin";
$clientpass = "client";
if ($user == $adminpass&&$pw == $adminpass || $user == $clientuser&&$pw == $clientpass)
{
   header("Location: http://my-website.com/partner_area/partner_area.php");
}
  else
{
   print("Wrong username or password. Please try again.");
}
?>
How can i alter this so that if admin logs in, it takes him to admin area, and if client logs in, it takes them to client area.
TWM is offline  
Old 08-02-2005, 02:56 PM   #2 (permalink)
Account Closed
 
vip-ip's Avatar
Join Date: Jan 2005
Location: root@localhost
Posts: 4,025
vip-ip is an unknown quantity at this point
 



Code:
<?
$adminuser = "admin";
$clientuser = "client";
$adminpass = "admin";
$clientpass = "client";
if ($user == $adminpass&&$pw == $adminpass)
{
   header("Location: http://my-website.com/partner_area/admin_area.php");
}
  else
{
   print("Wrong username or password. Please try again.");
}
if ($user == $clientuser&&$pw == $clientpass)
{ 
   header("Location: http://my-website.com/partner_area/client_area.php");
}
  else
{
   print("Wrong username or password. Please try again.");
}
?>
vip-ip is offline  
Old 08-02-2005, 02:58 PM   #3 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



Try this:

Code:
<?
$adminuser = "admin";
$clientuser = "client";
$adminpass = "admin";
$clientpass = "client";
if ($user == $adminpass&&$pw == $adminpass || $user == $clientuser&&$pw == $clientpass)
{
   if( $user == $adminuser ) {
    header( "Location: adminareaurl");  
    }
    else {
   header("Location: http://my-website.com/partner_area/partner_area.php");
   }
}
  else
{
   print("Wrong username or password. Please try again.");
}
?>
__________________
My Website | My Blog
monaco is offline  
Old 08-02-2005, 04:04 PM THREAD STARTER               #4 (permalink)
TWM
Web Marketing Specialist
Join Date: Oct 2003
Location: Texas, USA
Posts: 1,335
TWM is a jewel in the roughTWM is a jewel in the roughTWM is a jewel in the rough
 



nvm fixed it
Last edited by idevisedesign; 08-02-2005 at 04:11 PM.
TWM is offline  
Old 08-02-2005, 04:12 PM   #5 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



I just checked his code, and it works fine. Perhaps you had a copy error?
__________________
My Website | My Blog
monaco is offline  
Old 08-03-2005, 10:37 AM THREAD STARTER               #6 (permalink)
TWM
Web Marketing Specialist
Join Date: Oct 2003
Location: Texas, USA
Posts: 1,335
TWM is a jewel in the roughTWM is a jewel in the roughTWM is a jewel in the rough
 



Not sure, but i altered it and it works. I have 6 different usernames/passwords, they all are working great!
TWM is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 10:09 AM
Paypal Settlement CMachuca The Break Room 3 07-31-2004 11:14 PM
PAYPAL Litigation johnn Domain Name Discussion 6 07-31-2004 10:51 PM
Paypal Settlement Lord The Break Room 2 07-30-2004 10:30 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:00 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger