Jump to content

file_get_contents for displaying ads


etrader

Recommended Posts

I put the javascript code of ad into a file named ad.html, then call it in php by

$ad = file_get_contents("http://mysite.com/ad.html");
echo $ad;

But this does not work for file_get_contents("/ad.html")

 

Is there a way to avoid writing the domain name, and just getting the ad from the file in the root folder?

Link to comment
https://forums.phpfreaks.com/topic/226229-file_get_contents-for-displaying-ads/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.