创建一个php代理页面 [英] create a php proxy page

查看:156
本文介绍了创建一个php代理页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来加载php代理页面内的网站的全功能副本,以便能够抓取和更改其部分元素和样式。

I'm looking for a way to load a full-functional copy of a web site inside a php proxy page in order to be able to grab and change part of its elements and styles.

我决定发布这个问题,将我之前的两个合并成一个更相关的演变:

更改任何网站可视化属性

加载外部网站并更改其可视化

我发现 cURL 函数用于加载页面(例如 www.google.it ; for google.com 我收到了 302重定向,但我现在不会面对)。

某些页面元素(如图像徽标)未正确加载;这应该是由于原来的相对路径到站点资源。我必须手动添加 // google.it ,然后才能修复,并且它工作。

I have found cURL functions useful to load the page (eg. www.google.it; for google.com I received a 302 redirection, but I won't face it now).
Some of the page elements, like the image logo, are not properly loaded; this should be due to the original relative path to the site resources. I have to manually add "//google.it" before them to fix, and it worked.

我有另一个问题:

如何在网站导航中进一步?

当我点击任何链接时,该页面将重新加载其真实目标。我想我必须重新加载我的PHP,并使用href链接属性作为url加载(我可以这样做)。

但是提交按钮呢?如何重定向目标?

Now I have another issue:
How is it possible to go further in the site navigation?
When I click any link the page is reloaded with its "real" destination. I suppose I have to reload my php and use the href link attribute as url to load (I can do that).
But what about the submit buttons? How can I redirect their destination?

推荐答案

使用现有代理

一般来说,您必须找到所有与旧网域名称相符的字串,并将它们改成网址,这样网页上的每个连结都会从 www.bla.com/page.htm 转换为 proxy.com/page.htm

Generally you'll have to just find all the strings matching the old domain name and change them into your url, so every link on the page will turn from being www.bla.com/page.htm into proxy.com/page.htm.

这也需要一些服务器设置,因为可能的ajax请求和相对路径。此外,超硬将是捕获动态构造的URL,例如: var add r ='b'+'la.com';

This will also require some server setup thanks to possible ajax requests and relative paths. Besides, super hard would be to catch dynamically constructed url's such as: var add r = 'b'+'la.com';

这篇关于创建一个php代理页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆