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
}
?>
php web service error
hey guys,I'm working on a project requires the use of web services. I've been trying a few tutorials and I get this one persistent error. I've search the web for clues, even this forum and nothing
Mysterious Timeouts
I've deployed a few simple AJAX-enabled web page to a local server that is accessed through the Internet by just two people: Me & one client.When running in VS2008 it works perfectly fine but when
updating a single value to multiple non consecutive rows
I need to update the same value to multiple non consecutive rows. I need to add an experation date to about 6000 parcels.
duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or not. How can I do this ??
Is there a more efficient way to code this than what I have?
I have three associative arrays. $combinedSettings$userSettings$defaultSettingsMy function must combine the key and value from $userSettings and $defaultSettings into the $combinedSettings array.
php multiple action on submit
I have a form which says:<form enctype='multipart/form-data' method='post' action='process.php' target='_blank'>I need to call process.php on submit or on clicking submit button. Now
LSB (PHP 5.3) problem with static value!
hello,i'm having a problem. static::$text variable gets lost at some point. can someone please correct and explain it to me?Line number On/Off| Expand/Contract <?phpclass A { protected
Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will be multi-user. I've got the multi-deck shoe and dealing table done and other parts rough coded. What
Multiple server callbacks (NOT POSTBACKS)
Hello,
Curl & sessions PLS HELP
Hello,I have a problem with curl and sessions and i will try to explain the best i could.01. I want to download a file from (http://subdomain.example.com/name-13075.html) with curl.02. The problem is: