I could have sworn i wrote a detailed reply earlier outlining some ideas for changing my initial layout to something else.
Has the forum been down today?
I was simply saying that i was having a total rethink of how everything is laid out, and putting the header and footer into functions, then calling them in various index files, those in sub-directories etc...
Also thinking about using arrays for the content instead of case/switch and if/else.
Thanks for all the help marc, i think i'll take some of your earlier comments and later ons onboard and change how i'm laying out the structure of the files.
Would you mind just explaining a few pieces of code for me....
$current = $_SERVER['SCRIPT_NAME'];
What does SCRIPT_NAME translate to.
PHP website says...
'SCRIPT_NAME' Contains the current script's path. This is useful for pages which need to point to themselves. The __FILE__ constant contains the full path and filename of the current (i.e. included) file. Why is that line required?
Secondly this area.
if(strlen($_SERVER['QUERY_STRING']) > 0) $current .= '?' . $_SERVER['QUERY_STRING'];
'QUERY_STRING' The query string, if any, via which the page was accessed.
So what exactly are you saying in this string, if string length is more than 0? Then current is equal to the string + a question mark?
if(stristr($current, $link))
What does this line do exactly.
http://uk.php.net/manual/en/function.stristr.php
Not sure i fully understand what it's doing still though.
Just want to understand what this is doing, sorry a bit of an impatient learner, lol.... just need a break down of the code, the PHP website itself is very poor (or at least i feel) at explaining things without giving overkill or poor examples, or examples that won't apply to my uses....
Has the forum been down today?
I was simply saying that i was having a total rethink of how everything is laid out, and putting the header and footer into functions, then calling them in various index files, those in sub-directories etc...
Also thinking about using arrays for the content instead of case/switch and if/else.
Thanks for all the help marc, i think i'll take some of your earlier comments and later ons onboard and change how i'm laying out the structure of the files.
Would you mind just explaining a few pieces of code for me....
$current = $_SERVER['SCRIPT_NAME'];
What does SCRIPT_NAME translate to.
PHP website says...
'SCRIPT_NAME' Contains the current script's path. This is useful for pages which need to point to themselves. The __FILE__ constant contains the full path and filename of the current (i.e. included) file. Why is that line required?
Secondly this area.
if(strlen($_SERVER['QUERY_STRING']) > 0) $current .= '?' . $_SERVER['QUERY_STRING'];
'QUERY_STRING' The query string, if any, via which the page was accessed.
So what exactly are you saying in this string, if string length is more than 0? Then current is equal to the string + a question mark?
if(stristr($current, $link))
What does this line do exactly.
http://uk.php.net/manual/en/function.stristr.php
Not sure i fully understand what it's doing still though.
Just want to understand what this is doing, sorry a bit of an impatient learner, lol.... just need a break down of the code, the PHP website itself is very poor (or at least i feel) at explaining things without giving overkill or poor examples, or examples that won't apply to my uses....
Last edited: