pgsjoe Posted August 8, 2006 Share Posted August 8, 2006 So using a series of if statements, I've gone through and combined some smaller websites that I run into one paged websites with different information under each if statement.i.e.-if (chapter)...chapter infoif (links)...link infoI've got information that I want to show up on the index page, but when someone clicks on a different link I want that information to go away. The statement I'm using for this is....[code] if (isset($_GET['news']) || isset($_GET['all'])) { ...page info... }[/code]My question is, what do I set the index page information as to display when only the web address is put in. Right now, inside a statement like that, the page shows up blank. Then when you click on the home page link, you are shown what's there. Is there something like index.php=1 that will make it show up when only the URL is entered in the address bar? Did I lose you? Link to comment https://forums.phpfreaks.com/topic/16969-one-paged-websites/ Share on other sites More sharing options...
nethnet Posted August 8, 2006 Share Posted August 8, 2006 if (!isset($_GET['whatever'])){default text here} Link to comment https://forums.phpfreaks.com/topic/16969-one-paged-websites/#findComment-71487 Share on other sites More sharing options...
onlyican Posted August 8, 2006 Share Posted August 8, 2006 If you MUST build a one page website use switch not if statementsswitch($_GET["page"]){case "page2"://this is page 2break;default://this is your home pagebreak;}But WHYgoogle hates Dynamic links(index.php?page=xyz)So you would probs mod rewrite themits heavier as the whole page is read every time.Unless you are using Ajax or something, I suggest not to Link to comment https://forums.phpfreaks.com/topic/16969-one-paged-websites/#findComment-71495 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.