HI ALL,
am trying to code a page wher users can upload images using the code below, but I keep getting blank page, what could be the problem.
<?php
$uploadDir = 'httpdocs/images';
$fileName = $FILES['bin_data']['name'];
$tmpName = $FILES['bin_data']['tmp_name'];
// get the file extension first
$ext = substr(strrchr($fileName, "."), 1);
// make the random file name
$randName = md5(rand() * time());
// and now we have the unique file name for the upload file
$filePath = $uploadDir . $randName . '.' . $ext;
$result = move_uploaded_file($tmpName, $filePath);
if (!$result) {
echo "Error uploading file";
exit;
}
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
$filePath = addslashes($filePath);
}
echo "<br>Files uploaded<br>";
?>