Click to See Complete Forum and Search --> : create a windows user account
dandono
Apr 30th, 2005, 09:34 AM
hi, i am making an online registration scheme for my website for some webspace. i have got every thing sorted out exsept for one thing. to acces the ftp service and upload files to there user space i need to create a user account on the server for that user. is there a way to create a user account on a windows operating system with php 5 installed.
thanks, dandono
john tindell
May 1st, 2005, 11:38 AM
In windows you can create a user account using
NET USER [username] [password] /ADD
you have to be logged into an account that has the access to create other users first, ie admin, as far as i know.
just use the exec function to call the function
http://uk.php.net/manual/en/function.exec.php
dandono
May 1st, 2005, 03:51 PM
it returned this:
Warning: exec() [function.exec]: Unable to fork [NET USER [test123] [test123] /ADD] in D:\Inetpub\XPROOT\reg\reg1.php on line 54
i dont use the NET USER command at all but does it need the [] brackets to contain the user or do i remove them?
My code is below:
exec ('NET USER ' . $uid . $pw . ' /ADD /fullname:"' . $fn . '" /DOMAIN');
dglienna
May 3rd, 2005, 01:06 AM
no brackets required. you could try it out from a command prompt to get it working, then to delete it, you could use NET USER username /DELETE
dandono
May 3rd, 2005, 04:29 AM
ok i changed my code to this:
exec 'NET USER ' . $uid . $pw . ' /ADD /fullname:"' . $fn . '" /DOMAIN';
and it returns:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\Inetpub\XPROOT\reg\reg1.php on line 62
dandono
May 14th, 2005, 07:11 AM
can somebody please write me a peice of code because i realy do not get what is wrong with my code but it still returns an error.
thanks, dandono
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.