我正在尝试将一个页面重定向到另一个页面,这一步骤已经成功完成。但是,我想将第一个页面重定向到另一个带有广告的页面。该页面将在五秒钟后重定向到另一个页面。
我是通过以下方式实现的:
<?php
include('ads.php');
?>
<?php
sleep(2);
$url = $_GET['url'];
header("Location: ".$url."");
exit;
?>
然而,广告在
ads.php
中完美地显示出来,但是五秒后没有重定向。我在我的Web浏览器中收到了这个错误消息:Warning: Cannot modify header information - headers already sent by
(output started at /home/nucleusi/public_html/adverts/ads.php:1)
in /home/nucleusi/public_html/adverts/index.php on line 7
一般我需要重定向的链接是这样的:
http://domain.com/adverts/index.php/?url=http%3A%2F%2Fitunes.apple.com%2Fmx%2Falbum%2Fstill-got-the-blues%2Fid14135178%3Fi%3D14135158
该链接涉及IT技术。