Page 1 of 1

PHP Notice: Undefined index: content in... Please help

Posted: Tue May 06, 2008 11:11 am
by Cgull
Hi,

I just uploaded a new site I've created that works fine on my machine, but online I get this error on the home page:

PHP Notice: Undefined index: content in C:\Domains\sigalz.co.za\wwwroot\cv\xhtml\index.php on line 24

In my index file, I have this code:

Line 24 is marked in Red:

<?php
if (!isset($_REQUEST['content']))
$nextPage = "content/main.inc.php";

else
$nextPage = "content/" . $_REQUEST['content'] . ".inc.php";

if($_REQUEST['content'] != "gallery")
include($nextPage);
?>

Any ideas what can cause this?

Re: PHP Notice: Undefined index: content in... Please help

Posted: Tue May 06, 2008 12:07 pm
by Christopher

Code: Select all

   if (!isset($_REQUEST['content'])) {
       $nextPage = "main";
    } else {
       $nextPage = $_REQUEST['content'] ;
    }                       
    if($nextPage  != "gallery") {
       include("content/" . $nextPage. ".inc.php");
    }

Re: PHP Notice: Undefined index: content in... Please help

Posted: Tue May 06, 2008 3:11 pm
by Cgull
Thank you very much :)