Page 1 of 1

Code problem, Notice: Undefined index: and Get function

Posted: Thu Jul 15, 2004 10:24 pm
by des.murphy
Hi there,

This is my code

Code: Select all

<?PHP
$page=$_GET&#1111;"page"];
switch ($page)
&#123;
/*
The following section determines what will be viewed on the page that is accessed
the $title value containes the main title for the page
the $script contains the text. Script can be edited to include files
*/
case "main":
  $title="Welcome";
  $script="Hello ciaran, murphy that is, howe are you";
  break;  
case "forums":
  $title="Forums";
  $script="forums_on=true";
  break;
default:
  $title="Welcome";
  $script="";
&#125;
?>

and this is the problem
Notice: Undefined index: page in e:\inetpub\wwwroot\class of 04\index.php on line 2
This points to the $page=$_GET["page"]; line

Strange thing is, I setup the site online and it worked fine. I set up php on my PC today, and I get this.

Posted: Thu Jul 15, 2004 10:27 pm
by feyd

Code: Select all

$page = (!empty($_GET&#1111;'page']) ? $_GET&#1111;'page'] : '');

Posted: Fri Jul 16, 2004 1:38 am
by des.murphy
thanks that worked