开发者

How to hide url in php?

I am working on site in the php. In this site i have 10 screen shot images with herf tag. When a user click on any image, there should open a new tab with that site but actually showing the url of my site. Eg : if my site is www.abc.com From this site user will redirected to www.xyz.com. But the url above should www.abc.com. It will shows all the functionality of xyz.com si开发者_Go百科te. If anybody knows, plz help me. I have seen that type of functionality somewhere before.


You could do that with a full iFrame, however that's really not the thing you want to do unless absolutely necessary.


The iFrame solution is very simple and maybe the best one for your problem.

But just to provide another possibility: You could implement a sort of web proxy with the PHP function file_get_contents. If you do something like that, you eventually have to deal with streams to preserve the context (COOKIES, etc.).

Finally you will have your own URL (maybe rewritten, to look nice), where the content of the other website is shown (but without correct ajax calls and maybe other issues).


You could use an iframe... or maybe .htaccess file will do what you need..?


If I get you right you want to change the browser's adressbar content? You can't do that. I've found this on stackoverflow:

Modify the URL without reloading the page

Use full screen iframe:

<html>
<head>
<title>full screen iframe</title>
<style type="text/css">
/* Full Screen The Page Fix*/
body { margin: 0; }
</style>
</head>
<body>
<iframe src=".../site.html" style="border: 0; width: 100%; height: 100%">Your browser doesn't support iFrames.</iframe>
</body>
</html>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜