Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

downloading site in php

0 views
Skip to first unread message

Geirgat Jonas

unread,
Apr 8, 2003, 7:30:20 AM4/8/03
to
How can I download or get the source from a webpage in php ?

IS NOT MONITORED! razor-report@daimi.au.dk Rasmus Vedel (OBS: FAKE EMAIL ADDRESS!)

unread,
Apr 8, 2003, 6:29:54 AM4/8/03
to
only by ftp.
That's one of the advantages with php.. You can hide your scripts from
people who shouldn't have access to them, and still let them use the
functionality...

R

--
Due to heavy spam reception (400+/week), I use a fake email. If you want to
write me, you need to use the newsgroup, and hope for me to see it. To all
the spamers in World: Why do you ruin the option of puople writing people???


"Geirgat Jonas" <ke...@sdf-eu.org> wrote in message
news:pan.2003.04.08....@sdf-eu.org...

Andy Jeffries

unread,
Apr 8, 2003, 6:44:06 AM4/8/03
to
On Tue, 08 Apr 2003 12:29:54 +0200, Rasmus Vedel (OBS: FAKE EMAIL ADDRESS!) wrote:
>> How can I download or get the source from a webpage in php ?
>
> only by ftp.
> That's one of the advantages with php.. You can hide your scripts from
> people who shouldn't have access to them, and still let them use the
> functionality...

What he might have meant : "How can I get the HTML for a web page on
another site using PHP on my site"

The answer being www.php.net/fopen

Cheers,


--
Andy Jeffries
Linux/PHP Programmer
http://www.andyjeffries.co.uk/

- Windows Crash HOWTO: compile the code below in VC++ and run it!
main (){for(;;){printf("Hung up\t\b\b\b\b\b\b");}}

Bartosz Ratajczyk

unread,
Apr 8, 2003, 8:32:06 AM4/8/03
to
>>>How can I download or get the source from a webpage in php ?

> What he might have meant : "How can I get the HTML for a web page on


> another site using PHP on my site"
>
> The answer being www.php.net/fopen

or maybe he wanted kind of show_source() vel highlight_file(), but used
on another website ?

--
Bartosz Ratajczyk

Geirgat Jonas

unread,
Apr 8, 2003, 11:35:22 AM4/8/03
to
On Tue, 08 Apr 2003 11:44:06 +0100, Andy Jeffries wrote:

> On Tue, 08 Apr 2003 12:29:54 +0200, Rasmus Vedel (OBS: FAKE EMAIL ADDRESS!) wrote:
>>> How can I download or get the source from a webpage in php ?
>>
>> only by ftp.
>> That's one of the advantages with php.. You can hide your scripts from
>> people who shouldn't have access to them, and still let them use the
>> functionality...
>
> What he might have meant : "How can I get the HTML for a web page on
> another site using PHP on my site"
>
> The answer being www.php.net/fopen
>
> Cheers,

I have use fopen en fgets
now when I use fgets($fd,filesize("http://myurl.com"));
I get an error from filesize (errno=2 - No such file or directory)
I fixed it by filling in 999999 would like to see a better solution to
this probleme
regards Jonas

josh

unread,
Apr 8, 2003, 9:58:00 AM4/8/03
to

> I have use fopen en fgets
> now when I use fgets($fd,filesize("http://myurl.com"));
> I get an error from filesize (errno=2 - No such file or directory)
> I fixed it by filling in 999999 would like to see a better solution to
> this probleme
> regards Jonas
>

You can't do filesize() on a remote file because it's remote. You can't
stat a remote file. Another solution would be

$contents = "";
while (!feof($fd)) {
// here, 4096 is an arbitrary
// number, but it works well for me
$contents .= fgets($fd, 4096);
}

fclose($fd);

0 new messages