sorry, very new to php...and i cant find specifically what im looking for.
Ive added a server behaviour in dreamweaver for a login form, if login fails ive put login.php?failed=true which refers to
<php echo (isset ($_GET[failed]))?" Whoops please try again":"";?>
if i want a sucess statement, whats the correct method and how would i incorporate the users name ie. "Welcome, X"
Many thanks in advance
Login passing variable
Moderator: General Moderators
First, don't use Dreamweaver. Learn how to do it by hand. -_-'
Second, here's a really basic login script:
Btw, use <form method="post"> that way you don't see the variables in the addy.
Second, here's a really basic login script:
Btw, use <form method="post"> that way you don't see the variables in the addy.
Code: Select all
if (isset($_POST['user'])) {
if ($_POST['user'] != 'username' || $_POST['pass'] != 'password') {
die('Error Logging In');
}
else {
print("Welcome, {$_POST['user']}!");
}
}
else {
// print login form
}- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Ok...back to the nonce corner. Could you advise me on the correct script for a uceesful login when im using:
login.php?failed=true
in the server behaviour for a incorrect action...
and how would i incorporate it into
<php echo (isset ($_GET[failed]))?" Whoops please try again":"";?>
.....'with welcome, (UserName)'
Thanks...ill leave you alone after this one!
login.php?failed=true
in the server behaviour for a incorrect action...
and how would i incorporate it into
<php echo (isset ($_GET[failed]))?" Whoops please try again":"";?>
.....'with welcome, (UserName)'
Thanks...ill leave you alone after this one!