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

 

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.