Favortire Page template Structure
| From: | Jim MacDiarmid | Date: | Wed, 24 Mar 2004 14:36:21 +0000 |
| Subject: | Favortire Page template Structure | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-23253@lists.php.net to get a copy of this message | ||
I was interested in seeing if anyone has a favorite way of structuring
their PHP pages? For instance, I found one example where pages were laid
out as follows:
Everything was based off of index.php and parameters were submitted
through the hidden fields or through an action variable on the url
querystring.
Index.php
--------- Begin example index.php ----------
<?php
/*
* Common include files here
* Database connection initialization includes here
* Security includes here
*/
/*
* define local functions here
*/
/*
* Initialize globals variables
* and constants here
*/
/*
* Define a main function here
*/
Function main(){
/*
* Initialize local variables
* and constants here
*/
/* capture action variable on url querystring */
/* do something based on action */
}
?>
/* HTML Code here */
-----8<-- End Example --->8--
Any thoughts on this? I'm still kinda new at PHP and wanted to learn the
best way to structure my code from the git-go. :)
Thanks in advance,
Jim