close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

User Forms for 2 Sets of Users

Thread began 11/16/2009 1:51 pm by rob294118 | Last modified 11/18/2009 2:24 pm by rob294118 | 1498 views | 3 replies

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.

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...