close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

User Forms for 2 Sets of Users

Thread began 11/16/2009 4:51 pm by rob294118 | Last modified 11/18/2009 5:24 pm by Eric Mittman | 1205 views | 3 replies |

rob294118

User Forms for 2 Sets of Users

I'm looking to somehow modify the registration, user profile, login, logout forms.

I have 2 user tables one for customers and one for vendors. How can I modify all the forms to use one set of forms if you're a customer and one set of forms if you're a vendor? Some sort of variable and then IF statements maybe set on the pages?

Customer Login Vendor Login

Thanks.

Sign in to reply to this post

Eric Mittman

Do you need to have completely different forms for registering and logging in? If so how do you determine which form to show the user?

You are rite about how you could get them both on a single page, you would use some if statements to show one versus the other, but how do you make this determination?

Alternatively you can create a different set of user pages with the Security Assist wizard. Please post back with some more info about how you will have this setup and we will help you out with whatever we can.

Sign in to reply to this post

rob294118

I need to have different fields on the registration and profile forms.

I have 2 user tables, usercustomers and usersdesigners.

I was going to have 2 links on a menu...one for Customer Login and one for Designer Login. Once a user selects "Customer Login" or "Designer Login" I want to set a variable (customer or designer).

I want the user_profile to display either user_profile_customer or user_profile_designer depending on the variable set.

Sign in to reply to this post

Eric Mittman

Ok, to setup the variable you must ensure that a user clicks on the link. In the link you should add a URL parameter, you can call it login and set it 1 for the regular user and 2 for the designers. It would look like this:

html:
<a href="login.php?login=1>Customer Login</a>



Then on the top of the login page you can set a session variable based on the value of this URL parameter. You can call it the same, you should also assume a default of customer in case the user goes directly to this login page. That code would look like this:

php:
if(!session_id()) session_start();

if(isset($_GET['login']) && $_GET['login'] == 2){
   $_SESSION['login'] = 2;
}else{
   $_SESSION['login'] = 1;
}



If you have both forms on this page you can show one or the other like this:

php:
if($_SESSION['login'] == 1){ //if the user is a customer then display the customer login

   //customer login form goes here
}else if($_SESSION['login'] == 2){ // if they are a designer then display that login
  //designer login form goes here
}



You can use this same logic for other pages that you would like to display one thing versus another. One other thing to check will be the names of your submit buttons for these forms and the triggers for the login. You will need to ensure that you have unique names and that the server behaviors are only triggered on the submission of the correct form.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...