I just dont know whats wrong, heres the warning
Warning: move_uploaded_file(uploads/step6small.png) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/xphic/public_html/index.php on line 81
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpU8rYa0' to 'uploads/step6small.png' in /home/xphic/public_html/index.php on line 81
heres the code
PHP Code:
<?
include('config.php');
include('design/header.php');
if (isset($_SESSION['loggedin']) == "256"){
include('design/navigation-in.php');
} else {
include('design/navigation-out.php');
}
?>
<h2 id="upload">Upload an image; Browse for your image, then click upload!</h2>
<div id="content">
<?
### No form was posted, show upload form
include('uploadform.htm');
if ($HTTP_POST_VARS['submit']) {
### Form has been posted
if (isset($_SESSION['loggedin']) == "256"){
$username = mysql_real_escape_string($_SESSION['username']);
$password = mysql_real_escape_string($_SESSION['password']);
$getfilesize = mysql_query("SELECT * FROM sizerestrictions WHERE usergroup = 'members'");
while($v = mysql_fetch_array($getfilesize)){
$maxfilesize = $v['limit'];
$getmemberfile = mysql_query("SELECT * FROM members WHERE username = '".$username."' && password = '".$password."'");
while($f = mysql_fetch_array($getmemberfile)){
$uploaddir = "uploads/".$f['directory'];
}
}
} else {
/////$getfilesize = mysql_query("SELECT * FROM sizerestrictions WHERE usergroup = 'guests'");
/////while($v = mysql_fetch_array($getfilesize)){
/////$maxfilesize = $v['limit'];
$uploaddir = $originaldir;
/////}
}
if ($HTTP_POST_FILES['file']['size'] < $maxfilesize){
### File under max file size
$rand = rand(1,9999);
if ($HTTP_POST_FILES['file']['type'] == "image/jpeg" || $HTTP_POST_FILES['file']['type'] == "image/pjpeg" || $HTTP_POST_FILES['file']['type'] == "image/gif" || $HTTP_POST_FILES['file']['type'] == "image/png"){
### File is JPG, JPEG, PNG or GIF
if (is_file($uploaddir."/".$_FILES['file']['name'])){
### File already exists, rename and upload
$newfile = $rand.strtolower($_FILES['file']['name']);
move_uploaded_file($_FILES['file']['tmp_name'],"".$uploaddir."/".$newfile);
$error = "0";
} else {
### One of a kind file, upload
$newfile = $_FILES['file']['name'];
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir."/".$_FILES['file']['name']);
$error = "0";
}
### Success, file was uploaded
include('success.php');
} else {
### File does not match allowed types
$error = "Your file is not an acceptable file type";
}
} else {
### File to large
$error = "Your file is too large";
}
}
if ($error !== "0"){
### If error is present, display
print "<h4 class='error' style='margin-top: 10px'>".$error."</h4>";
}
include('ad.php');
include('design/footer.php');
?>