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
}
?>
Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop or only echo once I can do the addition but it will echo 5 time in the loop.How would I go about
Question about the upload of large files
Hi there,I have a question about the upload of large files, like videos (files generally above 20Mo).Is it better to use the FTP functions of php or the normal upload fonctions using additional
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.
storing video files into mysql in php
hi i have my video files in my folder ,i have to store the path of the videos into db and the play it in the player from the database.thanking in advance
Server side $_SESSION
how does one keep the session completely server side. no cookies to the browser at all. i need this site to be cookie and jscript free.
start new row of pictures
on my site www.budstreasureauctions.com there is a featured auctions box that users will pay to get there picture on the homepage. currently the box limit is 6. If you increase the limit then it
Sessions work for me and not others?
I'm having a bit of bad luck with sessions. In the past they have worked fine for me, but this time around I'm having terrible luck. Basically, I made the crappiest login system ever. I'm using
Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a method where it has been thrown.Right now I have this:class myException extends Exception {
How do I get the row number from from an sql table query
Hi allI have a table that I query and it returns a number of rows.mysql_num_rows($query) = $totalI want to have next and previous buttons, is there a way of retrieving the current row number, and can
Parse error: parse error in C:wampwwwlogspagesmembers.php on line 16
I dont see the problem with this, I always get Parse error: parse error in C:\wamp\www\logs\pages\members.php on line 16, what did I do wrong?? <?php $sql = "SELECT *