Hey,
I'm currently designing a web app, but I cant work out how to lay it out, so it all works...
(not the design layout, I mean how the header, content, footer & sidebar gets put together, plus the mod_rewrite nice urls...)
This is how I currently have it laid out:
home.php
(I know the above isnt full valid php, its just quick to show you....hehe)Code:include header.php //inc all info on stylesheets, etc.. $page_name = strtolower($_GET['page']); $page_name = trim($page_name, " "); if $page == 'blah' { include blah.php }elseif $page == 'foo'{ include foo.php }elseif $page == 'bar'{ include bar.php }....etc.... include footer.php // inc </div> for site wrapper, and inc sidebar
.htaccess
And I end up with something like this:Code:RewriteEngine on RewriteRule ^blah$ home.php?page=blah RewriteRule ^foo$ home.php?page=foo RewriteRule ^bar$ home.php?page=bar
BUT, I'm coming across problems, like not being able to use header(); in the content files, because data has already been sent to the browser from the header file.....and simple problems like that....if you've ever designed a site from scratch, I think you will know what I mean....Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w93.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/199/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="css/style.css" rel="stylesheet" type="text/css" /> <title>Site - Blah</title> </head> <body> <div id="wrapper"> <div id="head">head</div> <div id='content'>Blah Page</div> <div id='sidebar'>blah</div> <div id="foot">foot</div> </div> </body> </html>
So, if you design sites which have dynamic pages, and you use nice urls using mod_rewrite, please post a detailed (if possible) description about how you do it, to a) make it as easy as possible to add pages & b) cause as little disruption to your current, or future php code....
Thanks alot in advance!
fLUx









Bookmarks