PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a small problem here. I have the address of the image on the web such as "<img src = "http://abc.com/testing4jh3e.jpg".
I managed to extract the address of the image src as it is constantly changing. However, I wish to be able to download the image using php in to my web server root directoy so that I can use php again to process the image such as resize etc...I tried file functions an image functions but due to the fact that I am still a newbie, I am not able to comprehend how it works...Thus requesting advice from you guys.....
provided you have permission to pull the image from their server, file_get_contents() can often be used to retrieve the file's binary data. file_put_contents() or a combination of fopen()-fwrite()-close() can write the file to your server.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="feyd"]provided you have permission to pull the image from their server, [url=http://php.net/function.file_get_contents]file_get_contents()[/url] can often be used to retrieve the file's binary data. [url=http://php.net/function.file_put_contents]file_put_contents()[/url] or a combination of [url=http://php.net/function.fopen]fopen()[/url]-[url=http://php.net/function.fwrite]fwrite()[/url]-close() can write the file to your server.[/quote]
Can you provide me an example? Thanks. However, here is my code:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]