bhb Posted December 12, 2008 Share Posted December 12, 2008 I've been trying to write a script that prints all .jpg images (and nothing else) from a given site's URL. But I don't know how to write a script that reads all http://*****.jpg to $imgurls[] table I need to use preg_match_all() (right?) but how? Link to comment https://forums.phpfreaks.com/topic/136710-print-images-from-another-site/ Share on other sites More sharing options...
gevans Posted December 12, 2008 Share Posted December 12, 2008 Sounds like a job for JavaScript and the DOM Link to comment https://forums.phpfreaks.com/topic/136710-print-images-from-another-site/#findComment-713896 Share on other sites More sharing options...
bhb Posted December 12, 2008 Author Share Posted December 12, 2008 I clarify little bit: The script should search all .jpg images from given site. example http:/example.com/site.php <html> <body> Image 1 <img src="http://images.com/image5.jpg" alt="image5"> <br> Image 2 <img src="http://pictures.com/pic5.jpg" alt="picture"> <br> Image 3 (PNG) <img src="http://imagehost.net/image.png"> </body> </html> and script should print: <img src="http://images.com/image5.jpg"> <br> <img src="http://pictures.com/pic5.jpg"> Link to comment https://forums.phpfreaks.com/topic/136710-print-images-from-another-site/#findComment-713942 Share on other sites More sharing options...
gevans Posted December 12, 2008 Share Posted December 12, 2008 Yup, sounds like a job for JavaScript and the DOM Link to comment https://forums.phpfreaks.com/topic/136710-print-images-from-another-site/#findComment-713945 Share on other sites More sharing options...
bhb Posted December 13, 2008 Author Share Posted December 13, 2008 no, no, no... it sounds like PHP. The PHP script should be little like on this site http://file2hd.com/ but it should only search from the html page, not from linked css files Link to comment https://forums.phpfreaks.com/topic/136710-print-images-from-another-site/#findComment-714624 Share on other sites More sharing options...
DarkWater Posted December 13, 2008 Share Posted December 13, 2008 no, no, no... it sounds like PHP. The PHP script should be little like on this site http://file2hd.com/ but it should only search from the html page, not from linked css files Okay, well it would certainly be EASIER with Javascript. If you really want to do this with PHP, go look up regular expression syntax. There's a tutorial on the main page of this site. Link to comment https://forums.phpfreaks.com/topic/136710-print-images-from-another-site/#findComment-714629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.