0

Alright here we go... I just purchased a Javascript/css based login form that works very similar to twitters login form. Here lies the problem. The way my website works is this...Theres a login link you click on that takes you to the login page. Because my site is set up for buyers and sellers I have two login forms on the same page. I was wondering how I could allow both kinds members to login from the new login form I just purchased. How could I code a buyer check box, and provider check box into the same login form? Is it possible? I'd like the option for both members to sign in from the same form with the option to click either the buyer or seller box - Which ever they signed up for.

4
Contributors
5
Replies
7
Views
7 Years
Discussion Span
Last Post by P0lT10n
0

I suppose you could simply include a couple of radio buttons:

<input type="radio" name="member" value="buyer" checked="checked"/>Buyer
<input type="radio" name="member" value="seller"/>Seller

(OR a select list with the two options).

Edited by hielo: typo

0

After adding the HTML code as stated by heilo, you may need to go into the code you purchased and modify the code to check which radio had been selected. ex:

//if your code is in php

if(isset($_POST['member'])=='buyer'){
     //verify login and login as buyer
}
else if(isset($_POST['member'])=='seller'){
    //verify login and login as seller
}else{
    //show error
}
0

After adding the HTML code as stated by heilo, you may need to go into the code you purchased and modify the code to check which radio had been selected. ex:

//if your code is in php

if(isset($_POST['member'])=='buyer'){
     //verify login and login as buyer
}
else if(isset($_POST['member'])=='seller'){
    //verify login and login as seller
}else{
    //show error
}

You are right but don use if, else if, else... use switch, is more efficient, faster and easier to think...

With switch would be:

switch($_POST['member']){
     case 'buyer':
          // verify login and login as buyer
     break;
     case 'seller':
          // verify login and login as seller
     break;
     default:
          // Show error
     break;
}

Edited by P0lT10n: n/a

0

You are right but don use if, else if, else... use switch, is more efficient, faster and easier to think...

With switch would be:

switch($_POST['member']){
     case 'buyer':
          // verify login and login as buyer
     break;
     case 'seller':
          // verify login and login as seller
     break;
     default:
          // Show error
     break;
}

and it's also more readable.

0

yes sure, that's why i love switch... If we solved your problem, tick it as solved...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.