Jump to content

[SOLVED] Make Directory Warning


ballouta

Recommended Posts

Hello

 

I have posted a valude from HTML form which is 'user'.

after posting it, the php page inserts the posted values to MySQL table, everything is working till here,

 

I just added a short code inorder to make a directoy for each 'user' value posted. I wrote:

 

mkdir("stk/$user", 0700);

 

The directory has been created but i got this warning:

Warning: mkdir() [function.mkdir]: File exists in /home/gsclteam/public_html/register.php on line 48

 

by the way I don't know what 0700 is.

Please tell how how to remove this warning message.

thanks

Link to comment
https://forums.phpfreaks.com/topic/109898-solved-make-directory-warning/
Share on other sites

are you sure you want to just suppress the warning? that particular warning is because the directory already exists. if you don't want it to create the directory when it already exists, use this:

 

if(!is_dir("stk/$user")) mkdir("stk/$user", 0700);

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.