PHP Question please

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

User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Or to have more easier to read code, that won't give you a parse error...

Code: Select all

<?php
if ( isset ( $_GET['page'] ) )
{ 

  switch ( $_GET['page'] )
  { 

    case 'home': 

      echo 'This is the home page.'; 
      //or if you have a main homepage you can do like: 
      //include("home.html"); 

    break; 

    case 'downloads': 

      echo 'this is downloads page..'; 
      //include("downloads.html"); 

    break; 

    case 'contact': 

      echo 'this is contact page.'; 
      //include("contact.html"); 

    break; 

  } // end switch

} // end if
?>
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

I just copied the code he had pasted and added to it, i wasn't checking for errors
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

It's okay. We all make mistakes. :wink:
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

:-D
Post Reply