Jump to content


Photo

making a new folder with PHP


  • Please log in to reply
1 reply to this topic

#1 mattsutton

mattsutton
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 15 May 2006 - 12:21 PM

Hi, im new here

I am trying to make a system where a users details are added to a mysql database via a form, then at the same time as this is happening a new folder is made for their username on the server.
Everything seems like it should work fine but im getting an error message when creating the folder.

im using mkdir()
and the code is
<? mkdir(".../.../accounts/$username")?>

When i hit submit to process all the data i get the error message...

"Warning: mkdir(http://www.redspider...ounts/redspider): No such file or directory"

if i use the username "redspider"

folder permissions are set to 777

i cant think what else im doing wrong.

Any help would be much appreciated
thanks!

Matt

#2 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 15 May 2006 - 02:13 PM

mkdir usually gives you system root, not http:// that is weird.

Insert this above your mkdir in the code and see what it tells you (change the "..." back to what it's supposed to be first, of course)

echo realpath(".../.../accounts");

If there is a path error, you'll likely get "directory doesn't exist" or some such. If not, just verify that each of the directories in your path actually does exist.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users