By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,963 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,963 IT Pros & Developers. It's quick & easy.

PHP user login form

P: 1
Hello friends i am basically a new in programming language...i got readymade new login script and which i want to use for another form for my website.i.e


Form that i want to use in my website is
Expand|Select|Wrap|Line Numbers
  1.  
  2. <form action="process.php" method="post">
  3.  
  4.  <input type="text" id="username" name="username"  onfocus="this.value='';" onblur="if (this.value=='') {this.value='Username';}" value="user1" />  
  5.  
  6.  
  7. <input type="password" id="password" name="password" onfocus="this.value='';" onblur="if (this.value=='') {this.value='************';}" value="pass" />
  8.  
  9. <input type="checkbox" value="c" name="rm" id="remember"/> <label for="remember">Remember me?</label>
  10.  
  11.  <button id="login" value="" type="submit" name="login"></button>
  12.              ]
  13.       </form>   
  14.  





This is the readymade php script which i want to use for the above mention FORM.so what variables used to replace the in that FORM....really appreate your help


PHP sCript


Expand|Select|Wrap|Line Numbers
  1.  
  2. <?
  3.  
  4. if($form->num_errors > 0){
  5.    echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
  6. }
  7. ?>
  8. <form action="process.php" method="POST">
  9. <table align="left" border="0" cellspacing="0" cellpadding="3">
  10. <tr><td>Username:</td><td><</td></tr>
  11. <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>
  12. <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>>
  13. <font size="2">Remember me next time &nbsp;&nbsp;&nbsp;&nbsp;
  14. <input type="hidden" name="sublogin" value="1">
  15. <input type="submit" value="Login"></td></tr>
  16. <tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr>
  17. <tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr>
  18. </table>
  19. </form>
  20.  
  21. <?
Oct 10 '11 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
basically you can replace the form as is. you only need to make sure that the according form element names are retained (unless you want to change the PHP code (which you might have to do anyways))
Dec 14 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.