Page 1 of 1

PHP One Time Offer Script allows visitor to go back

Posted: Sat Mar 15, 2008 11:50 am
by KSosz
Hi, this is my first time posting here, I read the guidlines and I hope I understood correctly!

I have a script that counts down a number of seconds, and then does not allow the visitor to see the web page a second time. I am posting two PHP files, one called blank.php and one called test.php.

The blank.php works as it should. It will not allow you to go back to the OTO page.

The test.php counts down like it should, but allows the page to be revisited, and resets the timer each time.

I had to remove some of the body of the test.php, it was too big to post. I cannot see any difference in the php part of the pages. Can anyone determine why the test.php allows the page to be revisited and refreshed?

Blank.php:

Code: Select all

<?php
 
header("Pragma: no-cache");
header("Cache-control: private, no-cache, no-store");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
 
// Put the URL for your download page here
$order = "http://www.worldwideinfosource.com/affiliate-x-factor-report-bonus/dload8y9yl.html";
 
// Open the list of IP addresses
$ipAddress = $_SERVER["REMOTE_ADDR"];
$ipFile = "ip.txt";
@touch($ipFile);
 
if (!is_readable($ipFile) || !is_writable($ipFile)) {
   die("Chmod $ipFile to 777 before continuing.");
}
$ipList = array_map("trim", file($ipFile));
$ipList = array_unique($ipList);
 
// Skip this page and redirect to the normal order page if they've already seen the OTO
if (isset($_COOKIE["shown"]) || in_array($ipAddress, $ipList)) {
   header("Location:$order"); die();
}
// Otherwise, set the cookie so they won't see this page again
else {
   setcookie("shown", "1", strtotime("+1 year"), "/");
}
 
// Save this IP address to the list
$ipList[] = $ipAddress;
 
$fp = fopen($ipFile, "w");
fwrite($fp, implode("\n", $ipList));
fclose($fp);
 
?>
<html>
<head>
<title>NEWBIE TOOLKIT WITH RESALE RIGHTS ONE-TIME OFFER!</title>
 
<style type="text/css">
<!--
body {
    background-image: url(HTTP://www.worldwideinfosource.com/images/pixel.gif);
}
.style3 {font-size: x-small}
.style5 {
    font-size: xx-large;
    font-weight: bold;
    color: #CC3300;
}
.style7 {
    font-size: medium;
    font-weight: bold;
}
.style8 {font-size: medium}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
 
<body>
<br>
<table width="700" border="1" align="center" cellpadding="20" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td bgcolor="#FFFFFF"><div align="center">
      <div id="main"> <span class="style5">Special Offer </span>          
        <h2><a name="seconds"></a>You have <span id="otoCounter">300</span> seconds to make your decision...</h2>
     <p>...then, this page and offer will disappear <u><strong>forever</strong></u>!</p>
     <p>Make sure you click the link of your choice at the bottom of this page<br> 
     <strong> before the counter reaches 0</strong>. </p>
   <p>&nbsp;</p>
     <p>blank</p>
     <p>&nbsp;</p>
     <p>&nbsp;</p>
     <p><span class="style3"><a href="#seconds">See how much time you have left before this special offer expires</a></span></p>
     <p>&nbsp;</p>
     <p class="style7"><a href="http://worldwideinfosource.com" target="_blank">Yes, I Want This Special Offer</a></p>
     <p><strong><a href="http://www.worldwideinfosource.com/affiliate-x-factor-report-bonus/dload8y9yl.html" class="style8">No Thanks, Just Let Me Download My Files </a></strong></p>
     <p>&nbsp;</p>
   </div></div></td>
  </tr>
</table>
<p align="center" class="style3"><a href="http://www.internetmarketingbasics.net/panicoto/index.php?e=webpayments@worldwideinfosource.com" target="_blank" class="style3">Powered By PanicOTO</a> </p>
<p><br>
  <br>
    
 
    <script type="text/javascript" src="oto.js"></script>
    
  <script type="text/javascript">
<!--
 
function finish() {
   window.location = "<?php echo $order ?>";
}
OTO.onEnd = finish;
OTO.start("otoCounter");
 
// -->
    </script>
    
</p>
</body>
</html>
 

here is test.php:

Code: Select all

<?php
 
header("Pragma: no-cache");
header("Cache-control: private, no-cache, no-store");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
 
// Put the URL for your download page here
$order = "http://www.worldwideinfosource.com/affiliate-x-factor-report-bonus/dload8y9yl.html";
 
// Open the list of IP addresses
$ipAddress = $_SERVER["REMOTE_ADDR"];
$ipFile = "ip.txt";
@touch($ipFile);
 
if (!is_readable($ipFile) || !is_writable($ipFile)) {
   die("Chmod $ipFile to 777 before continuing.");
}
$ipList = array_map("trim", file($ipFile));
$ipList = array_unique($ipList);
 
// Skip this page and redirect to the normal order page if they've already seen the OTO
if (isset($_COOKIE["shown"]) || in_array($ipAddress, $ipList)) {
   header("Location:$order"); die();
}
// Otherwise, set the cookie so they won't see this page again
else {
   setcookie("shown", "1", strtotime("+1 year"), "/");
}
 
// Save this IP address to the list
$ipList[] = $ipAddress;
 
$fp = fopen($ipFile, "w");
fwrite($fp, implode("\n", $ipList));
fclose($fp);
 
?>
<html>
<head>
<title>NEWBIE TOOLKIT WITH RESALE RIGHTS ONE-TIME OFFER!</title>
 
<style type="text/css">
<!--
body {
    background-image: url(HTTP://www.worldwideinfosource.com/images/pixel.gif);
}
.style3 {font-size: x-small}
.style5 {
    font-size: xx-large;
    font-weight: bold;
    color: #CC3300;
}
.style7 {
    font-size: medium;
    font-weight: bold;
}
.style8 {font-size: medium}
 
.style1 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 26px;
    color: #000066;
    font-weight: bold;
}
.style3 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 16px;
    color: #000000;
}
.style15 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; color: #000000; font-weight: bold; }
 
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
 
<body vlink="#0000FF" topmargin="0" style="background-repeat: repeat" bgcolor="#004262">
<br>
<table width="900" border="1" align="center" cellpadding="20" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td bgcolor="#FFFFFF"><div align="center">
      <div id="main"> <span class="style5">Special Offer </span>          
        <h2><a name="seconds"></a>You have <span id="otoCounter">300</span> seconds to make your decision...</h2>
     <p>...then, this page and offer will disappear <u><strong>forever</strong></u>!</p>
     <p>Make sure you click the link of your choice at the bottom of this page<br> 
     <strong> before the counter reaches 0</strong>. </p>
   <p>&nbsp;</p>
     <div align="center">
    <table border="0" width="742" id="table42" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
        <tr>
            <td width="742" colspan="5" background="images/affiliate-xfactor-bonus-header.gif" height="80">&nbsp;</td>
        </tr>
        <tr>
            <td width="1" height="30" bgcolor="#000000">
            <img border="0" src="images/10x10.gif" width="1" height="36"></td>
            <td width="740" colspan="3" height="72" bgcolor="#000000" background="images/10x10.gif">
            &nbsp; <b><font color="#FFFF00" face="Verdana" size="2">&nbsp; </font>
            <font color="#FFFFFF" face="Verdana" style="font-size: 11pt"><span style="color: #ff0000">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ffff00">11 Training Products 
            for Internet Marketing Newbies, ALL With Resale Rights!</span></span></font></b></td>
            <td width="1" height="36" bgcolor="#000000">
            <img border="0" src="images/10x10.gif" width="1" height="36"></td>
        </tr>
        <tr>
            <td width="742" colspan="5" background="images/10x10.gif" height="1" bgcolor="#000000">
            <img border="0" src="images/10x10.gif" width="100%" height="1"></td>
        </tr>
        <tr>
            <td width="1" bgcolor="#000000" background="images/10x10.gif">
            <font face="Verdana">
            <img border="0" src="images/10x10.gif" width="1" height="100%"></font></td>
            <td width="25">&nbsp;<p>
            <font face="Verdana">
            <img border="0" src="images/10x10_invisible.gif" width="25" height="10"></font></td>
            <td width="690">&nbsp;<h1 align="center">
            <font face="Verdana" size="5">Purchase The Affiliate X Factor from my link,<br>and Get This <em>Jam Packed</em> Newbie Toolkit -<br>for <span style="text-decoration: underline">FREE</span>!<br> </font>
                <font face="Verdana" size="5">
                    <br>Many of Your Visitors, Subscribers and
            <br>
            Potential Customers are 
            Struggling to<br>
            Grow Their Own Online Businesses. </font>
            </h1>
            <h1 align="center"><font face="Verdana" color="#FF0000" size="5">The 
            Problem is, They Get Bogged<br>
            Down Trying to Master the Basics.</font></h1>
            <h1 align="center"><font face="Verdana" size="5">"Here's Your Chance 
            to Secure <font color="#FF0000"><br>
            Master 
            Resale Rights</font> to a Selection of <br>
            High-Quality Training Materials That Guide <br>
            Any Beginner Marketer or Webmaster, <u><br>
            Step-by-Step,</u> Through 
            <span style="text-decoration: underline; background-color: #FFFF00">
            ALL the</span><span style="background-color: #FFFF00"><u> 
            Fundamental<br>
            Skills Required to Succeed Online</u></span>!"</font></h1>
            <p align="left"><font face="Verdana" size="2"><b><br>
            From:</b> <b><font color="#000000">Ken Soszka -</font></b></font><font face="Verdana"
                size="2"><b><font color="#000000"> CEO and Founder - Worldwide Info Source</font></b></font></p>
            <p align="left"><br>
            <font face="Verdana">Fellow Internet Marketer,</font></p>
            <p align="left"><b><font face="Verdana">One of the biggest mistakes 
            that many of us make when marketing online is to assume that our 
            customers and potential customers know all the basic stuff that we 
            know.</font></b></p>
            <p align="left"><font face="Verdana">We tend to forget all the hours 
            we spent struggling with FTP. The hours we spent learning how to add 
            payment links to our pages. The hours we spent trying to figure out 
            how to get our websites indexed in the search engines. </font></p>
            <p align="left"><b><font face="Verdana">In short, we've forgotten 
            how difficult and frustrating it can be when you're first starting 
            out.</font></b></p>
            <p align="left"><font face="Verdana">Now, think about the people 
            visiting your websites and reading your emails. </font></p>
            <p align="left"><b><font face="Verdana">Think about your potential 
            customers...</font></b></p>
            <p align="left"><font face="Verdana">What's the point in marketing 
            the latest, greatest resale rights product, if half the people on 
            your list have no idea how to set up the reseller site?</font></p>
            <p align="left"><font face="Verdana">What's the point in marketing 
            your sneaky new viral ebook trick, if half your visitors have no 
            idea how to make any kind of ebook -- let alone a viral one?</font></p>
            <p align="left"><font face="Verdana">Let's face it, people will not 
            buy your advanced products, until they've mastered the basics first. 
            And, without a doubt, there are a LOT of people out there who are 
            struggling right now to master those basics.</font></p>
            <p align="left"><b><font face="Verdana">If you don't believe me, 
            just take a look at the support requests you receive. My guess is 
            that many of them come from people who aren't able to get past first base 
            because they lack the fundamentals.</font></b></p>
            <p align="left"><font face="Verdana">And that's where 
            the <b>Newbie Toolkits Package</b> comes in...</font></p>
            <p><font face="Verdana">On this page, you have the opportunity to 
            grab a selection of newbie training products that teach ALL the 
            basics of internet marketing.</font></p>
            <p><font face="Verdana">No more frustration -- just read, watch and 
            listen as each step is laid out in a clear, easy-to-understand 
            manner.</font></p>
            <p><font face="Verdana">Each product includes <b>Master Resale 
            Rights</b> so you can resell them to your own visitors and 
            subscribers -- and keep 100% of the profit from every sale! (Don't 
            know how to sell these products on your own website? Don't worry, just 
            download them today, and you'll know very soon ;-)</font></p>
            <p><b><font face="Verdana" size="4">Here's what you get...</font></b></p>
            <p>&nbsp;</p>
 
 
 
            <div align="center">
 
 
 
 
 
 
 
 
                </div>
 
 
 
 
                </div>
 
 
 
 
                </div>
 
 
 
 
                </div>
 
 
 
 
                </div>
 
 
 
 
                </div>
 
 
 
 
                </div>
 
 
 
 
                </div>
<h1><font face="Verdana">Whether You're a Veteran Marketer Looking for a 
Terrific New Product Range -- or a Newbie marketer Looking for Guidance, this
<br>
Impressive Package is for You!</font></h1>
<p align="left">
<font face="Verdana"><br>
Okay, I'm sure you can see the value of this unique package and the potential it 
represents. Now you want to know how much it's going to cost you.</font></p>
<p align="left"><strong><font face="Verdana">Well, if you were to search the 
Internet and buy all these products <em>individually</em>, you'd pay up to $<span style="BACKGROUND-COLOR: #ffff00">198.00</span><span lang="fr">.</span></font></strong></p>
<p align="left"><font face="Verdana">That's a lot of money. But it's a very fair 
price when you consider the quality and potential of these products.</font></p>
<p align="left"><font face="Verdana">But I'm <b>not</b> going to ask you to pay 
$198.00 for this superb collection. Not even close!</font></p>
<h3 align="left"><strong><small><font face="Verdana"><span style="background-color: yellow">When you
        download The Affiliate X Factor Report, you get the entire Newbie Toolkits Package</span><span
            style="background-color: yellow"><span style="background-color: white"> - all of these great products (including MASTER 
Resale Rights <em>and</em> Plug-n-Go Sales Pages)</span>
            for </span>
<span style="BACKGROUND-COLOR: rgb(255,255,0)">FREE</span>!</font></small></strong></h3>
<p align="left"><font face="Verdana">Yes that's seventeen dollars! About the 
same price as pizza and a movie...for one!</font></p>
<p align="left"><font face="Verdana">And, just in case you're not sure that this 
package is right for you, let me assure you that there is absolutely NO risk 
involved on your part because...</font></div>
            <p align="center"><strong><big>
            <font face="Verdana" color="#000000">
            <big>Your Investment is Backed by My <br>
            </big></font>
            <big><font face="Verdana" color="#FF0000">100% </font><font face="Verdana" color="#ff0000">GUARANTEE</font><font face="Verdana" color="#000000"> 
            of Satisfaction</font></big></big></strong></p>
            <div align="center">
                <table border="1" width="450" id="table128" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" cellpadding="10">
                    <tr>
                        <td style="border: 3px dashed #000000" bgcolor="#FFFFCC"><font face="Verdana">
            <img height="177" alt="Your Investment is 100% Guaranteed" hspace="5" src="images/guarantee.gif" width="110" align="right"></font><font size="3" face="Verdana"><strong>Yes, 
                        you can order the Newbie Toolkits Package in complete confidence.</strong></font><p><font face="Verdana" size="3"><b>You can download 
                        <strong>everything</strong></b><strong> and give it a thorough 
                        once-over. You've got a full
            <font color="#ff0000">2 months</font> to make up your mind if this 
            was the right investment.</strong></font></p>
            <p><font face="Verdana" size="3">And, if you decide it's not for 
            you, no problem. Just let me know and I'll issue a <strong>prompt 
            and courteous refund</strong> - no questions and no quibbles. </font>
            </p>
            <p><font face="Verdana" size="3"><em>AND</em> you can still keep 
            everything!</font></p>
                        </td>
                    </tr>
                </table>
            </div>
            <p><font face="Verdana" color="#000000"><br>
            <b>With a solid guarantee like 
            that, you've literally got nothing to lose and everything to gain.</b><strong>
            </strong></font></p>
            <p><font face="Verdana" color="#000000">So, don't put it off. Grab 
            your copy</font><font face="Verdana"> right now, and judge for 
            yourself just how valuable this package is.<br>
&nbsp;</font></p>
    <font face="Verdana">
            <div align="center">
        <table width="550" height="141" border="1" cellpadding="15" cellspacing="0" bordercolor="#000000"
    style="border: 3px dashed ; border-collapse: collapse" bgcolor="#FBFBFB" id="table129">
<tbody>
      <tr>
        <td height="137">
        <p align="center"><b><font color="#FF00FF">YOUR ORDER LINK HERE</font></b></td>
      </tr>
</tbody>
    </table>
            </div>
    </font>
            <p><br>
            <br>
            <big><big>
            <font color="#d70000" face="Verdana" size="4">
      
      
            <big>
            <font color="#000000" face="Verdana" size="2">
      
      
            <big><small><span style="font-family: Verdana;">
      
      
            <b>
            Here's t<font face="Verdana">o Your Success!</font></p>
 
 
 
      
      
                
 
 
 
       
 
 
 
                
 
 
 
      
 
 
 
            
      
      
            <big><big><small><span style="font-family: Verdana;">
      
      
            <b>
            <font color="#FF00FF" face="Verdana" size="4">
      
      
 
                <p align="left">YOUR NAME/SIG HERE</font></b><font color="#FF00FF" face="Verdana" size="4">
            </font><font color="#000000" face="Verdana" size="4">
            <p align="left"><font size="3"><b>P.S.</b></font></font><font size="3" face="Verdana" color="#000000">
            </font><font color="#000000" face="Verdana" size="3">D<font face="Verdana">on't forget, you can order 
today in total confidence.&nbsp; You can be safe 
in the knowledge that 
your purchase is fully backed by a 
proper, no-nonsense guarantee.&nbsp; </font><b><font face="Verdana">Simply put, you either love the product 
or we will refund your 
payment in full 
up to 60 days from your order.</font></b>
 
 
 
            </font>
 
 
 
      </span> 
 
 
 
                </small></big></big>
 
 
 
            
            <p align="center">&nbsp;
            <p><font face="Verdana" size="2" color="#808080">NOTE: Every effort 
            has been made to accurately represent our product and its potential. 
            Please remember that each individual’s success depends on his or her 
            background, dedication, desire and motivation.&nbsp;As with any business 
            endeavor, there is no certain <em>guarantee</em> that you will earn 
            any money.&nbsp;</font></p>
            <p align="center"><b><font color="#FF00FF">YOUR SUPPORT LINK HERE</font></b><p align="center">&nbsp;</td>
            <td width="25">
            <font face="Verdana">
            <img border="0" src="images/10x10_invisible.gif" width="25" height="10"></font></td>
            <td width="1" bgcolor="#000000" background="images/10x10.gif">
            <font face="Verdana">
            <img border="0" src="images/10x10.gif" width="1" height="100%"></font></td>
        </tr>
        <tr>
            <td width="742" colspan="5" background="images/9-dollar-footer1.gif" height="1" bgcolor="#000000">
            <img border="0" src="images/10x10.gif" width="100%" height="1"></td>
        </tr>
    </table>
    <p><span class="botmenu2">
    <font face="Verdana" style="font-size: 9pt">
    Home&nbsp;
    <font color="#000000">|</font>&nbsp; Earnings Disclaimer&nbsp; 
            |&nbsp; Privacy Policy&nbsp;&nbsp;|&nbsp;
            Terms&nbsp;
    <font color="#000000">|</font>&nbsp;
    Get Support</font></span></p>
    <p>
            &nbsp;</div>
     <p>&nbsp;</p>
     <p>&nbsp;</p>
     <p><span class="style3"><a href="#seconds">See how much time you have left before this special offer expires</a></span></p>
     <p>&nbsp;</p>
     <p class="style7"><a href="http://worldwideinfosource.com" target="_blank">Yes, I Want This Special Offer</a></p>
     <p><strong><a href="http://www.worldwideinfosource.com/affiliate-x-factor-report-bonus/dload8y9yl.html" class="style8">No Thanks, Just Let Me Download My Files </a></strong></p>
     <p>&nbsp;</p>
   </div></div></td>
  </tr>
</table>
<p align="center" class="style3"><a href="http://www.internetmarketingbasics.net/panicoto/index.php?e=webpayments@worldwideinfosource.com" target="_blank" class="style3">Powered By PanicOTO</a> </p>
<p><br>
  <br>
    
 
    <script type="text/javascript" src="oto.js"></script>
    
  <script type="text/javascript">
<!--
 
function finish() {
   window.location = "<?php echo $order ?>";
}
OTO.onEnd = finish;
OTO.start("otoCounter");
 
// -->
    </script>
    
</p>
</body>
</html>
 
Thank You!
Ken