•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,558 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,461 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3276 | Replies: 2
![]() |
•
•
Join Date: Jun 2004
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
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'> 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:
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'> 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:
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.
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!
sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
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:
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
<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 --> <marquee width="40%" scrollamount="3"> <?php echo '<b>Hi '.$T1.'</b>'; ?> </marquee> <!--/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"> Remember me <input type="checkbox" name="C1" value="ON" /></p> <p align="left"><input type="submit" value="GO" name="B1" /></p> </form></td></tr> <!--/main table--> </table></div> </body> </html>
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Child Form not Centering (VB.NET)
- loadin a form (Visual Basic 4 / 5 / 6)
- Parsing html form. (PHP)
- Reposition Event?? (Visual Basic 4 / 5 / 6)
- how to load an image to a form (Visual Basic 4 / 5 / 6)
- internet form handling (Python)
- How Do I Configure Windows To Not Remember Text? (Windows NT / 2000 / XP / 2003)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
Other Threads in the PHP Forum
- Previous Thread: WEIRD! php pages do not load unless i hit refresh
- Next Thread: php help needed for login


Linear Mode