GaVrA Posted May 5, 2009 Posted May 5, 2009 I dont know if this is the best way to do it, so i have to ask... :) This solution works just fine, but i am just wandering if there is a better way? So in my index.php i have this: <?php require "header.php"; ?> then goes my content and then: <?php require "footer.php"; ?> footer.php looks like this: <?php function FormatRowFooter(){ return <<<HTML </div> <div id="footer"> <div id="valid"> <a href="http://validator.w3.org/check?uri=referer" title="Valid XHTML 1.0 Strict!">xhtml</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Valid CSS level 2.1">css</a> </div> <div id="copyright"> <a href="http://www.ivar.rs" title="ivar.rs">2009. iVar ©</a> </div> </div> </div> </body> </html> HTML; } $rowFooter = FormatRowFooter(); echo $rowFooter; ?> In my header.php only difference is html content and instead of echoing $rowFooter i echo $rawHeader. This works like a charm, i am just wandering if this is correct way to do it? :)
Management terabyte Posted May 6, 2009 Management Posted May 6, 2009 If it works fine with no problems then no need to change it :P Board Rules - Available Products - Need a Custom Work? < Don't PM me for support, post in the forum or submit a ticket from the client area instead! >
GaVrA Posted May 6, 2009 Author Posted May 6, 2009 I know, but i was hoping for one of those "ehhh gavra, gavra, so noobish... this is best way to do that:" hahaha... :D
Management terabyte Posted May 9, 2009 Management Posted May 9, 2009 The code is fine so let's be nit-picky :lol: You can change this code:$rowFooter = FormatRowFooter(); echo $rowFooter;with this smaller code:echo FormatRowFooter();Done :P Board Rules - Available Products - Need a Custom Work? < Don't PM me for support, post in the forum or submit a ticket from the client area instead! >
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now