473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

PHP user login form

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
1 3767
Dormilich
8,658 Expert Mod 8TB
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

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

Similar topics

1
by: John Wolrehammer | last post by:
After the user login in i want to close the login form. I can close it but it also closes the whole application. Can anyone help.
4
by: David Krussow | last post by:
Just wondering if/how it would be possible to display a variable string on the login form - where the string varies depending on the form the user attempted to access. To clarify, an...
2
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public...
15
by: carr4895 | last post by:
Hello. I was wondering if someone could help me too with a login form. Upon startup, I have to display a password screen and it should accept a user name and password. User name can be anything...
3
by: Bob | last post by:
I haver a user login form (winforms app using vs2005 in VB.NET). After succesfull validayion of user I want to open a first form and close the loging form that was used, If I write If...
0
by: kalukum | last post by:
Hi...Friends I'm using oracle10g with developer 6i. I want create my own user login form and validate the user in my user table. that user table has created myself in my database. Eg: 'kalukum'...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
0
by: sandari | last post by:
The following code (web.config in Visual Studio 2005) is supposed to redirect a user to the appropriate Form depending on their role. However, regardless of the user's role, the only page...
1
by: Evelyne | last post by:
Private Sub cmdOK_Click() Dim cn As New ADODB.Connection Dim obj As New ADODB.Command Dim rst As New ADODB.Recordset On Error GoTo Err_Handler Set cn = CurrentProject.Connection
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.