View Single Post
Old 06-25-2006, 09:47 AM   · #1
RageD
Senior Member
 
Name: Dennis
Location: Joliet, Illinois
Trader Rating: (42)
Join Date: Apr 2005
Posts: 1,148
NP$: 69.10 (Donate)
RageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to beholdRageD is a splendid one to behold
Child Abuse
[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:
PHP Code:
<?php
$header
= "header.html";
$footer = "footer.html";
$file = $_SERVER['SCRIPT_FILENAME'];

readfile($header);
readfile($file);
readfile($footer);
?>


In header.html insert your ad code you wish to be set in the header.

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>


Now, we need to create a new file... Create a new text document and name it: iframesrc.adsource (Be sure to place it in the "header" directory)

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


Do this just in the reseller's .htaccess or wherever the ad code is being read from... This way the .adsource extension is not available for all users.

==============================================
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


Please register or log-in into NamePros to hide ads
RageD is offline   Reply With Quote
Site Sponsors
Traffic Down Under http://www.mobisitetrader.com/ Traffic Down Under
Advertise your business at NamePros
All times are GMT -7. The time now is 03:44 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.