让php旋转脚本工作时遇到问题


Having trouble getting a php rotating script to work

首先,如果这个问题非常基本/多余,很抱歉。我没有php经验,几乎没有编程经验。

基本上,我想做的是利用这里提供的旋转脚本:

http://www.jim.am/rotating-offer-pages-and-landing-pages-in-prosper202/

我遵循了网站上的说明,它们真的很简单——因为我所需要做的就是把他的链接换成我的。

然而,当我点击我的"rotate.php?kw="链接时,它只会转到一个页面,这显然只是一个空白的白色页面。由于某种原因,旋转脚本似乎不起作用。

所以我只是希望更熟悉php的人能浏览一下代码(在上面发布的链接中)。它只有15行代码btw…

谢谢!

编辑:

这是我尝试轮换的链接:

http://test.p2track.com/rotate.php?kw=test123

我的代码如下:

<?php
if ($_GET['kw']) {
$kw = strip_tags($_GET['kw']);
} else { $kw = ‘jimrocks’; }
$landingpages = array(
// paste as many tracking links as you like below
// copy and paste the whole line and put the link between the ‘ and the ‘
‘http://be2canada.struenet.com/RuleLP/?t202id=3109&t202kw=’.$kw,
‘http://be2canada.struenet.com/RegLP/?t202id=8115&t202kw='.$kw,
);
$searchlink = $landingpages[array_rand($landingpages)];
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: $searchlink”);
exit();
?>

好的-我的新代码:

<?php
if ($_GET['kw']) {
$kw = strip_tags($_GET['kw']);
} else { $kw = ‘jimrocks’; }
$landingpages = array(
// paste as many tracking links as you like below
// copy and paste the whole line and put the link between the ‘ and the ‘
'http://be2canada.struenet.com/RuleLP/?t202id=3109&t202kw='.$kw,
'http://be2canada.struenet.com/RegLP/?t202id=8115&t202kw='.$kw,
);
$searchlink = $landingpages[array_rand($landingpages)];
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: $searchlink”);
exit();
?>

php代码中一定有语法错误。

在php脚本的顶部添加以下内容:

error_reporting(E_ALL);
ini_set('display_errors', 1);

然后请提供任何错误消息(如果有)

编辑:对,你的链接中有一个语法错误:

‘http://be2canada.struenet.com/RuleLP/?t202id=3109&t202kw=’.$kw,
‘http://be2canada.struenet.com/RegLP/?t202id=8115&t202kw='.$kw,

将此撇号"更改为:"

'http://be2canada.struenet.com/RuleLP/?t202id=3109&t202kw='.$kw,
'http://be2canada.struenet.com/RegLP/?t202id=8115&t202kw='.$kw,

还将此双引号"更改为:"

header("HTTP/1.1 301 Moved Permanently");
header("Location: $searchlink");

即使是stackoverflow的代码荧光笔也检测到了

相应地将‘’“”更改为''""

看起来像是从某个地方复制粘贴的代码。