sillyrabbi Posted March 15, 2009 Share Posted March 15, 2009 Hi, I'm wondering if it's possible to make so that when a user clicks a link on my site it will take them to another site (that I don't control), but with my header at the top of the page. The best example I can think of is Ask.com (as much as I dislike it as a search engine). If you do a search for something and click on a result, it will take you to the selected page, however if you look at the top you can see the ask.com search bar and you're still technically at "ask.com". Is it possible to accomplish this using php? I don't need/want to do this for every page in the world, I'm just trying to create a webring of blogs, so I'd like to be able to have a header that links to each so long as the user stays within a couple different sites. Any help would be great, I'm afraid I'm a little tired so my wording might be a little sloppy. Thanks! Link to comment https://forums.phpfreaks.com/topic/149499-how-would-i-cause-a-header-to-appear-on-other-sites/ Share on other sites More sharing options...
ejaboneta Posted March 15, 2009 Share Posted March 15, 2009 Ask.com uses iframes to get the result to load under their site. If you notice the title of the page and the url are not of the search result. With php you could do something like <a href="http://yoursite.com?url=http://blogurl.com">Link</a> and on the display page <iframe src="<?php echo $url; ?>"> Link to comment https://forums.phpfreaks.com/topic/149499-how-would-i-cause-a-header-to-appear-on-other-sites/#findComment-785101 Share on other sites More sharing options...
ram4nd Posted March 15, 2009 Share Posted March 15, 2009 <iframe src="<?php echo $url; ?>"> You wanted to write: <iframe src="<?php echo $_GET["$url"]; ?>"> Link to comment https://forums.phpfreaks.com/topic/149499-how-would-i-cause-a-header-to-appear-on-other-sites/#findComment-785102 Share on other sites More sharing options...
ejaboneta Posted March 15, 2009 Share Posted March 15, 2009 Yea... thats right... but it works for me. I've been told it shouldn't but my site works fine without the $_GET... Link to comment https://forums.phpfreaks.com/topic/149499-how-would-i-cause-a-header-to-appear-on-other-sites/#findComment-785107 Share on other sites More sharing options...
thebadbad Posted March 15, 2009 Share Posted March 15, 2009 Yea... thats right... but it works for me. I've been told it shouldn't but my site works fine without the $_GET... Sorry to go off topic, but: That's because you've got register_globals turned on. It's been off by default since PHP 4.2.0 released 7 years ago, and is highly discouraged to have turned on. Read my link, and then turn it off for your own good! Link to comment https://forums.phpfreaks.com/topic/149499-how-would-i-cause-a-header-to-appear-on-other-sites/#findComment-785166 Share on other sites More sharing options...
sillyrabbi Posted March 16, 2009 Author Share Posted March 16, 2009 Awesome, that works almost perfectly (except that $_GET["$url"]; shouldn't have the second dollar sign) Anyway I'm now wondering if it's possible to scale the iframe to 100% of the source file's height. (so I can just use the normal scrollbar instead of having two) I should probably also mention that the source file is not on my domain, it's a blog hosted by livejournal. I've spent about 2 hours googling this and there's a few solutions but none of them seem to work. It probably doesn't help that a fair amount were posted in 2003 or so though. Link to comment https://forums.phpfreaks.com/topic/149499-how-would-i-cause-a-header-to-appear-on-other-sites/#findComment-785577 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.