hi all,
im uploading some pictures to server, the uploading works just fine but when trying to access the picture for displaying, it show a different path, i’ll paste my script below
[code=php]$now = time();
while(file_exists($uploadFilename = $uploadsDirectory.$now.’-‘.$_FILES[$fieldname][‘name’]))
{
$now++;
}
// now let’s move the file to its final and allocate it with the new filename
@move_uploaded_file($_FILES[$fieldname][‘tmp_name’], $uploadFilename)
or error(‘receiving directory insuffiecient permission’, $uploadForm);
// changing the permissions of the picture to be able to view it
chmod($uploadFilename,0777);
// after successfully uploading the pictures without any errors its time now to update the database
$username = $_SESSION[“logged”];
$image_path = $uploadFilename;
add_photo($username,$image_path);
when i add the path to the table in the database i get the path like this
[B][url]http://starkwi.com/hsphere/local/home/SOMEUSERNAME/starkwi.com/noorbiz/hotornot/uploaded_files/1160857638-cool_glasses.jpg
where it should be like this
[B][url]http://starkwi.com/noorbiz/hotornot/uploaded_files/1160857638-cool_glasses.jpg
any idea why is this happeneing,
thank u for anyhelp