Jump to content

[SOLVED] Include (I must be retarted)


Jest

Recommended Posts

This is probably the simplest navigation script I've ever seen but it wont load past the default page.
Heres a snippet.
[code]
<?php switch($id) { default: include('home.html');
break; case "contact": include('contact.html');
} ?>

Link

<a href="index.php?id=contact">Contact</a>

[/code]

Link to comment
https://forums.phpfreaks.com/topic/38511-solved-include-i-must-be-retarted/
Share on other sites

And that's some ugly code.

 

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

 

That looks nicer. Now, out of personal preference I always do default last, but that's just my preference.

 

The reason it's stopping is because of break. break will exit out of the switch. break

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.