I have some PHP code that generates a calendar and then outputs html to display it.
To display it on a page all I need to do is <?php include('calendar.php'); ?>.
Is this bad practice?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I like to put that sort of thing in a function (or class) rather than an include.
I find that makes it a bit more flexible (especially if you need to start passing arguments to it) and easier to re-use in other places.