首先,如果这个问题非常基本/多余,很抱歉。我没有php经验,也几乎没有编程经验。
基本上,我要做的就是利用这里提供的一个循环脚本:
http://www.jim.am/rotating-offer-pages-and-landing-pages-in-prosper202/
我遵循了网站上的说明,它们真的很简单-因为我所需要做的就是把他的链接换成我的。
然而,当我点击我的"rotate.php?kw=“链接时,它只会跳转到一个显然只是一个空白页面的页面。由于某些原因,旋转脚本似乎无法正常工作。
所以我只希望更熟悉php的人能浏览一下代码(在上面的链接中)。它只有15行代码...
谢谢!
编辑:
这是我尝试轮换的链接:
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();
?>OK -我的新代码:
<?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();
?>发布于 2013-07-05 15:28:11
一定是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,同时将此双引号更改为“this:”
header("HTTP/1.1 301 Moved Permanently");
header("Location: $searchlink");甚至stackoverflow的代码加亮器也检测到了它
发布于 2013-07-05 15:48:08
相应地将‘’和“”更改为''或""。
看起来像是某个地方的代码复制粘贴。
https://stackoverflow.com/questions/17483292
复制相似问题