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

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


<!-- welcome text -->
<marquee width="40%" scrollamount="3">
echo "Hi ".$T1;
////////////////table head
<div align='left'>
<table border='1' width='40%' cellspacing='0' cellpadding='0' style='border-style: solid' bordercolor='#000000'>
// the form
<form method='POST' action=$PHP_SELF>
<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>
/////////////// end table




now i want to make this page remember the user

if he come agine :lol:

can you help me ?????????? :rolleyes:

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.

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:

<html dir="ltr">
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>User name</title>
<!-- welcome text -->
<marquee width="40%" scrollamount="3">
echo '<b>Hi '.$T1.'</b>';
<!--/welcome text-->
<!--table head-->
<div align="left">
<table border="1" width="40%" cellspacing="0" cellpadding="0" style="border-style: solid" bordercolor="#000000">
<!--/table head->
<!--main table-->
<tr><td><form method=POST" action="<?php echo($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>
<!--/main table-->

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:

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


I hope this has helped you....


This article has been dead for over six months. Start a new discussion instead.