Jump to content

one paged websites


pgsjoe

Recommended Posts

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 info

if (links)
...link info

I'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
Share on other sites

If you MUST build a one page website use switch not if statements

switch($_GET["page"]){
case "page2":
//this is page 2
break;

default:
//this is your home page
break;

}

But WHY

google hates Dynamic links
(index.php?page=xyz)
So you would probs mod rewrite them
its heavier as the whole page is read every time.

Unless you are using Ajax or something, I suggest not to
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.