I'm sorry, but in the previuos email there has been an error. I'm sending correct one. ----- For the images that contain "http://" my program is already able to get them from the web server. In other cases, I have to determine the name of the directory where the html page is located. Thus, the equivocal paths are the problem, for example:
www.php.net/manual/it/index.php www.php.net/manual/it/ www.php.net/manual/it The reply of the server web is the same in the three cases. The input of the my program could be any paths between the mentioned ones. I need to poll out the path www.php.net/manual/it/ Best regards. Andrea ----- Original Message ----- From: "Andrea Tricco" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Wednesday, September 17, 2003 1:11 PM Subject: Re: [PHP] caching program > For the images that don't contain "http://" my program is already able to > get them from the web server. > In other cases, I have to determine the name of the directory where the html > page is located. > Thus, the equivocal paths are the problem, for example: > > www.php.net/manual/it/index.php > > www.php.net/manual/it/ > > www.php.net/manual/it > > The reply of the server web is the same in the three cases. > The input of the my program could be any paths between the mentioned ones. I > need to poll out the path www.php.net/manual/it/ > > Best regards. > Andrea > > > ----- Original Message ----- > From: "Ryan Gibson" <[EMAIL PROTECTED]> > To: "Andrea Tricco" <[EMAIL PROTECTED]>; "php-general" > <[EMAIL PROTECTED]> > Sent: Friday, September 12, 2003 12:26 PM > Subject: Re: [PHP] caching program > > > > You could pull out all the img src attributes and if they don't contain > > "http://" then prepeand the address of te page then download otherwise > just > > downlocad the url, but to get the page to work in the new location you may > > have to replace the img src attributes > > > > Ryan Gibson > > ----------- > > [EMAIL PROTECTED] > > > > On 17/9/03 11:16 am, "Andrea Tricco" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I'm using the function "file_get_contents()" to replicate the content of > a > > > remote html page on my server. > > > But, the function file_get_contents() works even when the name of the > file > > > is not specified. For example: > > > > > > "http://www.php.net" rather that "http://php.net/index.php" > > > > > > Does a method exist to know the name of the file received form web > server? > > > > > > I would like to write a program that automatically downloads the images > > > inserted into a html page. > > > For this reason, I need to determine the paths of the images in order to > get > > > them from the web server. > > > In other words, my program should work as the "Save as" function (File > menu) > > > of any Web browser. > > > > > > Can anybody help me? > > > > > > Best regards. > > > Andrea > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php