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
}
?>
Handling text changed in text box control using Ajax
I need to create a web form with a text box control. When someone types text into the textbox I need to post back to a C# or VB method to handle the changed text entered into the text box control.Is
Remove Rows From Database ad
Hi All,I have this:Code: [Select]<?phpsession_start();include('../common/dbconnect.php');$stock_id = $_GET['stock_id'];$query='SELECT * FROM users_stocks WHERE user_id ="' .
Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to another and whoever they have subscribed to is echoed back on there profile page. my users table
SMTP server...
I recently found a tutorial online on SMTP authentification for sending emails from webpages, here is the tutorial
Images outside webroot
Im hopeing someone can help me with this because i cant figure it out.I have setup an ASP.NET website in C# that allows end users to upload files to the server. I am able to save these files outside
how to get sn motherboard
Hello.
Undefined variable: adHTML
Hello:While checking my site error logs, I've noticed one repetitive error that fills the log file. The error is "PHP Notice: Undefined variable: adHTML in /.../bot_jrheader.php on line
Form Help
Here is the form:Line number On/Off | Expand/Contract<? include("../include/session.php"); ?> <?php if ($submit) { $sql = "UPDATE productimages
How do I send data using an html link
HiIf I have <a href="main_file.php">How do I send data to main_file.php I have a group of links that are created on the fly and I want to give each link a value so that I can
need help in update query
i create a form for update. there are 8 columns in my mysql table. on my main page all the data is retrieve from db and displayed on the page. after every row there is a link edit. when user click