Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php page gives a permission error

Status
Not open for further replies.

michelleqw

Programmer
Joined
Jan 4, 2004
Messages
120
Location
DE
Dear php users,

We want to create a lot of background colors. If the index.php start a background color will random choosen. After that we want to copy this file to a filename what is used for all pages.
If we do so the starting page gives an error that we don't have permission to do this.
We have username / password to upload files. What do we have to do to rewrite our index.php file so we can copy a file?

Source:
<?php
$number = rand(0,15);
$bgc= "bgc" . $number . ".jpg";
if (!copy("information/pictures/" . $bgc, "information/pictures/backgroundcolor.jpg")) {
echo "failed to copy $bgc...<br />\n";
}

Error message:
Warning: copy(information/pictures/backgroundcolor.jpg) [function.copy]: failed to create stream: Permission denied in / on line 14
failed to copy bgc0.jpg...

Nice regards,

Michelle.
 
The page that creates the file must be creating the file in a directory which will allow the webserver write access.

clear? ... probbly ot.

is you webserver apache or iis or .. ?

ftp to your host
ftp>mkdir somedir
ftp> chmod 777 somedir // here we allow the webserver write perms to the entire directory
ftp> cd somedir
ftp> put colors.php




______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Thanks for the information

Michelle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top