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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a file in a folder just created in PHP

Status
Not open for further replies.

frummel

Technical User
Jun 21, 2002
91
NL
I can't seem to get this script to work:

mkdir ("../$username", 0700);
chmod ("../$username", 0777);

$bandpage = "../$username/".index.".php";
$fd = fopen($bandpage,"a+");
fwrite ($fd, "Hello"."\r\n");
fwrite ($fd, "Is this working?");


What I get when running the script is:

Warning: SAFE MODE Restriction in effect. The script whose uid is 2312 is not allowed to access /opt/guide/ owned by uid 99 in /opt/guide/ on line 95

I think the problem is that the server is already running the creation of the file, but the folder is not yet created.

Well, if anyone has an idea, i'd be pleased to know.
 
Hmm. So the server I use is an extern host. I cannot change the serversettings. So I have a problem...

Is there another way to get the process done?
 
Thanks for your reply Sleipnir214! The answer to success is somewhere on the page you recommended above.

But I can't get it working, Because I don't know how to use the options on that page.

I tried the following:

ini_set ("safe_mode" , "0");[\b]
and
ini_set ("safe_mode" , "PHP_INI_SYSTEM");[\b]

But these two didn't work. I got the same error messages. I saw some more safe mode[\i] tags, nut I don't know how to use them. Can someone explain me which safe mode[\i] option is should use, and perhaps explain why is should use that particular option?

I'm a beginner in PHP so I'd appreciate any kind of help.

Thanks ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top