TomasD79 Posted March 7, 2007 Share Posted March 7, 2007 Hi, I'm a web developer (hobbyist), with enough xhtml/css knowledge to put a decent site together.. PHP is not a strong point at all!! I use PHP includes to seperate navigation etc but thats about it.. I have a site I am working on at the moment that has about 70 different pages, spread through 6 topic areas.. I was looking for a way of reducing the number of html/php files I have on the site (basically to keep things organised).. I've been googling away and it seems that I can use PHP to actually bundle pages of the same topic into one file.. but for all the reading I'm doing I'm stuck on symantics.. Essentially what I want to do is have eg. titles.php which includes a side nav relevant to all the titles.. then if a user clicks on title1 it calls from further down the page.. so links would be <a href=?page="title"&content="title1">title 1</a> i think Im right that the code for the div inwhich the dynamic content will sit will be something along the lines of <? if (page=title&content=title1) {TITLE1 CONTENT} elseif (page=title&content=title2) {TITLE2 CONTENT} else {WELCOME to title} ?> it seems that it should be simple, but Im stuck on how to express the PHP can anyone help? Thanks for reading Link to comment https://forums.phpfreaks.com/topic/41685-solved-simple-query-re-page-navigation/ Share on other sites More sharing options...
fenway Posted March 7, 2007 Share Posted March 7, 2007 Well, the quoting for the href is wrong -- no quotes other than the outer ones that are missing -- but you'll need the equivalent of a switch statement to parse the page type and include the appropriate navigation layer. Link to comment https://forums.phpfreaks.com/topic/41685-solved-simple-query-re-page-navigation/#findComment-202017 Share on other sites More sharing options...
TomasD79 Posted March 7, 2007 Author Share Posted March 7, 2007 the word "switch" helped searching alot! got it pinned down... elseif ($gallery2=="photo2") {;?> CONTENT<? } where links are [code] < href="featuredgallery2.php?gallery2=photo2">[Next image]</a></p> [/code] Link to comment https://forums.phpfreaks.com/topic/41685-solved-simple-query-re-page-navigation/#findComment-202035 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.