php code to include same thing in many websites

antsaoo

Supreme Member
Joined
Oct 1, 2008
Messages
1,288
Reaction score
650
Good day, Iw been setting up few forums with FG and though about following.

Would there be way use some code to put the same thing on all forums , Ie Adsense or change it to opt-in box or such so no need to go trough all forums.

Also would it make adsense ads in accurate to content.



Thnx
 
you kinda mentioned it in your title use the php include command to insert common code from an external file

i guess to elaborate, you save your adsense code to a file and the call it from each of your sites using the include statement

so if you change your adsense code it will update across all sites...

see here for more info:

Code:
http://us.php.net/manual/en/function.include.php
http://www.w3schools.com/PHP/php_includes.asp
http://www.tizag.com/phpT/include.php

hth

jay
 
Last edited:
Hmm. read all the tutorials and tried what they said, wonder if the problem is in hosting php version or so , hosting @ seo-hosting and the remote file would be at Hg

i think this should have worked atleast ...

Code:
<?php
    include("http://www.domain.net/file.php");

    // Easy File Inclusion
?>

remote file was php file with some text only in it
need see more tomorrow, hopefully someone can post their thoughts on this :)

thnx
 
try renaming the file .inc

if you can show the contents of the file too that would be helpful

cheers

jay
 
Most hosts disable including remote files like that.
 
see if it pulls in the file on the same domain to test it works

then try remotely accessing it from a different domain and see what happens

there are a few other options you could try but this is certainly the simplest

alternatives would include sticking the info in a database and then pulling the data and displaying it

just a thought...

hth
 
Back
Top