kikilahooch Posted September 3, 2006 Share Posted September 3, 2006 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 54Warning: 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 54Any idea what would cause this error??[code]<?php//check for required fields from the formif ((!$_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 matchif (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>[/code] Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 3, 2006 Share Posted September 3, 2006 Is the target folder for images write-enabled? Quote Link to comment Share on other sites More sharing options...
kikilahooch Posted September 3, 2006 Author Share Posted September 3, 2006 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 Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 3, 2006 Share Posted September 3, 2006 No idea. It depends on what tools your web host provides. I change permissions on my sites through WS FTP. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.