By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,044 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,044 IT Pros & Developers. It's quick & easy.

html page from different server

P: n/a
Is there a way to embed html page from different server into another
html page without using javascript ?

Dec 4 '06 #1
Share this Question
Share on Google+
15 Replies


P: n/a
de********@gmail.com wrote:
Is there a way to embed html page from different server into another
html page without using javascript ?

http://msdn.microsoft.com/workshop/a...cts/iframe.asp

---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of it!)
$FA
Dec 4 '06 #2

P: n/a
demiourgos wrote:
Is there a way to embed html page from different server into another
html page without using javascript ?
PHP's include() function, or similar function in almost any other
server-side scripting language.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Dec 4 '06 #3

P: n/a
wrote on 04 dec 2006 in comp.lang.javascript:
Is there a way to embed html page from different server into another
html page without using javascript ?
This is off topic, isn't it?

But yes, you could use any other program language available,
like VBS in IE, or any serverside language, ASP-VBS, PHP.

Even serverside JS can do that, but you stipulated against that.

Please ask in a relevant NG.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 4 '06 #4

P: n/a
Evertjan. wrote on 05 dec 2006 in comp.lang.javascript:
wrote on 04 dec 2006 in comp.lang.javascript:
>Is there a way to embed html page from different server into another
html page without using javascript ?

This is off topic, isn't it?

But yes, you could use any other program language available,
like VBS in IE, or any serverside language, ASP-VBS, PHP.

Even serverside JS can do that, but you stipulated against that.

Please ask in a relevant NG.
Oh yes, you can use <iframe>.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 4 '06 #5

P: n/a
In alt.html, de********@gmail.com wrote:
Is there a way to embed html page from different server into another
html page without using javascript ?
Nobody asked the question.

Are they both your pages?

--
-bts
-This message has been tested for polonium-210 and found to be safe
Dec 5 '06 #6

P: n/a

de********@gmail.com wrote:
Is there a way to embed html page from different server into another
html page without using javascript ?
Frame or <iframe- client-side only.

Can't use server-side stuff or SSI if it's on a different server.

You _could_ cache a copy on the server, then use server-side
techniques, but if you knew how to do that, you'd be telling us how to
do it instead.

All of these can be legally dubious if you're doing it to someone
else's content.

Dec 5 '06 #7

P: n/a
Andy Dingley wrote:
Can't use server-side stuff or SSI if it's on a different server.
Can!

include("http://www.google.com/");

works nicely in PHP.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Dec 5 '06 #8

P: n/a
In article <rn************@ophelia.g5n.co.uk>,
Toby Inkster <us**********@tobyinkster.co.ukwrote:
Andy Dingley wrote:
Can't use server-side stuff or SSI if it's on a different server.

Can!

include("http://www.google.com/");

works nicely in PHP.
Not a very good idea though.

From <http://www.google.com/intl/en/terms_of_service.html>:
>You may not take the results from a Google search and reformat and
display them, or mirror the Google home page or results pages on
your Web site.
--
If you really must contact me by email, visit
http://rumkin.com/tools/compression/base64.php
and decode the following string of characters:
RW1haWw6IHBoaWxyb25hbkBibHVleW9uZGVyLmNvLnVr
Dec 5 '06 #9

P: n/a
Philip Ronan wrote:
In article <rn************@ophelia.g5n.co.uk>,
Toby Inkster <us**********@tobyinkster.co.ukwrote:
>Andy Dingley wrote:
>>Can't use server-side stuff or SSI if it's on a different server.
Can!

include("http://www.google.com/");

works nicely in PHP.

Not a very good idea though.

From <http://www.google.com/intl/en/terms_of_service.html>:
>>You may not take the results from a Google search and reformat and
display them, or mirror the Google home page or results pages on
your Web site.
Sure, but Toby was just show that it *can* be done not whether or not it
*should* be done. It has been mentioned in this thread grabbing content
without permission was a bad idea. With permission it is not a problem.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Dec 5 '06 #10

P: n/a
Jonathan N. Little wrote:
Philip Ronan wrote:
>In article <rn************@ophelia.g5n.co.uk>,
Toby Inkster <us**********@tobyinkster.co.ukwrote:
>>Andy Dingley wrote:

Can't use server-side stuff or SSI if it's on a different server.
Can!

include("http://www.google.com/");

works nicely in PHP.

Not a very good idea though.

From <http://www.google.com/intl/en/terms_of_service.html>:
>>>You may not take the results from a Google search and reformat and
display them, or mirror the Google home page or results pages on
your Web site.
Sure, but Toby was just show that it *can* be done not whether or not it
*should* be done. It has been mentioned in this thread grabbing content
without permission was a bad idea. With permission it is not a problem.
I think it's a problem as well, that the page source looks like this:

<html><head><title>blaa blaa-page</title></head><body>
<h1>Lorem ipsum dolor sit amet</h1>
<p>bit of blaa blaa blaa</p>
<html><head><title>Google</title>
<!-- lots of blaablaa here -->
</head><body>
<!-- more blaablaa here -->
</body></html>
<p>and yet some blaa blaa</p>
</body></html>

Or is it not?

Olli
Dec 5 '06 #11

P: n/a
Olli Mäntyranta <ol*****@gmail.comwrote:
news: Av**************@reader1.news.saunalahti.fi
Jonathan N. Little wrote:
>Philip Ronan wrote:
>>In article <rn************@ophelia.g5n.co.uk>,
Toby Inkster <us**********@tobyinkster.co.ukwrote:

Andy Dingley wrote:

Can't use server-side stuff or SSI if it's on a different server.
Can!

include("http://www.google.com/");

works nicely in PHP.

Not a very good idea though.
[snip]
I think it's a problem as well, that the page source looks like this:

<html><head><title>blaa blaa-page</title></head><body>
<h1>Lorem ipsum dolor sit amet</h1>
<p>bit of blaa blaa blaa</p>
<html><head><title>Google</title>
<!-- lots of blaablaa here -->
</head><body>
<!-- more blaablaa here -->
</body></html>
<p>and yet some blaa blaa</p>
</body></html>

Or is it not?
It does not need to be a problem.
<?
/* Get the body content of a page */
$page=file_get_contents('http://www.google.com/');
$bodycontent=preg_split("/([<]body[^>]*>|<\/body>)/", $page);
print $bodycontent[1];
?>

--
BootNic Tuesday, December 05, 2006 10:16 AM

"No man's life, liberty, or property is safe while the legislature is
in session."
*Judge Gideon J. Tucker, 1866.*
Dec 5 '06 #12

P: n/a

Toby Inkster wrote:
Andy Dingley wrote:
Can't use server-side stuff or SSI if it's on a different server.

Can!

include("http://www.google.com/");
works nicely in PHP.
For unusably small values of "nicely".

This technique is crap, don't ever use it on a live site. It's
symptomatic of PHP's worst feature, the attitude that if it can be
bodged on, it ought to be. Then the horde of clueless script kiddies
that represent the majority of PHP developers see the feature and use
it blindly.

Firstly, there's the rights issue (big deal).

Secondly, most of the things served by HTTP URLs are HTML pages -- i.e.
Whole pages, with <headetc, not just the small fragment you want to
embed.

Thirdly it's unreliable. What happens if the source server for this
include is down (or just slow)? The whole page dies, because there's no
caching mechanism.

Fouthly it's as slow as a dog because it involves extra round tripping
between servers.

Most importantly though, it's as unsafe and insecure as a Macclesfield
knocking shop with a MySpace website. PHP doesn't include HTML by this
route, it includes _PHP_scripts_. That's right - slurp up a random
fragment of PHP from feck knows where, then go and execute the damned
thing! Maybe you expect to just be pulling in some plain old HTML by
this route, but if someone sticks nasty-intentioned PHP into there,
you're already bending right over, lubed and ready.

_REALLY_ don't ever even think about using this total abomination. It's
crap like this that is the reason I won't give PHP house room.

Dec 5 '06 #13

P: n/a
Andy Dingley wrote:
For unusably small values of "nicely".
OK, so it's unlikely you'd want to do exactly what I posted as an example.
More likely, you'd have PHP download a copy of the file, cache it, and
probably parse and reformat it. That however, doesn't work so nicely in a
three-line post.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Dec 5 '06 #14

P: n/a

Toby Inkster wrote:
Andy Dingley wrote:
For unusably small values of "nicely".

OK, so it's unlikely you'd want to do exactly what I posted as an example.
I wouldn't ever want to do anything that involved PHP's include() and a
URL
More likely, you'd have PHP download a copy of the file, cache it, and
probably parse and reformat it.
Yes, that's the level of trouble you'd have to go to. It wouldn't use
include() anywhere.

For almost all rational purposes involving content aggregation across
servers, then RSS is the sensible way to go.

Dec 6 '06 #15

P: n/a
Olli Mäntyranta wrote:
Jonathan N. Little wrote:
>Philip Ronan wrote:
>>In article <rn************@ophelia.g5n.co.uk>,
Toby Inkster <us**********@tobyinkster.co.ukwrote:

Andy Dingley wrote:

Can't use server-side stuff or SSI if it's on a different server.
Can!

include("http://www.google.com/");

works nicely in PHP.

[...]
[...]

I think it's a problem as well, that the page source looks like this:

<html><head><title>blaa blaa-page</title></head><body>
<h1>Lorem ipsum dolor sit amet</h1>
<p>bit of blaa blaa blaa</p>
<html><head><title>Google</title>
<!-- lots of blaablaa here -->
</head><body>
<!-- more blaablaa here -->
</body></html>
<p>and yet some blaa blaa</p>
</body></html>

Or is it not?
You can (use Regular Expressions to) filter out the body element's content
of the included document.
PointedEars
--
The German psychs, the German authorities, the German secret service agents
are [...] fanatics, they are insane and known of persecuting innocent people
and Scientologists. -- "The only real Barbara Schwarz", dsw.scientology,
<16**************************@posting.google.com >
Dec 9 '06 #16

This discussion thread is closed

Replies have been disabled for this discussion.