| | |||||
| ||||||||
| Webmaster Tutorials Instructional webmaster-related how-to's and tutorials. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Apr 2005 Location: Joliet, Illinois
Posts: 1,177
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | [TUTORIAL] Forced ads for resellers Ok, well I finally found it... Forced ads with .htaccess file! Right now this works for .html & .htm extensions, but I'm working on getting it to .php as well, I will update as I figure that one out, it's a little more difficult for obvious reasons. (Quotes, syntax, etc. And above all, it parses through a PHP script) MUST have the php_read function enabled! (Most webservers have this on by default) YES! This is a free alternative to all the software out there First, go into your cPanel account. (Reseller) Now, not in WHM, but cPanel go into File Manager. Find your cPanel skeleton directory. In here... What we will do... First create a new folder... Name it.. header... In this folder create 3 text documents... 1 text document named: header.php 1 text document named: header.html 1 text document named: footer.html In header.php insert the following code: ????: NamePros.com http://www.namepros.com/webmaster-tutorials/210622-tutorial-forced-ads-for-resellers.html PHP Code: In footer.html insert your ad code you wish to be set in the footer. Now go back up one directory... Edit your .htaccess file.. Add this somewhere: Code: AddHandler headered .html # Enable adds on HTML pages AddHandler headered .htm # Enable adds on HTM pages AddHandler headered .php # Enable adds on PHP pages Action headered /header/header.php Ok, now that we have that finished, I have an iFrame code you can use! Now, let's begin.. Open backup your header.html file.. Change it to this: (Footer will not be iFrame unless you do so doing the same process) HTML Code: <HTML> <center><iframe src="http://yoursite.com/header/iframesrc.adsource" scrolling="no" width="48.2%" height="12%"></iframe></center> </HTML> <html> Insert you're ad code into that page... But wait... Perplexed? That is correct, we still need to make the .adsource extension a valid one! So here is what we'll do. Get out of the skeleton directory and go into the reseller account's /public_html folder. Open the .htaccess file.. In the .htaccess file add this somewhere: Code: AddHandler server-parsed adsource AddType text/html adsource ????: NamePros.com http://www.namepros.com/showthread.php?t=210622 ============================================== At the current time it is not very secure for the user will be able to edit it, but I am working on it.. This is the basic concept and as I make changes I will create a changelog at the bottom of this post! Now creating an account will automatically ad your adcode to the site! Just make sure if needed you ad that domain to your publisher account with the ad company ![]() -RageD
Last edited by RageD; 01-04-2008 at 03:08 PM.
Reason: Updated to make work with latest PHP Versions. UPDATES COMING SOON!
|
| |
| | #3 (permalink) |
| New Member Join Date: Jul 2006
Posts: 2
![]() | Looking to 'force ads' I found something called mod_layout and, better (I believe, but I'm not a real webmaster) http://www.ihostdev.com/ipanel.html . It looks good but I don't have a dedicated server to install it. Does anybody has install it on a VPS? I'm looking for a good provider of VPS where I am sure it can be installed. Any suggestion? Thanks. |
| |
| | #5 (permalink) |
| New Member Join Date: Jul 2006
Posts: 2
![]() | I agree In fact, it looks very creative. By the way, did you find the way to make the appear on PHP scripts? My previous Reply was only looking if someone else found another way to do that, inclusive, under payment. My problem is that I don't have the money for a dedicated server (and, monthly fees ) but I can try to pay once for a script (that can be installed on a cheaper shared hosting service).Sorry for any inconvenience i've caused. |
| |
| | #6 (permalink) |
| Senior Member Join Date: Oct 2005 Location: Kent ~ U.K.
Posts: 3,209
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | i think this is a nice little way of garanteeing that you have ads on your hosting accounts ![]() nice one Joe
__________________ Myself and "JackHeskett" are no longer associated with FusedHosting.net. Please pipe all PMs to admin [at] fusedhosting.net. |
| |
| | #7 (permalink) |
| NamePros Member Join Date: Nov 2005 Location: Hardisty, Alberta Canada
Posts: 179
![]() | there is another way to do this with just using .htaccess and just using the .htaccess file itself forget how to do it right now, if I find my free hosting script ill pull it out of it. |
| |
| | #8 (permalink) | ||||
| Senior Member Join Date: Oct 2006 Location: http://akshayjain.org
Posts: 2,817
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | i did everything that you said properly.. (i have not used iframes right now.. just the basic one) but i am getting this error
| ||||
| |
| | THREAD STARTER #9 (permalink) |
| Senior Member Join Date: Apr 2005 Location: Joliet, Illinois
Posts: 1,177
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You used this code exactly in your header.php file? PHP Code: -RageD |
| |
| | #10 (permalink) |
| Senior Member Join Date: Oct 2006 Location: http://akshayjain.org
Posts: 2,817
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | well i dont think that there is any problem with the header.html or footer.html i did one trick to check that out. i removd all the header and footer entries.. so that now the code stands as ????: NamePros.com http://www.namepros.com/showthread.php?t=210622 Code: <?php $file = $_SERVER["PATH_TRANSLATED"]; $readfile($file); ?> Code: [27-Oct-2006 01:57:47] PHP Fatal error: Function name must be a string in /home/gaurav/public_html/header/header.php on line 4 [27-Oct-2006 01:58:07] PHP Fatal error: Function name must be a string in /home/gaurav/public_html/header/header.php on line 4 i think it is some problem with string functions or something as the error log says?
Last edited by champ_rock; 10-28-2006 at 08:51 AM.
Reason: added
|
| |
| | THREAD STARTER #11 (permalink) |
| Senior Member Join Date: Apr 2005 Location: Joliet, Illinois
Posts: 1,177
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You can try to do this manually: For $file = $_SERVER['PATH_TRANSLATED']; try this: ????: NamePros.com http://www.namepros.com/showthread.php?t=210622 PHP Code: |
| |
| | #12 (permalink) |
| Senior Member Join Date: Oct 2006 Location: http://akshayjain.org
Posts: 2,817
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | did that but it is still not working .. is it possible that my server admins may have blocked this kind of a function ???and one more thing, i will give u one free cpanel hosting account with 100mb space+ 1gb bandwidth to experiment.. |
| |
| | #13 (permalink) |
| Senior Member Join Date: Oct 2005 Location: Kent ~ U.K.
Posts: 3,209
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | very nice! not sure i really want to use it though but for people who do this is awesome Joe
__________________ Myself and "JackHeskett" are no longer associated with FusedHosting.net. Please pipe all PMs to admin [at] fusedhosting.net. |
| |
| | THREAD STARTER #17 (permalink) | ||||
| Senior Member Join Date: Apr 2005 Location: Joliet, Illinois
Posts: 1,177
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=210622 -RageD | ||||
| |
| | #18 (permalink) |
| Senior Member Join Date: Jan 2006 Location: Portland, Oregon
Posts: 2,100
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Anyone can just delete the folder and edit their htaccess, even the people with no knowledge about this type of stuff.
__________________ HostingFuze.com Premium Master Reseller Services | 99.9% Uptime Guaranteed SLA | Starting at $4.95/mo Basic Reseller Hosting @ HostFz.com - Services starting as low as $1.95/mo! |
| |
| | THREAD STARTER #22 (permalink) |
| Senior Member Join Date: Apr 2005 Location: Joliet, Illinois
Posts: 1,177
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Actually I have.. This seems to work on PHP 4.x and 5.x. I will update the original post but instead of: PHP Code: PHP Code: Cheers, -RageD |
| |
| | THREAD STARTER #25 (permalink) |
| Senior Member Join Date: Apr 2005 Location: Joliet, Illinois
Posts: 1,177
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Just felt I'd revive this one for anyone who is looking for such a solution again! ![]() Also, I have not tested this but here is an idea. If you would like to keep the "header" directory untouchable by the user and have root access (many don't but that's alright. Maybe it would work with just SSH access on a reseller) try this: ????: NamePros.com http://www.namepros.com/showthread.php?t=210622 cd /home/USER/public_html chown root headers/ chown root headers/* Again, I have not tried this. You may want to test that apache still allows the file to be executed in the browser but it should. After CHOWN'ing to root or another user (resellers try with chown YOURUSER) the user will be unable to edit the file. -RageD
Last edited by RageD; 08-05-2007 at 12:48 PM.
|
| |
![]() |
LinkBacks (?)
LinkBack to this Thread: http://www.namepros.com/webmaster-tutorials/210622-tutorial-forced-ads-for-resellers.html | ||||
| Posted By | For | Type | Date | |
| Forced Ads Module - WHMCS Forums | This thread | Refback | 11-23-2011 12:28 PM | |
| Forced Ads Module - WHMCS Forums | This thread | Refback | 04-12-2011 10:17 AM | |
| need a Force ads - FreeWebHostingTalk | This thread | Refback | 11-10-2009 12:21 AM | |
| Forced Ads Module - WHMCS Forums | This thread | Refback | 07-12-2009 08:05 AM | |
| Forced Ads Module - WHMCS Forums | This thread | Refback | 07-01-2009 09:11 AM | |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |