
Untitled
By: a guest on
Jul 14th, 2012 | syntax:
None | size: 0.70 KB | hits: 12 | expires: Never
Delete Image Files From Server
$path = 'UploadedFiles/' . $username . '/' . $locationid . '/';
unlink( $path . $imagename );
unlink( $path . 'Thumbnails/' . $imagename );
$username = str_replace( array( '..', '/', '\', ':' ), '', $username );
$imagename = str_replace( array( '..', '/', '\', ':' ), '', $imagename );
$locationid= str_replace( array( '..', '/', '\', ':' ), '', $locationid );
<form name="deleteImageX" method="GET" target="your.server.org/deleteImage.php">
<input type="hidden" name="userName" value="theUserNameAssociatedWithThePicture" />
<input type="hidden" name="locationId" value="locationOfThePicture" />
<input type="submit" value="delete"/>
</form>