Jump to content


Photo

Using $_POST


  • Please log in to reply
1 reply to this topic

#1 mitcho

mitcho
  • Members
  • PipPip
  • Member
  • 21 posts

Posted 19 April 2006 - 06:42 AM

im currently using some PHP code to load pages using includes:

<?php switch($id) { default: include('home.html');
break; case "home": include('home.html');
break; case "about": include('about.html');
break; case "services": include('services.html');
break; case "people": include('people.html');
break; case "news": include('news/news.php');
break; case "contact": include('contact.html');
break; case "disclaimer": include('disclaimer.html');
break; case "sitemap": include('sitemap.html');
} ?>

and i call links like this:
<a href="index.php?id=contact">CONTACT</a>

but as you can see here this isnt working. [a href=\"http://www.guardianlawyers.com.au/\" target=\"_blank\"]http://www.guardianlawyers.com.au/[/a]
i have been told to use $_POST or $_GET but am not sure how to go about this... any one help update my code to get it working?

Thanks

#2 devofash

devofash
  • Members
  • PipPipPip
  • Advanced Member
  • 81 posts

Posted 19 April 2006 - 10:50 AM

do something like this:

<?php 

$id = $_GET['id']   // Get the value in id and then use the switch to decide what page to display

switch($id) 
{ 
  default: 
  include('home.html');
  break; 
  case "home": 
  include('home.html');
  break; 
  ...
  ...
} 
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users