ballouta Posted June 12, 2008 Share Posted June 12, 2008 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 More sharing options...
jonsjava Posted June 12, 2008 Share Posted June 12, 2008 if you're just wanting to supress the warning: @mkdir("stk/$user", 0700); And the "0700" is the permission set for it. seeing how it's a folder, change that to "0600" (7's are only used on files) Link to comment https://forums.phpfreaks.com/topic/109898-solved-make-directory-warning/#findComment-563918 Share on other sites More sharing options...
ballouta Posted June 12, 2008 Author Share Posted June 12, 2008 thanks alot it is working Link to comment https://forums.phpfreaks.com/topic/109898-solved-make-directory-warning/#findComment-563922 Share on other sites More sharing options...
rhodesa Posted June 12, 2008 Share Posted June 12, 2008 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); Link to comment https://forums.phpfreaks.com/topic/109898-solved-make-directory-warning/#findComment-563944 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.