Hello Guys,

I m Building A Chat Application..in which i have 2 different user types like Admin & Merchant...I Have Taken User type A for Admin & M for Merchant...First I have Created Only Single LogIn Form for both user types & given DropDown So that If He Selects Merchant then it will assign value M to user type...now i have to create another LogIn form for Merchant...so how can i Auto Assign Value Of user type without displaying it on Form at User Side !! :(

I am Providing my Both Codes For LogIn Just Help Me !!
Old Code For Both Admin & Merchant.

<form action="index.php" method="post">
  <table width="350" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF" class="small_grey_border">
    <tr>
      <td width="346"><div align="center"><strong><font size="5">       
      Login</font></strong></div></td>
    </tr>
    <tr>
      <td>	  <div align="center">
          <p><font color="#FF0000" face="Tahoma"><strong> <?php echo $login_message; ?> 
            </strong></font></p>
          <table width="332" border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td width="126" nowrap><div align="right">Username:</div></td>
              <td width="148" nowrap><font face="verdana" size="2"><b>
                <input name="user" class="input" maxlength="100">              
              </b></font></td>
            </tr>
            <tr>
              <td><div align="right">Password:</div></td>
              <td><font face="verdana" size="2"><b>
                <input name="pass" type="password" class="input" maxlength=20>
              </b></font></td>
            </tr>
             <tr>
              <td><div align="right">Are you Merchant?:</div></td>
              <td><font face="verdana" size="2"><b><select name="usertype"><option value="A">No</option><option value="M">Yes</option></select>
               
              </b></font></td>
            </tr>
            <tr>
              <td colspan="2"><div align="center"><font face="verdana" size="2"><b>
                  <input type="submit" value="Login" name="sublogin" class="input">
              </b></font></div></td>
            </tr>
          </table>
          </div>
	  </td>
    </tr>
  </table>
</form>

New Code For Merchant.

<form action="index.php" method="post">
  <table width="350" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF" class="small_grey_border">
    <tr>
      <td width="346"><div align="center"><strong><font size="5">       
      Merchant Login</font></strong></div></td>
    </tr>
    <tr>
      <td>	  <div align="center">
          <p><font color="#FF0000" face="Tahoma"><strong> <?php echo $login_message; ?> 
            </strong></font></p>
          <table width="332" border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td width="126" nowrap><div align="right">Username:</div></td>
              <td width="148" nowrap><font face="verdana" size="2"><b>
                <input name="user" class="input" maxlength="100">              
              </b></font></td>
            </tr>
            <tr>
              <td><div align="right">Password:</div></td>
              <td><font face="verdana" size="2"><b>
                <input name="pass" type="password" class="input" maxlength=20>
              </b></font></td>
            </tr>
             <tr>
              <td><div align="right">Are you Merchant?:</div></td>
              <td><font face="verdana" size="2"><b><select name="usertype" ><option value="M">Yes</option></select>
                            
              </b></font></td>
            </tr>
            <tr>
              <td colspan="2"><div align="center"><font face="verdana" size="2"><b>
                  <input type="submit" value="Login" name="sublogin" class="input">
              </b></font></div></td>
            </tr>
          </table>
          </div>
	  </td>
    </tr>
  </table>
</form>

Hi scmsimplybest and welcome to DaniWeb :)

Not sure exactly what you are asking, but if you want the field to not be shown to the user, use a hidden input type rather than a select. Keep track of the variable in the $_GET array and pass by parameter to your url.

Thanks darkagn !! :)

I have Implemented It with another code !!
But Thanks For ur Kind Response !!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.