Answered
Content include on $p var VS. seperate pages
I am just starting a new site (
www.freecrm.zymichost.com
in php with back end MySQL data
I have been advised that you should only have one main index.php file and then include main content based on the variable posted.
e.g.
if $p == "Register" then link /index.php?p=Register
elseif $p=="Login" then link /index.php?p=Login
else link /index.php?Home
blah de blah - you get the message.
The page I have has a header, main content and footer include - all of which work great but I am having doubts that further down the line, I will start to get problems with passing additional variables.
Is this method recommended or should I create standard seperate pages based on a template?
In addition, I have a "sniffer" script, which captures visitor data and will, eventually, insert those details into a history database. This will then be viewable by potentail advertisers to validate visitor count.
My problem with this is that if I use the first method of content include, I will have to capture the variable extension (i.e. after ?p=blah&cusid=1456374) to obtain which page is visited but it will also capture more personal information passed in the URL (such as cusid...)
Again, I think that if I create sepearate pages, I can leave out the variable capture from the URL.
Does any of this make sense?
Any opinions would be greatly appreciated.
I have been advised that you should only have one main index.php file and then include main content based on the variable posted.
e.g.
if $p == "Register" then link /index.php?p=Register
elseif $p=="Login" then link /index.php?p=Login
else link /index.php?Home
blah de blah - you get the message.
The page I have has a header, main content and footer include - all of which work great but I am having doubts that further down the line, I will start to get problems with passing additional variables.
Is this method recommended or should I create standard seperate pages based on a template?
In addition, I have a "sniffer" script, which captures visitor data and will, eventually, insert those details into a history database. This will then be viewable by potentail advertisers to validate visitor count.
My problem with this is that if I use the first method of content include, I will have to capture the variable extension (i.e. after ?p=blah&cusid=1456374) to obtain which page is visited but it will also capture more personal information passed in the URL (such as cusid...)
Again, I think that if I create sepearate pages, I can leave out the variable capture from the URL.
Does any of this make sense?
Any opinions would be greatly appreciated.
