Jump to content


Photo

one paged websites


  • Please log in to reply
2 replies to this topic

#1 pgsjoe

pgsjoe
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 08 August 2006 - 10:57 PM

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

if (isset($_GET['news']) || isset($_GET['all'])) { ...page info... }

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?

#2 nethnet

nethnet
  • Members
  • PipPipPip
  • Advanced Member
  • 284 posts
  • LocationPhiladelphia, PA, USA

Posted 08 August 2006 - 11:01 PM

if (!isset($_GET['whatever'])){
default text here
}
"Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep."  --Scott Adams

Current project: nethnet.com

#3 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 08 August 2006 - 11:12 PM

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
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users