NameSilo

Failed to open stream:

Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
SpaceshipSpaceship
Watch

millst2

Established Member
Impact
0
Need some help. When I try to go to the link to submit a picture i get this error returned:

Permission denied in /home/username/public_html/doupload.php on line 57

I believe this is the area where I am having me error. It says lines 54 -57 on different tries. I set the chmod to 777 and still nothing. ANYONE?


mt_srand( (double)microtime() * 1000000);
$randvar = mt_rand(1,1000000);
settype($randvar,"string");
//$dir=basename(dirname($_SERVER["SCRIPT_FILENAME"]));
//die($dir);
//$newfilename = dirname($_SERVER["SCRIPT_FILENAME"])."../images/uploadedimages/" . $randvar. str_replace(" ","_",$realname);
$newfilename = "../uploadedpics/" . $randvar. str_replace(" ","_",$realname);
echo $newfilename;
$shortfname = $randvar. str_replace(" ","_",$realname);
while ( file_exists($newfilename) != FALSE )
{
$randvar = mt_rand(1,100000);
settype($randvar,"string");
$newfilename = "../uploadedpics/" . $randvar. str_replace(" ","_",$realname);
$shortfname = $randvar. str_replace(" ","_",$realname);
}
//////////////////////
copy($_FILES['userfile']['tmp_name'], $newfilename);

I have the CHMOD set to 777 but still no luck. Maybe the file is in the wrong place not sure. ANY help is appreciated.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Put that code in [ PHP ] tags so we can help you.
 
0
Close
Try setting the $newfilename variable to something like "/home/username/public_html/uploadedpics..." or whatever the full dir is.
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back