Jump to content


Photo

uploading images,says access is denied


  • Please log in to reply
3 replies to this topic

#1 kikilahooch

kikilahooch
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts

Posted 03 September 2006 - 06:33 PM

I'm trying to upload images into my database, along with data on them. The values including the image name are being stored in the db but the image is not uploading. I have used the exact same code before but with a different hosting company. The message I am getting is:


Warning: move_uploaded_file(/home/groover/public_html/images/pure.jpg): failed to open stream: Permission denied in /home/groover/public_html/admin_insert.php on line 54

Warning: move_uploaded_file(): Unable to move '/tmp/phpudG2GY' to '/home/groover/public_html/images/pure.jpg' in /home/groover/public_html/admin_insert.php on line 54

Any idea what would cause this error??

<?php
//check for required fields from the form
if ((!$_POST[uname]) || (!$_POST[pword])) {
	header("Location: adminlogin.html");
	exit;
}

//connect to server and select database
$conn = mysql_connect("localhost", "groover", "dwde909") or die(mysql_error());
mysql_select_db("groover_walshy",$conn) or die(mysql_error());

//create and issue the query
$sql = "select *from admin where uname = '$_POST[uname]' AND pword = '$_POST[pword]'";
$result = mysql_query($sql,$conn) or die(mysql_error());

//get the number of rows in the result set; should be 1 if a match
if (mysql_num_rows($result) == 1) {

	//if authorized, get the values of fname lname
	$fname = mysql_result($result, 0, 'fname');
	$lname = mysql_result($result, 0, 'lname');

	//set authorization cookie
	setcookie("auth", "1", 0, "/", "grooverecord.net", 0);

	//create display string
	$display_block = "<P>$fname $lname is authorized!</p>
	<P>Authorized Users' Menu:
	<ul>
	//<li><a href=\"secretpage.php\">secret page</a>
	</ul>";

} else {

	//redirect back to login form if not authorized
	header("Location: adminlogin.html");
	exit;
}
header("Location: adminwelcome2.php? login=true&id=$uname");

exit();

?>
<HTML>
<HEAD>
<TITLE>User Login</TITLE>
</HEAD>
<BODY>
<? echo "$display_block"; ?>
</BODY>
</HTML>


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 03 September 2006 - 06:42 PM

Is the target folder for images write-enabled?
Legend has it that reading the manual never killed anyone.
My site

#3 kikilahooch

kikilahooch
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts

Posted 03 September 2006 - 06:48 PM

I'm not sure, how do I check??? On the last hosting site I right clicked on images and changed the chmod or something but when I right click on this i cant do anything

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 03 September 2006 - 06:50 PM

No idea. It depends on what tools your web host provides.  I change permissions on my sites through WS FTP.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users