need some php help here

xxgeek's picture

He has: 17 posts

Joined: Jan 2004

i have this for a nav thing

<?php
switch ($page)
{
default :
include \
"includes/tops/page.php\";
break;
CASE \"home\":
include \"includes/tops/page.php\";
break;
CASE \"design\":
include \"includes/tops/page2.php\";
break;
CASE \"hosting\":
include \"includes/tops/head3.php\";
break;
CASE \"support\":
include \"includes/tops/page4.php\";
break;
CASE \"contact\":
include \"includes/tops/page5.php\";
break;
CASE \"login\":
include \"includes/tops/page6.php\";
break;
}
?>

but i want to pass a bit more info other than the page switch, mainly page title desc and keywords, to be place in the tags etc..
from a single predifined include...
what's the quickest way of doing so?

THX

VENI VIDI VICI

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You can include more statements in each case. I think the default is supposed to be at the end.

Busy's picture

He has: 6,151 posts

Joined: May 2001

for each CASE have something like

CASE "page name":
$ptitle = "pages name title";
$desc = "pages desc";
$kwords = "key words";
include "filename";
break;

can even have functions etc in there

CASE "science":
if(E=m2c){ take over the world; }
else if (

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Busy wrote: CASE "science":
if(E=m2c){ take over the world; }
else if (

E=M(C^2)
Energy = Mass * (Speed of light squared)

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

But really:

E = [gamma] m_0 (c^2) = (m_0 (c^2)) / sq_root(1 - (v^2)/(c^2))

Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.