2 Replies - 773 Views - Last Post: 13 March 2011 - 05:23 AM Rate Topic: -----

#1 dangmnx  Icon User is offline

  • D.I.C Regular

Reputation: -1
  • View blog
  • Posts: 428
  • Joined: 10-April 09

Function Error!

Posted 13 March 2011 - 02:57 AM

I'm getting this error.

Quote

Warning: move_uploaded_file(upload/dang Vs balla PvP 21.rep) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/battl375/public_html/1v1_process.php on line 516

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpRa6GNF' to 'upload/dang Vs balla PvP 21.rep' in /home/battl375/public_html/1v1_process.php on line 516


For some reason I can't find a way to fix this, my code is below. Can anyone take a quick glance and tell me if you can identify the problem! thanks!


$query = "UPDATE matches2 SET replay = '".$replay2."' WHERE winner = '".$user."' AND loser = '".$oppname."' AND id = '".$id."'";
$result = mysql_query($query) or die(mysql_error());

move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $repname);
	}
	else
	{
		echo 'you are banned.';
	}
	}
	else
	{
echo "you can't report a game against yourself :o/>";
	}

} //else statement for the file
?>


Is This A Good Question/Topic? 1
  • +

Replies To: Function Error!

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3576
  • View blog
  • Posts: 10,441
  • Joined: 08-June 10

Re: Function Error!

Posted 13 March 2011 - 02:59 AM

as the error message suggests, this is a permission problem which can’t be solved from within PHP. you’d have to correct that on file system level. you probably need to change the permissions of the folder /home/battl375/public_html
Was This Post Helpful? 1
  • +
  • -

#3 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: Function Error!

Posted 13 March 2011 - 05:23 AM

This link might help you changing your folder permission according to your needs:
http://documentation...permissions.htm
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1