[SOLVED] Code problem, Notice: Undefined index: and Get func

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
des.murphy
Forum Newbie
Posts: 7
Joined: Wed Jul 14, 2004 1:25 pm

Code problem, Notice: Undefined index: and Get function

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

$page = (!empty($_GET&#1111;'page']) ? $_GET&#1111;'page'] : '');
des.murphy
Forum Newbie
Posts: 7
Joined: Wed Jul 14, 2004 1:25 pm

Post by des.murphy »

thanks that worked
Post Reply