| | |
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: 539
Reputation:
Solved Threads: 63
0
#2 30 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: 19
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: 539
Reputation:
Solved Threads: 63
0
#4 30 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: 539
Reputation:
Solved Threads: 63
0
#6 30 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 29 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 |
advanced air ajax amf array arrays asp automatically beginner body broken c# c++ class cms code combobox curl data database display dojofoundation dropdownlist email execute file files flash form forms hosting html image include insert integration java javascript job joomla jquery key lamp limit link linux login mail malfunction menu multiple mysql navigation network news nodes number object oop outofmemmory password paypal pdf php position post programmer provider query remote rss script search security session smash sms soap sockets sorting spam sql survey thread traffic trouble tutorial upload user validation variables video virus web webbrowser webdesign window xml youtube zend






