Jump to content

PHP NAVIGATION PLZZZZZZZZZZZZ HELP


zeek

Recommended Posts

Ok guys, I have beend trying to do this for at least one whole month now, I Keep on getting different codes in tutorials from people but none of them will work. What I really want is to include my news section in the layout using the php include code. Also when ever I click on a link I want it to load up in the news sections. The code that I have now does load properly, but thats because its the default page. When ever I try clicking on the other links in the navigation section they do not load, the page reloads but the default page (News.php) is still there. Can one of you help me out please, I really want to learn how to do that properly. Thanks a million...

Link to comment
https://forums.phpfreaks.com/topic/40221-php-navigation-plzzzzzzzzzzzz-help/
Share on other sites

Here is the code

----------------------

<?php

switch($id) {

default:

include('news.php');

break; case"affiliates":include('affiliates.php');

break; case"what2":include('whatever2.htm');

break; case"what3":include('whatever3.htm');

break; case"what4":include('whatever4.htm');

break; case"what5":include('whatever5.htm');

} ?>

Well, I'll format your code in a readable fashion:

 

<?php

switch($id) {

  default:

    include('news.php');

    break;

  case"affiliates":

    include('affiliates.php');

    break;

  case"what2":

    include('whatever2.htm');

    break;

  case"what3":

    include('whatever3.htm');

    break;

  case"what4":

    include('whatever4.htm');

    break;

  case"what5":

    include('whatever5.htm');

    break;

  }

?>

 

You didn't have the final break in your switch statement.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.