Jump to content


Includes


2 replies to this topic

#1 Fernando

    Young Padawan

  • Members
  • Pip
  • 14 posts

Posted 08 October 2006 - 11:14 PM

I added the following code to my website which I've used before in the same way and it has worked.

<?php
$number = "5";
switch($id) { 
default: 
include('news/show_news.php');
break; case "story":
include('story.php');
break; case "pictures": 
include('pictures.php'); 
break; case "music": 
include('music.php'); 
break; case "videos": 
include('videos.php');
break; case "contactme": 
include('contactme.php');
} 
?>

The only page I have available right now is story.php, and the code I used to link to that page is this one:

<a href="?id=story">Blah</a>

When I go to my website, OverdueDeath.com, and click on "Story", it doesn't come up, please help me with this.

#2 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 09 October 2006 - 06:43 AM

You haven't defined $id, on most setups (the good ones) you cannot use just the array key.

$id = $_GET['id'];

Add that before your switch statement.

#3 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 09 October 2006 - 11:32 PM

It's called register_globals, google it and you'll know why the good setups turn it off.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users