[Solved] Rotate Landing Pages in Prosper202  

  RSS

Nicolas
(@maxrey)
New Member
Joined:2 years  ago
Posts: 3
19/11/2016 5:18 am  

Hi,

A query?. I'm moving the landings pages from my old server to this one. And when I upload the script of prosper202 to rotate the landings pages I get the following message:

= count($landingpage)) { $lpNumber = 1; } else { $lpNumber = $lpNumber + 1; } //write to the txt file. $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = $lpNumber . "n"; fwrite($fh, $stringData); fclose($fh); //include the landing page include_once($landingpage[$lpNumber]); //terminate script die(); ?>

The script is on the following page:

http://prosper.tracking202.com/apps/scripts/split-testing-lps.php

The Script:

<?php
//Tracking202 Landing Page Rotation Script

//landing pages filenames, theses will be rotated between each other
//theses landing pages must be in the same DIRECTORY as this file
//you can add as many landing pages here as you like
$landingpage[1] = 'landingpage1.php';
$landingpage[2] = 'landingpage2.php';
$landingpage[3] = 'landingpage3.php';

//this is the text file, which will be stored in the same directory as this file, 
//count.txt needs to be CHMOD to 777, full privlledges, to read and write to it.
$myFile = "count.txt";

//open the txt file
$fh = @fopen($myFile, 'r');
$lpNumber = @fread($fh, 5);
@fclose($fh);

//see which landing page is next in line to be shown.
if ($lpNumber &gt;= count($landingpage)) {
    $lpNumber = 1;
} else {
    $lpNumber = $lpNumber + 1;
}

//write to the txt file.
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $lpNumber . "n";
fwrite($fh, $stringData);
fclose($fh);

//include the landing page
include_once($landingpage[$lpNumber]); 

//terminate script
die();
?>

Do you know that I have to change to make it work or what is the problem?


ReplyQuote
Tharindu
(@tharindu)
Admin
Joined:4 years  ago
Posts: 101
19/11/2016 4:31 pm  

Hi Nicolas,

Where did you see this error? Is it on your Prosper202?

And did you create a new virtual server within Virtualmin or uploaded your landing pages to same virtual server as your Prosper202?

Become a vpsfix.com affiliate and earn up to 10% commissions from your referrals


ReplyQuote
Nicolas
(@maxrey)
New Member
Joined:2 years  ago
Posts: 3
20/11/2016 6:00 am  

Create a new server for a new domain. And migrate the landing pages that had on the old server to this new server.

The landing pages work perfectly. What does not work for me is the rotator.

Example: when I enter

mydomain.com/lp1.php

or

mydomain.com/lp2.php

They work perfect. The problem appears when I want to use the rotator script because when I enter

mydomain.com/rotate.php

I get the following message:

= count($landingpage)) { $lpNumber = 1; } else { $lpNumber = $lpNumber + 1; } //write to the txt file. $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = $lpNumber . "n"; fwrite($fh, $stringData); fclose($fh); //include the landing page include_once($landingpage[$lpNumber]); //terminate script die(); ?>

I've always used this script with no problems. That's why I do not know what is going wrong.


ReplyQuote
Tharindu
(@tharindu)
Admin
Joined:4 years  ago
Posts: 101
20/11/2016 1:24 pm  

Okay, I would like to have a look at it myself. Please PM me URLs to your landing pages and rotator. I'll also need access to the server if they are changed.

Become a vpsfix.com affiliate and earn up to 10% commissions from your referrals


ReplyQuote
Tharindu
(@tharindu)
Admin
Joined:4 years  ago
Posts: 101
21/11/2016 2:47 pm  

Thanks for sending me details Nicolas. I've checked your server and it's working as it should. You seems to have made an error when creating the rotator (index.php). The line #1 of the script is,

<?php

But your index.php file's line #1 is

<?

PHP does not execute that file due to this error.

Become a vpsfix.com affiliate and earn up to 10% commissions from your referrals


ReplyQuote
Nicolas
(@maxrey)
New Member
Joined:2 years  ago
Posts: 3
21/11/2016 10:35 pm  

Thanks Tharindu. Problem solved


ReplyQuote
Share:
Close
  
Working

Please Login or Register