Failed to open stream:

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
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
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back