monkeytooth Posted April 28, 2008 Share Posted April 28, 2008 Alright.. I host a couple peoples sites and I do it free for them cause they are friends and family.. However I did tell them when I gave them the space that I would add some banners or something to try and offset the diffrence of my cost.. They were ok with this, Problem is they update there pages and what not, and don't readd banner code, or just remove it cause they think they can cause they are a friend or family memeber.. So what I wanna do if at all possible is Just force it in to there pages like a geocities advert so they don't even have to worry about the adding in the code, nor do I worry about them removing it on me.. I host my sites and theirs on godaddy. unix based hosting.. Is there a way to do this with php and or .htaccess or something? And if so how? Link to comment https://forums.phpfreaks.com/topic/103271-advert-via-geocities-style-ads/ Share on other sites More sharing options...
dptr1988 Posted April 28, 2008 Share Posted April 28, 2008 You can use auto_prepend_file and auto_append_file in your .htaccess files http://us.php.net/manual/en/ini.core.php#ini.auto-prepend-file Link to comment https://forums.phpfreaks.com/topic/103271-advert-via-geocities-style-ads/#findComment-529076 Share on other sites More sharing options...
monkeytooth Posted April 28, 2008 Author Share Posted April 28, 2008 Alright checked it out, and googled it some more.. deffinately sounds like a good solution for me generally speaking.. Problem is I can't find anything for .htaccess specificly.. I am mostly finding things involved on the physical server side of things like the actual .conf files for the server and setting them up accordingly.. I don't know a superb ammount about .htaccess so Im trying to figure out how to impliment whole concept of auto_prepend_file into an .htaccess file.. the next question on that same note is how would I only work it for specific directorys and files contained within Meaning outside of the root folder which contains my main site I have a single folder that I contain all my other sites in, as well as the friends and family sites.. but thing is I don't want to effect all the sites just most of them.. But I think while typing I answered my own question as I know you have to throw the .htaccess file in the root folder of the site in question.. so how would I set that up? anyone Link to comment https://forums.phpfreaks.com/topic/103271-advert-via-geocities-style-ads/#findComment-529195 Share on other sites More sharing options...
redarrow Posted April 28, 2008 Share Posted April 28, 2008 Since there family why not somethink simple m8......... banner.php <?php if(file_exists("user_banner.php")){ include("user_banner.php"); }else{ echo "<center><font color='red'>SORRY MY WEB SITE BANNER NOT HERE SORRY<BR> NO WEB SITE PAGE WILL BE DISPLAYED!<BR> PLEASE CONTACT ME!</font></center>"; } ?> user_banner.php <?php echo" <table align='center' border='4' bordercolor='black' > <tr> <td> <font size='10' color='red' align='center'>REDARROWS BANNER</font> </tr> </td> </table> "; ?> Link to comment https://forums.phpfreaks.com/topic/103271-advert-via-geocities-style-ads/#findComment-529220 Share on other sites More sharing options...
dptr1988 Posted April 28, 2008 Share Posted April 28, 2008 How to set php.ini values in .htaccess: http://us2.php.net/manual/en/configuration.changes.php I'm not sure where to put .htaccess files. That's an apache problem. Link to comment https://forums.phpfreaks.com/topic/103271-advert-via-geocities-style-ads/#findComment-529225 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.