Jump to content

[SOLVED] delete an image


jakebur01

Recommended Posts

Yes you can, however your syntax has more bugs than the amazon basin. Here:

<?php
echo "<a href=\"view_images.php?delete=".urlencode($file)."\">delete image</a>";

if(strlen($_GET['delete'])) {
	$delete_image = "c:/images/".urldecode($_GET['delete']);
	unlink($delete_image);
}
?>

Does ini_set ("display_errors", "1");

error_reporting(E_ALL); log errors when someone is trying to inject stuff into url?

 

How will you know when they are trying to do that? Isn't that what that is for? I read a little bit on ini_set ("display_errors", "1");

error_reporting(E_ALL); but I was having trouble understanding exactly how it works.

 

- Jake

Ha Ha.... my head way starting to get foggy and his footer looked as though it were part of the post.

 

Sorry....

 

Thank you for all your help. It is working great now.

 

Hehe, yeah I leave it there cause I reference it a lot. 

 

Did you get errors when you added that in your code?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.