Page 1 of 1

Include js on select paes using templets

Posted: Fri Nov 28, 2003 7:18 pm
by seeker2921
So I have my site set up to use a templete.. So I have all the main HTML in my index.php and then wheret he content is supposed to go I have this code

Code: Select all

<?
if(!isset($go)) 
{ 
    include("home.php"); 
} 
else 
{ 
    for($i=0; i<count($links); $i++) 
    { 
        if($go==$links[$i]) 
        { 
            include($url[$i]); 
            break; 
        } 
    } 
} 
?>
So that pulls the other pages into the index.php creating a temeplet system, Thats simple But what I need is I need to include JS in the header only on select pages so say I want to include a JS script on index.php?go=about but I don't want that JS code on any of the other pages.. How would I do this?

Thanks and I hope I explained my problem well enough..

Posted: Sat Nov 29, 2003 9:33 am
by ghost007
hi,

you can use a if statement in the home.php file:
<?
if (go=="about"){
?>

Code: Select all

<?}?>
Rest of html

hope this helps
Siech