| | |
Customized user login
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2009
Posts: 525
Reputation:
Solved Threads: 61
0
#2 25 Days Ago
•
•
•
•
what is the script to customise a login. for example if "abc" logs in to the website, how do i get it to display "Welcome abc", if "pqr" logs in "Welcome pqr" and so on...
please help!
PHP Syntax (Toggle Plain Text)
session_start(); if(username/password check) { //some code $session['username'] = $_POST['txtfield_name_username']; }
PHP Syntax (Toggle Plain Text)
if(isset($session['username']) && $session['username'] !='') { echo "Welcome ".$session['username']; }else echo "Welcome guet";
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Oct 2009
Posts: 18
Reputation:
Solved Threads: 0
frameset2.php
<FRAMESET ROWS="15%,*">
<FRAME SRC="banner.html" name="banner">
<FRAMESET COLS="20%,*">
<FRAME SRC="leftmenu.html" NAME=sidebar>
<FRAME SRC="welcome.html" NAME=main>
</FRAMESET>
</FRAMESET><noframes></noframes>
login.html
<form action="validateUserLogin.php" method="post">
Username <input type="text" name="textBox1" /> <br>
Password <input type="password" name="txtPassword" /> <br>
<input type="submit" value="Ok" />
<input type="button" value="Cancel" />
</form>
<p> <a href=""> New User? </a></p>
banner.php
<p align="center"> <font style="outline-style:none" size="+4" color="#FFFFFF"> ABC & Company </font> </p>
<body bgcolor="#666666">
where do i add the php script for it to work the way i mentioned above? as in if pqr logs in then --> welcome pqr~!
<FRAMESET ROWS="15%,*">
<FRAME SRC="banner.html" name="banner">
<FRAMESET COLS="20%,*">
<FRAME SRC="leftmenu.html" NAME=sidebar>
<FRAME SRC="welcome.html" NAME=main>
</FRAMESET>
</FRAMESET><noframes></noframes>
login.html
<form action="validateUserLogin.php" method="post">
Username <input type="text" name="textBox1" /> <br>
Password <input type="password" name="txtPassword" /> <br>
<input type="submit" value="Ok" />
<input type="button" value="Cancel" />
</form>
<p> <a href=""> New User? </a></p>
banner.php
<p align="center"> <font style="outline-style:none" size="+4" color="#FFFFFF"> ABC & Company </font> </p>
<body bgcolor="#666666">
where do i add the php script for it to work the way i mentioned above? as in if pqr logs in then --> welcome pqr~!
•
•
Join Date: Sep 2009
Posts: 525
Reputation:
Solved Threads: 61
0
#4 25 Days Ago
put this -
inside login.html
and this -
inside welcome.html
PHP Syntax (Toggle Plain Text)
session_start(); if(username/password check) { //some code $session['username'] = $_POST['txtfield_name_username']; }
and this -
PHP Syntax (Toggle Plain Text)
if(isset($session['username']) && $session['username'] !='') { echo "Welcome ".$session['username']; }else echo "Welcome guet";
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Sep 2009
Posts: 525
Reputation:
Solved Threads: 61
0
#6 25 Days Ago
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Jul 2008
Posts: 44
Reputation:
Solved Threads: 1
0
#8 25 Days Ago
You need some sort of username and password verification
You could use some sort of MySQL query like this:
And put that in a conditional to see if it checks, and then if it does, set the session cookies like network18 said.
You could use some sort of MySQL query like this:
php Syntax (Toggle Plain Text)
SELECT user_id, username FROM login WHERE username = '$user_username' AND password = '$user_password
And put that in a conditional to see if it checks, and then if it does, set the session cookies like network18 said.
![]() |
Similar Threads
- script not allowing the user to login again if already logged in (PHP)
- How do you minimize a user login? (Windows NT / 2000 / XP)
- user login module (ASP)
- is there a way to take user login from SQL database (ASP.NET)
- hide user from login screen (OS X)
- User login Check (ASP)
- prompted to select user to login, but no users listed (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: mySQL TABLES
- Next Thread: What shoul i so if my host doesn't support cron job
| Thread Tools | Search this Thread |
adobe advanced air ajax amf array automatically beginner body broken buttons c# c++ class cms code combobox connection curl database developer display dojofoundation dropdown dropdownlist email errorlog execute fatalerror file files flash form forms html iframe image include insert integration java javascript job jquery key lamp limit link linux login mail malfunction menu multiple mysql navigation network news nodes object oop outofmemmory password paypal pdf php post problem programmer provider query radio remote root script search security session sms sockets software sorting source spam sql static thread traffic trouble tutorial upload user variables video virus web websitecontactform window youtube zend






