Search
Left Quote    It is possible to store the mind with a million facts and still be entirely uneducated.
- Alec Bourne    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: successful login page
  This user is offline  duece
  Subject: "successful login page" Posted: @ 3:36 am on Aug 01 2007   
Member #: 341
Rank: User - (14)
Since: 06/12/07
Posts: 14

I have successfully created and customized the membership script from this site. For this project, I am going to have three levels of members.
1. Admin
2. Account Reviewer
3. Users

I want each of them when logged in, to go to a different successful login page. I am still trying to wrap my head around this dynamic database driven web design.

thanks for any info in advance.
D

    Viewed: 5,868 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: successful login page" Posted: @ 4:02 am on Aug 01 2007    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

How are you identifying the levels, with numerical values (1 for admin, 2 for reviewer, 3 for user) or something along those lines. Or, are you using text stored in a column in your members table that actually says, "Admin&q uot;, "Account Reviewer" and "User&qu ot;.

What you need to do is grab the account type info from the members table when you select the username and password. Then, based on that, use an IF statement to re-direct accordingly.

So if your column is "account_ type" and you're specifying the account type by text, it might look something like this:

Code:

if($query->a ccount_type == "Admin&q uot;) {
header("L ocation: http://www.YOUR _SITE.com/admin .php"); } elseif($query-& gt;account_type == "Reviewer ") {
header("L ocation: http://www.YOUR _SITE.com/revie wer.php") ;
} else {
header("L ocation: http://www.YOUR _SITE.com/index .php"); } //end




-bs0d | AllSyntax.com

    Viewed: 5,862 Times | Reply to This | To top
  This user is offline  duece
  Subject: "re: successful login page" Posted: @ 3:45 am on Aug 03 2007    
Member #: 341
Rank: User - (14)
Since: 06/12/07
Posts: 14

Well that makes perfect sense, which seems to happen. I have an EE coding background and so often I just don't get how it crosses over to web programming. But I am steadily learning, I have two good (supposedly) books coming on PHP, MySQL and Dynamic Web Coding.

Thanks for the nudge in the right direction.
But just to be clear, where exactly would this code go...
after the code that check the Db for the correct login and password info, then if it is correct, perform the query and based on that send them here... which was what my data flow says...

D



Edited at 03:47:07 am on 08/03/07


    Viewed: 5,836 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: successful login page" Posted: @ 3:54 am on Aug 03 2007    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

yes, it would be after all of your processing that you decide to do in the login page, because once the header(); code is executed, then it will re-direct the page.




-bs0d | AllSyntax.com

    Viewed: 5,828 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank