0

Hey.

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:

form.html

<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>

view.php

<?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.

Thanks.

Edited by champmanking

3
Contributors
2
Replies
25
Views
3 Years
Discussion Span
Last Post by yessi_1
-1

now a time i have no display code but in future when i will be got i must share it here..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.