Hi Mate,
i tried making a function for it:
PHP Code:
<?php
## watermark function
watermark_image($filename,$uploaddirectory);
?>
This passes the $filename of the uploaded file to get the extension
function:
PHP Code:
<?php
function watermark_image($filename,$uploaddirectory) {
## Using GD
## Find out the files extension
$extension = explode(".", $filename);
$extension = $extension[count($extension)-1];
## Make all filenames lowercase
$extension = strtolower($extension);
## Generate image accordingly
if($extension == "jpg" || $extension == "jpeg" || $extension == "pjpeg") {
$image = imagecreatefromjpeg($uploaddirectory);
} elseif($extension == "png") {
$image = imagecreatefrompng($uploaddirectory);
} elseif($extension == "gif") {
$image = imagecreatefromgif($uploaddirectory);
}
$white = imagecolorallocate($image, 255, 255, 255);
imagestring($image, 3, 5, imagesy($image)-20, 'www.site.com', $white);
echo $extension;
}
?>
this all looks ok , but when i test it, it just uploads without any errors (but doesn't overlay the text) so theres no errors to speak of, if i echo out the extension it's fine
can you see any errors at all?
thanks mate
Graham