/    Sign up×
Community /Pin to ProfileBookmark

Undefined variable:

I am getting a error (Undefined variable: row_rs_settings). I am stumped to why I am getting this. Here is the line that is it is saying in error.

<?php if ($row_rs_settings[‘encoding1’]==”utf”){?>

Any help would be appreciated.

Chad

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 18.2007 — The error message is pretty descriptive in this case: you are using a variable ($row_rs_settings) that is not defined within the context where it is being used. Either you simply have not defined it, or you've spelled it wront, or it's being used within a function definition but was defined outside of that function.
Copy linkTweet thisAlerts:
@Chada34authorNov 18.2007 — NogDog,

Thanks for the reply.

It is not affecting any pages just a error comes up. Here is the top part of file and I can't find anything wrong.

<?php

# Function for navigation build ::


function buildNavigation($pageNum_Recordset1,$totalPages_Recordset1,$prev_Recordset1,$next_Recordset1,$separator=" | ",$max_links=10, $show_page=true)

{

GLOBAL $maxRows_rs_customers,$totalRows_rs_customers;

$pagesArray = ""; $firstArray = ""; $lastArray = "";

if($max_links<2)$max_links=2;

if($pageNum_Recordset1<=$totalPages_Recordset1 && $pageNum_Recordset1>=0)

{

if ($pageNum_Recordset1 > ceil($max_links/2))

{

$fgp = $pageNum_Recordset1 - ceil($max_links/2) > 0 ? $pageNum_Recordset1 - ceil($max_links/2) : 1;

$egp = $pageNum_Recordset1 + ceil($max_links/2);

if ($egp >= $totalPages_Recordset1)

{

$egp = $totalPages_Recordset1+1;

$fgp = $totalPages_Recordset1 - ($max_links-1) > 0 ? $totalPages_Recordset1 - ($max_links-1) : 1;

}

}

else {

$fgp = 0;

$egp = $totalPages_Recordset1 >= $max_links ? $max_links : $totalPages_Recordset1+1;

}

if($totalPages_Recordset1 >= 1) {

# ------------------------


# Searching for $_GET vars


# ------------------------


$_get_vars = '';

if(!empty($_
GET) || !empty($_GET)){

$_
GET = empty($_GET) ? $_GET : $_GET;

foreach ($_
GET as $_get_name => $_get_value) {

if ($_get_name != "pageNum_rs_customers") {

$_
get_vars .= "&$_get_name=$_get_value";

}

}

}

$successivo = $pageNum_Recordset1+1;

$precedente = $pageNum_Recordset1-1;

$firstArray = ($pageNum_Recordset1 > 0) ? "<a href="$_SERVER[PHP_SELF]?pageNum_rs_customers=$precedente$_get_vars">$prev_Recordset1</a>" : "$prev_Recordset1";

# ----------------------


# page numbers


# ----------------------


for($a = $fgp+1; $a <= $egp; $a++){

$theNext = $a-1;

if($show_page)

{

$textLink = $a;

} else {

$min_l = (($a-1)*$maxRows_rs_customers) + 1;

$max_l = ($a*
$maxRows_rs_customers >= $totalRows_rs_customers) ? $totalRows_rs_customers : ($a*$maxRows_rs_customers);

$textLink = "$min_l - $max_l";

}

$_ss_k = floor($theNext/26);

if ($theNext != $pageNum_Recordset1)

{

$pagesArray .= "<a href="$_
SERVER[PHP_SELF]?pageNum_rs_customers=$theNext$_get_vars">";

$pagesArray .= "$textLink</a>" . ($theNext < $egp-1 ? $separator : "");

} else {

$pagesArray .= "$textLink" . ($theNext < $egp-1 ? $separator : "");

}

}

$theNext = $pageNum_Recordset1+1;

$offset_end = $totalPages_Recordset1;

$lastArray = ($pageNum_Recordset1 < $totalPages_Recordset1) ? "<a href="$_
SERVER[PHP_SELF]?pageNum_rs_customers=$successivo$_get_vars">$next_Recordset1</a>" : "$next_Recordset1";

}

}

return array($firstArray,$pagesArray,$lastArray);

}

?><?php require_once('../Connections/conn.php'); ?>

<?php

// Load the common classes

require_once('../includes/common/KT_common.php');

// Load the tNG classes

require_once('../includes/tng/tNG.inc.php');

// Load the required classes

require_once('../includes/tfi/TFI.php');

require_once('../includes/tso/TSO.php');

require_once('../includes/nav/NAV.php');

// Make unified connection variable

$conn_conn = new KT_connection($conn, $database_conn);

//Start Restrict Access To Page

$restrict = new tNG_RestrictAccess($conn_conn, "../");

//Grand Levels: Level

$restrict->addLevel("1");

$restrict->Execute();

//End Restrict Access To Page

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

{

$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {

case "text":

$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

break;


case "long":

case "int":

$theValue = ($theValue != "") ? intval($theValue) : "NULL";

break;

case "double":

$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";

break;

case "date":

$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

break;

case "defined":

$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

break;

}

return $theValue;

}

}

// Filter

$tfi_listrs_customers1 = new TFI_TableFilter($conn_conn, "tfi_listrs_customers1");

$tfi_listrs_customers1->addColumn("FirstName", "STRING_TYPE", "FirstName", "%");

$tfi_listrs_customers1->addColumn("LastName", "STRING_TYPE", "LastName", "%");

$tfi_listrs_customers1->addColumn("Email", "STRING_TYPE", "Email", "%");

$tfi_listrs_customers1->Execute();

// Sorter

$tso_listrs_customers1 = new TSO_TableSorter("rs_customers", "tso_listrs_customers1");

$tso_listrs_customers1->addColumn("FirstName");

$tso_listrs_customers1->addColumn("LastName");

$tso_listrs_customers1->addColumn("Email");

$tso_listrs_customers1->setDefault("LastName");

$tso_listrs_customers1->Execute();

// Navigation

$nav_listrs_customers1 = new NAV_Regular("nav_listrs_customers1", "rs_customers", "../", $_SERVER['PHP_SELF'], 30);

//NeXTenesio3 Special List Recordset

$maxRows_rs_customers = $_SESSION['max_rows_nav_listrs_customers1'];

$pageNum_rs_customers = 0;

if (isset($_
GET['pageNum_rs_customers'])) {

$pageNum_rs_customers = $_GET['pageNum_rs_customers'];

}

$startRow_rs_customers = $pageNum_rs_customers * $maxRows_rs_customers;

// Defining List Recordset variable

$NXTFilter_rs_customers = "1=1";

if (isset($_SESSION['filter_tfi_listrs_customers1'])) {

$NXTFilter_rs_customers = $_
SESSION['filter_tfi_listrs_customers1'];

}

// Defining List Recordset variable

$NXTSort_rs_customers = "FirstName";

if (isset($_SESSION['sorter_tso_listrs_customers1'])) {

$NXTSort_rs_customers = $_
SESSION['sorter_tso_listrs_customers1'];

}

mysql_select_db($database_conn, $conn);

$query_rs_customers = "SELECT * FROM ec_customers2 WHERE ec_customers2.CustomerID<>'1' AND {$NXTFilter_rs_customers} ORDER BY {$NXTSort_rs_customers} ";

$query_limit_rs_customers = sprintf("%s LIMIT %d, %d", $query_rs_customers, $startRow_rs_customers, $maxRows_rs_customers);

$rs_customers = mysql_query($query_limit_rs_customers, $conn) or die(mysql_error());

$row_rs_customers = mysql_fetch_assoc($rs_customers);

if (isset($_GET['totalRows_rs_customers'])) {

$totalRows_rs_customers = $_
GET['totalRows_rs_customers'];

} else {

$all_rs_customers = mysql_query($query_rs_customers);

$totalRows_rs_customers = mysql_num_rows($all_rs_customers);

}

$totalPages_rs_customers = ceil($totalRows_rs_customers/$maxRows_rs_customers)-1;

//End NeXTenesio3 Special List Recordset

$nav_listrs_customers1->checkBoundries();

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/siteassist_template.dwt.php" codeOutsideHTMLIsLocked="false" -->

<head>

<?php if ($row_rs_settings['encoding1']=="utf"){?> [SIZE="4"][COLOR="Red"]<-----Problem Line[/COLOR][/SIZE]

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><?php }else{ ?>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<?php }?>

<!-- InstanceBeginEditable name="doctitle" -->

<title>Admin - Manage Users</title>

<!-- InstanceEndEditable -->

<link rel="stylesheet" type="text/css" href="siteassist_css/style.css" />

<link rel="stylesheet" type="text/css" href="siteassist_css/color.css" />

<link rel="stylesheet" type="text/css" href="siteassist_css/template.css" />

<link rel="stylesheet" type="text/css" href="siteassist_css/navigation.css" />

<link rel="stylesheet" type="text/css" href="siteassist_css/navigation_color.css" />

<link rel="stylesheet" type="text/css" href="siteassist_css/my_styles.css" />

<script type="text/JavaScript">

<!--

If you don't mind looking through it and see if I missed something
Copy linkTweet thisAlerts:
@jasonahouleNov 18.2007 — Perhaps that variable is defined in on of your included files but it is definitely not defined in the code above and therefore can not be used. You either need to find the place where your settings are defined or need to remove the code. Is this an international site? When would you not use utf-8?
×

Success!

Help @Chada34 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...