Jump to content


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


making a new folder with PHP

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


Share this post

Link to post
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.

Share this post

Link to post
Share on other sites


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.