Web Hosting Talk







View Full Version : How to print image from a form


DTN
12-09-2005, 11:21 PM
hey guys, I was looking for a form that allowed to insert the image's url in the input box then use echo variable on a page that want to print image

I've used the following code but doesn't work.

<form action="" method="POST">
<input type="submit" name="Submit" value="Submit">
<input type="text" name="URL">
</form>

<?php echo htmlentities($_POST['URL']); ?>

Thanks

In another word, i want display an image based on form input (http://www.example.com/logo.gif)

alx77
12-10-2005, 03:20 AM
<?php echo '<img src="' . $_POST['URL'] . '">'; ?>

Burhan
12-10-2005, 09:28 AM
You know you can cause a lot of objectionable material to be shown on your site this way.

For example, someone could submit http://www.somebadsite.com/images/badimage.gif