Welcome to Admin Junkies, Guest — join our community!

Register or log in to explore all our content and services for free on Admin Junkies.

PHP include command not working


Active member
Jan 19, 2023
For some of my static websites, I was using the <? include("ad.php"); ?> code for including the advertising code from file ad.php on each page. I have noticed that the ads are not being displayed, this command is not working. Is there any alternative command which can be used to display advertising on every page without manually copy pasting the ad code. The webhosting company has not replied to my support ticket for more than 24 hours.
It will most likely cause an error but you can also modify that to
<?php require_once('ad.php');?>
Then atleast you will know why its not loading. Its most likely a path issue, in other words php cant find the file, which is what @Arantor is eluding too. When you get the error just screenshot it then change the code back to what you have and attach it to your next reply.
require_once throws an error while include throws a warning - the fact that there's no visible warning likely means the error won't be visible either, it'll just disappear to a broken layout with the error in whatever log it's been squirrelled away in.
Honestly, its been so long since ive used either (directly) that all I could remember without tracking it down is that require _* was the more severe and would have a better chance at displaying without the need for a config change. But youre right, if one doesnt show there is def a chance the other will not.
I live in WordPress land professionally, we still do a lot of nonsense like that over there. I even had to write my own PSR-4 autoloader like some kind of savage!
Personally I have a very hard time getting motivated to write code when I know there is already code that will do the job better than the shiv I'm gonna write as this one off lol.

I think we just hi-jacked his support thread....

Log in or register to unlock full forum benefits!

Log in or register to unlock full forum benefits!


Register on Admin Junkies completely free.

Register now
Log in

If you have an account, please log in

Log in

New Threads

Would You Rather #9

  • Start a forum in a popular but highly competitive niche

    Votes: 5 20.0%
  • Initiate a forum within a limited-known niche with zero competition

    Votes: 20 80.0%
Win this space by entering the Website of The Month Contest

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds