This might be a stupid question

LenBradshaw's picture

He has: 36 posts

Joined: Nov 2006

Hi All:

Great forum, isn't it? I have a question that might be very rudimentary, but it also might not be possible to answer:

I want to be able to click a link on the webpage found on one domain and have it open a webpage that is located under a different domain name. I don't, however, want the browser to display the new location and domain name. For example, I open a page on "mysite.com" and click a link that opens a page on "yoursite.com." I want the browser to appear as though it's still on "mysite.com." Is there a way to do that?

Thanks!

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

You could do it with a frame. Just have a very, very small frame at the top (your website) and have a big frame below it (the other site).

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

Or if you use a scripting language (like PHP), you can use the curl functions to grab the page and display it and process it as your own.

Please note, IMO this should only be done if you have "yoursite.com"'s permission Also if the other site bases content on the browser using the site, this could be affected (becasue a browser is't actually visiting their site)

-Greg

LenBradshaw's picture

He has: 36 posts

Joined: Nov 2006

Thanks to you both for your responses. That tells me that what I want to do can be done. I'm not quite sure how to do it with a frame (can you elaborate a little more?) And PHP is a little foreign to me as well.

FYI (just to add to the confusion) in this case "MySite" is actually a client's site. "YourSite" is actually my own site. I want to store files on my site that are called up on my client's site so that it appears as though the files are on my client's domain.

That being said, thanks again for your help.

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

You'd probably want to use PHP for that. On your site, make the file you want, but do not include stuff like etc, just the content and other html codes you want displayed on the client's site. And then on the client's site, all you have to do is put a little PHP code on it.

<!-- on your client's website -->
<html>
<head>
<title>This is a clien'ts website</title>
</head>
<body>
<p>you are allowed to add html code here if you want</p>
<?php include ('http://www.yourwebsite.com/the_page_you_want_to_display.html'); ?>
<p>above is where that page hosted on your website would appear</p>
</body>
</html>
'

But PHP must be enabled on your client's server, and the file extension of your client's page must be .php (no .html, htm, etc).

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.