session/header problem (warning:newbie with sessions)

From: Date: Sat, 17 May 2003 16:49:45 +0000
Subject: session/header problem (warning:newbie with sessions)
Groups: php.general 
Request: Send a blank email to php-general+get-148028@lists.php.net to get a copy of this message
Hi, These are the notices/warnings i am getting and the page exits: Notice: Undefined variable: row in c:\phpdev\www\bwh\co.authenticate.login.php on line 19 Notice: Undefined variable: row in c:\phpdev\www\bwh\co.authenticate.login.php on line 20 Warning: Cannot add header information - headers already sent by (output started at c:\phpdev\www\bwh\co.authenticate.login.php:19) in c:\phpdev\www\bwh\co.authenticate.login.php on line 21 this is my tiny code: <?php error_reporting (E_ALL); include_once("configbwh.php"); $user= $_POST["user"]; $pass= $_POST["pass"]; if(isset($user) && $user && isset($pass) && $pass) { $connected=mysql_connect ("$hostt", "$userr", "$passs") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("$db"); $database["sql"] = " select user,pass from main_co where user='".$user."' and pass='".$pass."'"; $result = mysql_query($database["sql"]) or die("Error: " . mysql_error()); if(mysql_num_rows($result) == 1) { session_start(); $_SESSION['user'] = $row[15]; $_SESSION['pass'] = $row[16]; header("Location:co.details.php"); exit; } } ?> what am i doing wrong? Kindly reply, -Ryan

« previous php.general (#148028) next »