Home  >  Article  >  Backend Development  >  帮小弟我看下这段代码

帮小弟我看下这段代码

WBOY
WBOYOriginal
2016-06-13 10:17:111345browse

帮我看下这段代码
JUMP.PHP

class Jump_Controller extends Base_Controller {

public function __construct() {
parent::__construct();
}

public function index() {
$url = $this->input->get('url');
$this->assignData();
$this->output->set('url', $url);
$this->output->display('jump.html');
}

public function top() {
$this->assignData();
$this->output->display('jump-top.html');
}
}

跳转时候,浏览器分成两栏,上面是原网站的LOGO和BANNER,下面是跳转的网站

是不是把这段去掉
public function top() {
$this->assignData();
$this->output->display('jump-top.html');
}
但好像也没什么变化

实例网站 www.yangyanb.com 上的推荐图集的那个杜蕾斯的广告,点击后跳到淘宝页面了,但只有一半,上面还是原网站的。

------解决方案--------------------
闪了一下又回来了。
------解决方案--------------------
从你说的情况来看,建议你去检查一下jump.html或相关的比如主框架的模板文件,很有可能是存在frameset之类的东东,如果是这样的话,应该是在框架处理上存在一些机制问题。应该不属于php代码范畴,看看关于html方面的东西也许会帮你解决问题。
------解决方案--------------------
那个杜蕾斯的广告 的连接是指向你自己的 index.php 的
你是通过输出抓取到的相关页面来实现“跳转”的吧?
淘宝页面是一个框架结构,你把它的 HTML 代码直接放在你的页面中时就会产生冲突。处理这个冲突的方式,对于不同的浏览器时不同的。所以看到的表现也不同

如果你是想离开 www.yangyanb.com 进入淘宝
应在进入 index.php 后发 loction 头跳转。记住 header 后要有 exit

如果你是想把对方的内容嵌入在你的页面中
应在你的页面中放一个 iframe 作为载体

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn