Jump to content

making a new folder with PHP


mattsutton

Recommended Posts

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.redspidercreative.co.uk/clients/liftingtackle/accounts/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
Link to comment
Share on other sites

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)

[code]echo realpath(".../.../accounts");[/code]

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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