943,906 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 4634
  • PHP RSS
Aug 14th, 2004
0

the form cant remember me ?????

Expand Post »
hi my friends :lol:

today i want to ask about important something


iam make page to know the user and his password


the code for this page will

-----------------------------------------------------------------------

<html dir='ltr'>

<head>
<meta http-equiv='Content-Language' content='en-us'>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>
<title>User name</title>
</head>

<body>

<!-- welcome text -->
<b>
<marquee width="40%" scrollamount="3">
<?
echo "Hi ".$T1;
?>
</marquee></b>
<?
////////////////table head
echo"
<div align='left'>
<table border='1' width='40%' cellspacing='0' cellpadding='0' style='border-style: solid' bordercolor='#000000'>
<tr>
<td>
";
/////////////////////////////////////////////////////////////////////////////////////////////
// the form
echo"
<form method='POST' action=$PHP_SELF>
<br>
<p align='left'>User name : <input type='text' name='T1' size='20'></p>
<p align='left'>Password : <input type='password' name='T2' size='20'></p>
<p align='left'>&nbsp;Remember me
<input type='checkbox' name='C1' value='ON'></p>
<p align='left'><input type='submit' value='GO' name='B1'></p>
</form>
";
////////////////////////////////////////////////////////////////////////////////////////////
/////////////// end table
echo"
</td>
</tr>
</table>
</div>
";


?>
</body>

</html>

-------------------------------------------------------------------------

now i want to make this page remember the user

if he come agine :lol:


can you help me ?????????? :rolleyes:
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
astm is offline Offline
5 posts
since Jun 2004
Aug 14th, 2004
0

Re: the form cant remember me ?????

this is a job for cookies and session handling...and someone else. cuz i still havnt taken the time to learn those things cuz im lazy and schools starting back up.
Reputation Points: 152
Solved Threads: 39
Master Poster
Killer_Typo is offline Offline
778 posts
since Apr 2004
Aug 15th, 2004
0

Re: the form cant remember me ?????

For starters your code is a mess and you are seriously overusing the usage of PHP, ok i agree PHP is great and on this small a scale it wouldn't do much, but if your going to go into bigger scale projects and you overuse PHP like this you could crash your server, here is your code a little more user and server friendly... :cheesy:
PHP Syntax (Toggle Plain Text)
  1. <html dir="ltr">
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us" />
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
  5. <title>User name</title>
  6. </head>
  7. <body>
  8. <!-- welcome text -->
  9. <marquee width="40%" scrollamount="3">
  10. <?php
  11. echo '<b>Hi '.$T1.'</b>';
  12. ?>
  13. </marquee>
  14. <!--/welcome text-->
  15. <!--table head-->
  16. <div align="left">
  17. <table border="1" width="40%" cellspacing="0" cellpadding="0" style="border-style: solid" bordercolor="#000000">
  18. <!--/table head->
  19. <!--main table-->
  20. <tr><td><form method=POST" action="<?php echo($PHP_SELF); ?>">
  21. <br />
  22. <p align="left">User name : <input type="text" name="T1" size="20" /></p>
  23. <p align="left">Password : <input type="password" name="T2" size="20" /></p>
  24. <p align="left">&nbsp;Remember me
  25. <input type="checkbox" name="C1" value="ON" /></p>
  26. <p align="left"><input type="submit" value="GO" name="B1" /></p>
  27. </form></td></tr>
  28. <!--/main table-->
  29. </table></div>
  30. </body>
  31. </html>
  32.  

Now you say you want to remember the user when they login, well you would need to use eitheer sessions or cookies for this...or a combination of the both, look into:

Sessions:
http://www.php.net/manual/en/function.session-start.php
http://www.php.net/manual/en/functio...on-destroy.php (to logout)

Cookies:
http://www.php.net/manual/en/function.setcookie.php

I hope this has helped you....

YoungCoder
Reputation Points: 13
Solved Threads: 2
Junior Poster
YoungCoder is offline Offline
193 posts
since Aug 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: WEIRD! php pages do not load unless i hit refresh
Next Thread in PHP Forum Timeline: php help needed for login





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC