Jump to content

uploading images,says access is denied


kikilahooch

Recommended Posts

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??

[code]
<?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>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.