Jump to content

Problem: Notice: Undefined index: www.wrap-away.com


casey_00

Recommended Posts

Easy to fix problem if you understand php  ???.... but i just know how to crop it.  :-X

this is the script i have in the body:  you can see it at wrap-away.com

 

<?php

$page=$_REQUEST["page"];

$subpage=$_REQUEST["subpage"];

$path2=$_REQUEST["path2"];

$path=$_REQUEST["path"];

 

include ("auth.php");

 

if(!isset($page)){

$page = "home";

}

if(isset($page)){

 

if (isset($path)) {

$path = $path."/";

}else {

$path = '';

}

 

if (isset($path2)) {

$path2 = $path2."/";

}else {

$path2 = '';

}

 

 

 

// start page options + subpages

if(!isset($subpage)){

//echo "$path$page.php";

if (file_exists("$path2$path$page.php")){

include("$path2$path$page.php");

} else {

include("page_not_found.php");

}

} else {

if (file_exists($path2.$path.$page.'_'.$subpage.'.php')){

include($path2.$path.$page.'_'.$subpage.'.php');

} else {

include("page_not_found.php");

}

}

// end page options + subpages

 

} else {

include("home.php");

}

?>

</td></tr></table>

 

 

aNY HELP would rock

 

The error you are seeing isn't really an error...it's php notifying you that at some point in the code it is addressing an index in an array that doesn't exist.  It's not affecting anything.

 

You can fix it two ways...look through your code for the index that it's saying doesn't exist and make sure that it exists before it calls it:

 

//will give undefined index notice:
echo $some_array['name'];

//will not give notice:
$some_array = array();
$some_array['name'] = "bob";
echo $some_array['name'];

 

Or reduce the error reporting level by putting this line at the very top of your page:

 

error_reporting(E_ALL ^ E_NOTICE);

im really dumb  ???when talking about arrays etc... this script was meant to allow me not to insert every page name in the body and also stop me from having to place something on every page. is there anything i can add to the above code that will make it all cool... without having to insert all the page names? :-\

 

thanks man

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.