I need help coding a php script that receives a URL from a form then displays all the images(jpeg, png and gif) from that webpage. I don't need to images to be saved.
This is what I already have:
<html> <head> </head> <body> <div id="form"> <form action="view.php" method="get"> <input type="text" name="url"> <input type="submit" value="View Images"> </form> </div> </body> </html>
<?php // get url from form $url = $_GET["url"]; // get contents from url $content = file_get_contents($url); // finally display images echo $images; ?>
How do I go about coding the rest? What functions do you suggest? Any pseudocode or actual code would be helpful.
Don't worry about checking for errors or adding security measures as it's for personal use on localhost.