I've created a login page using sessions.
When an incorrect user name or password is entered then a custom messege error message apears.
But if a correct user name and password is used then notthing happens, no error message and I'm still on the login form.
This is the code below.
What am I'm doing wrong?
Code:
<?php
include("config.php");
$id = strip_tags($_GET['id']);
if ($id == "do") {
$user = strip_tags($_POST['username']);
$pass = strip_tags($_POST['password']);
if ($user == $username and $pass == $password) {
session_start();
session_register('authorized');
$_SESSION['authorized'] = true;
header("Location: admin.php");
exit;
} else {
echo "<p>Incorect Username or/and Password, Please Go back and try again.</p>";
}
} else {
?>
<form method="POST" action="login.php?id=do">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" value="Login">
</form>
<?php
}
?>
What do you call the "token" thing?
You know how some sites have links that run on tokens? Tokens are links that only stay alive for a certain amount of time (1 use, 1 day, 1 week, etc).Can someone explain to me what exactly it's
Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data update current data or delete old data from tempproducts to products then it will delete the
script is pulling more then they have....
I have this script for my game where they can change there race. This will cost them 2,500 points. However in our database points are called crystals. If the person has 500 points, and the script
Find current logon time
Hi,
Help pulling in 'id' with "read more" link
I'm trying to create snippets of my articles in the cms I'm creating, and then have them redirect to to a single page entry of the article. Right now my snippets and "read more" links are
Taxonomy? Classification? Categorisation?
Not sure if there is a way around this classification problem
Give me all your tricks for minimizing jar file size
Hi, I'm coming close to releasing my J2ME game... I am kicking up against the 64k size barrier which I have imposed as a maximum size for my game. I would like to add more levels to the game but the
Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Messenger 5.0! What does this mean for you, the user? It means that you have all sorts of cool new
Php WordPress help
I am writing the following code for making a plugin<?phpheader("Content-Type: text/css");/*Plugin Name: Name of the plugin.Plugin URI: The page having information related to
HTML Viewer HIDE scrollbar
How can I disable scrollbars in a HTML Viewer control? I can't hide them. Even i have enough space but i am getting this grey inactive scrollbar....