Skip to content
Advertisement

html after include_once doesn’t exist

I’m making a users table and I’m including a part of the table(the users) with a php page that I call with include_once.

after that include my html doesn’t exist when I run the page(with localhost). the code isn’t hidden, it simply doesn’t exist.

this is my table and include function:

JavaScript

any html after this point doesn’t show in the file

the php code:

JavaScript

what do I need to do to fix the html disappearing? thanks!

Update: I was wrongly mistaken that every php script has to have an exit() function. while including a script, using the exit() function will exit the parent page and only the including page. include injects code into another page, it doesn’t “call” another page.

Advertisement

Answer

Get rid of the

JavaScript

line in the include file, because it’s causing the main script to exit before printing the rest of the HTML.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement