I developed a website a few months ago and I am now having an issue with logging into it. The place that it is hosted just did some upgrades to their servers and for some reason, now my login page doesn't work correct.
I do know that it connects to the database, receives the information, and the session is set. The problem is that it doesn't forward itself to the next page. The way I know that the session has started is I have manually typed in the URL of the menu page (the page it is suppose to go to once the user logs in).
I am completely stumped on what is wrong here. I have other pages that use the same method to go to the next page once a user fills in a form and they work correctly.
Here is the code I use
Code: //process the script only if the form has been submitted
if (array_key_exists('login', $_POST)) {
//start the session
session_start();
include('include/connection.php');
//clean the $_POST array and assign to shorter variables
nukeMagicQuotes();
$username = trim($_POST['username']);
$pwd = trim($_POST['pwd']);
//connect to the database as a user
$conn = dbConnect();
//prepare username for use in SQL query
$username = mysql_real_escape_string($username);
//get the username's details from the database
$sql = "Select * FROM user
WHERE Username = '$username'";
$result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result);
if (sha1($pwd.$row['Salt']) == $row['pwd']) {
$_SESSION['authenticated'] = 'abc';
}
//if no match, destroy the session and prepare error message else {
$_SESSION = array();
session_destroy();
$error = 'Invalid username or password';
}
//if the session variaable has been set, redirect if (isset($_SESSION['authenticated'])) {
//get the time the session started
$_SESSION['start'] = time();
header('Location: homepage.php');
exit;
}
}
When I hit the login button, all i get is the information from the header.php file (which contains the <head> information) and the URL says it's still the index file.
Any help would be greatly appreciated. The PHP version they are now using is 5.2.9. I'm not sure what the previous version was, but it was a PHP 5.x.x version.
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignored, rejected, or misunderstood in this forum. I'm surprised there isn't already any
MySQL Does not UPDATE- SQLString Problem
vb Syntax (Toggle Plain Text)
Drop Down and text box issue
Is it possible to set a drop down list and text boxes to a certain width?here is my codeCode: [Select]echo "<select name='categories'>"; echo "<option
xApp Analytics in BI 7.0
Dear all,
Variable Clash
In the past I've had variables clash. For example:Code: <?php $c = 5; $cat = "Molly"; $echo $cat . " is " . $c . " years old.";?>Before, I've seen it
array ...
hiCode: function formatCategories($categories, $parentId){ // $navCat stores all children categories // of $parentId $navCat = array(); // expand only the categories with the same parent id
Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:QuoteBlah blahBlah blahetcbut when i echo it out, there is no formatting left it comes out as:QuoteBlah blah Blah blah etcis there an easy way to stop this?
Session variable help
I'm having a very troubling issue. Maybe I'm just looking over something but I have looked at the code for several hours now, making small adjustments here and there to try to fix this problem.
Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data displayed on the bar graph .The problem is that Y-axis of the chart resizes in function to the
PHP mail() rejected by SMTP
I'm currently working on a newsletter application which is installed on a windows 2003 server running apache. This server is scheduled to run a script every 5 minutes that will send an email to 10