Aleks
asked on
PHP code best practices
Being new to PHP I would like how to organize my code better. I usually organize it the exact same page on every page. This are the parts I have recognized so far:
1) PHP code (example below)
<?php require_once( "../../webassist/security_ assist/hel per_php.ph p" ); ?>
<?php
if (!WA_Auth_RulePasses("Logg ed in to pcms2_users")){
WA_Auth_RestrictAccess(".. /../logout .php");
}
?>
2) <html> tag
3) <meta content>
4) <head>
5) <link .. to stylesheets>
6) <scrpt type ... >
7) </head>
8) <body>
9) All the 'body' code
10) </body>
11) </html>
Would that be accurate ? or can I have the PHP code elsewhere as best practice, just looks weird to me that it is at the very top before my meta tags, etc. I would usually have it between my meta tags and before the <head> content.
Any pointers for best practices are welcome.
1) PHP code (example below)
<?php require_once( "../../webassist/security_
<?php
if (!WA_Auth_RulePasses("Logg
WA_Auth_RestrictAccess("..
}
?>
2) <html> tag
3) <meta content>
4) <head>
5) <link .. to stylesheets>
6) <scrpt type ... >
7) </head>
8) <body>
9) All the 'body' code
10) </body>
11) </html>
Would that be accurate ? or can I have the PHP code elsewhere as best practice, just looks weird to me that it is at the very top before my meta tags, etc. I would usually have it between my meta tags and before the <head> content.
Any pointers for best practices are welcome.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you !
ASKER