0

Hi there, I am getting the following error. Could you review my code and help me as to why? I am using the mod_rewrite extention also.

Notice: Undefined index: in /var/www/incpages/mylines.php on line 48

<?php
if( basename( __FILE__ ) == basename( $_SERVER['PHP_SELF'] ) )
{
  exit();
}

include("includes/config.php");

if ($maintancemode == "true") { 

if ($access == "3") { die("Sorry site is under maintance please try again later."); }


}

// create db connection

mysql_connect("$dbhost", "$dbusername", "$dbpassword")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

$page = $_GET['go'];                    // THIS IS LINE 48

$page = stripslashes($page);
if (!$page) { $page = "news"; }
$ext = "php";

include("includes/pagesallowed.php");

// system check login

if(!isset($_SESSION)) 
{ 
session_start(); 
}  
if(isset($_SESSION['username'])){
//if (array_key_exists('username' , $_SESSION)){
//if(session_is_registered('username')){
$logged = "yes";


   // user vars
   $SQLtext = "SELECT * FROM members where username = '$_SESSION[username]' ";
   $result = mysql_query($SQLtext);
   $row = mysql_fetch_row($result);
    $myid = $row[0];
   $uname = $row[1];
   $email = $row[3];
   $paypal = $row[4];
   $mobile = $row[5];
   $access = $row[6];
   $state = $row[7];
   $disc1m = $row[10];
   $disc3m = $row[11];
   $disc6m = $row[12];
   $disc12m = $row[13];
if ($access == "0") { $access == "3"; }


} else {
$logged = "no";
}
?>
4
Contributors
3
Replies
17
Views
3 Years
Discussion Span
Last Post by diafol
0

Can you confirm there is a value in fourth column of members table for id that is set?

1

Better to use mysql_fetch_assoc and text indices. Then if your table is modified you don't have to re-write the numeric indices. Pretty sure even for a NULL field, you should not get an 'undefined index'.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.