Re: Browser Problem? Coding Problem? Session Problem?

From: Date: Fri, 11 Apr 2003 05:48:24 +0000
Subject: Re: Browser Problem? Coding Problem? Session Problem?
Groups: php.general 
Request: Send a blank email to php-general+get-143450@lists.php.net to get a copy of this message
How are you activating submit? Pressing enter? Or clicking the button with the mouse? Believe it or not, it makes a difference. Cheers, James. >>> php-digest@custom87.net 04/11/03 01:45PM >>> Hi all, I've tried this on Mozilla 1.3, 1.4a and IE 6. It works on IE 6, but not mozilla. (Or at least it doesn't seem to.) I've tried clearing my caches, cookies, everything (even unsetting all session variables). It's a login page: session_start(); if ($_SESSION['logged_in'] == true && $_SESSION['username']) { header("location: index2.php"); } //the loginFunction echoes all the stuff for the login page function loginFunction() { //this function builds the form, cut out for simplicity //it passes two variables: $_POST['username'] and $_POST['password'] } //process if (!$_POST['username'] || !$_POST['password']) { //if there is no username and password in post run the //loginfunction loginFunction(); } else { require ("../variables/global.var.php"); require ("variables/db_connect.var.php"); //an array of login values $db_check = array("username" => $_POST['username'], "password" => md5($_POST['password'])); //the sql query $sql = "SELECT * FROM users WHERE username='" . $db_check['username'] . "' "; $sql .= "AND password='" . $db_check['password'] . "'"; //execute the query $query = $db->getRow($sql); //error handling if (DB::iserror($query)) { die($query->getMessage()); } if ($query) { $_SESSION['logged_in'] = true; $_SESSION['username'] = $db_check['username']; header("location: index.php"); } else { header("location: index.php?wrong=true"); } } On Mozilla I just keep getting the login page, again and again. It works first time on IE... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#143450) next »