Favortire Page template Structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux