Hi, im creating a PHP login script in dreamweaver, using the User Authentication addon,
A quick question, when logging in it has an option for a seperate page for if the login fails, ie, if i fail to login, it will redirect to loginfail.php.
I want it to to display the text "Login Failed" or whatever, on the same page. Maybe using the ?echo function, im new to php.
Also, im trying to get it to display the users username when logged in, ie logged in as "USERNAME" or Welcome "USERNAME"
Thanks for your help!!
PHP Login help? new to PHP
Moderator: General Moderators
-
mikeashfield
- Forum Contributor
- Posts: 159
- Joined: Sat Oct 22, 2011 10:50 am
Re: PHP Login help? new to PHP
Code: Select all
<?php
session_start();
$_SESSION['USERNAME']=$USERNAME; //Username should be set by your login script.
echo "Welcome back ".$_SESSION['USERNAME'].".";
?>-
shaunak1234
- Forum Newbie
- Posts: 13
- Joined: Thu Nov 03, 2011 12:24 am
Re: PHP Login help? new to PHP
Was the above reply enough, do you want full login script?
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: PHP Login help? new to PHP
The easiest way is to call the login form on itself; <form action="" method="POST" > : leave the action attribute in your form blankonlinegamesnz wrote:A quick question, when logging in it has an option for a seperate page for if the login fails, ie, if i fail to login, it will redirect to loginfail.php.
I want it to to display the text "Login Failed" or whatever, on the same page. Maybe using the ?echo function, im new to php.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering