Hi Everyone,
I am new to PHP. I wonder if we use can include (”abc.PHP”) two times in a PHP page “makeit.PHP”? Thanks.
Katty
Hi Everyone,
I am new to PHP. I wonder if we use can include (”abc.PHP”) two times in a PHP page “makeit.PHP”? Thanks.
Katty
Yes you can use include twice.
But you may get an error depending on what you have inside the PHP file.
Because if you have:
[php]session_start();[/php]
Or anything like that, you can not declare that twice otherwise you will get an error.
I agree, you can use included files many times, as many as needed.
BUT, you can not have certain items in it. As Bleed-O mentions, you do not want to restart your session.
You also do not want to reopen your database tables as it could cause high overhead on it.
And, of course, you do not want to reset any user data in it such as add to the database twice.
But, I often use included from multiple menus or links that need to repeat… Good luck…