create new folder with php -


I have a file upload script that [finally] works, but wants users to submit photos to a folder, Which I want to be made as a user name I was thinking that I could probably submit the file and then to make it, but if it did not happen, how can I do this? This is my script: PHP code:

  & lt ;? Php // configuration portion $ dbhost = "localhost"; // database host $ dbname = "users"; // database name $ dbuser = "dbuser"; // database user name $ dbpass = ""; // Database password // Connect to database $ db = mysql_connect ($ dbhost, $ dbuser, $ dbpass) or die ("Error: Could not connect to database"); Mysql_select_db ($ dbname, $ db) or die ("Error: database could not be selected."); If ($ ezogg in) {$ userid = $ _GET ["userid"]; If ($ _ POST ['Submit']) {if ($ userid) {$ uploadName = mysql_query ("Select * from user where user id = '". $ Userid. "' '); While ($ upName = mysql_fetch_row ($ UploadName)) {$ userName2 = $ upName [1]; $ UserPic1 = $ upName [11]; Repeat "$ userName2"; }} // If the submit button was pressed: if ($$ _FILES ['imagefile'] ['type'] == 'image / PJPG') {// This is where the folder is in the copy of the user name folder ($ _FILES ['imagefile'] ['tmp_name'], "Picture / Profile /". $ UserName2. "/". $ _FILES ['imagefile'] ['' name ']) or die ("Copy can not be done") ; Echo ""; Echo "name:". $ _ Files ['imagefile'] ['name']. ""; Echo "Size:" $ _ Files ['imagefile'] ['size']. ""; Echo "Type:". $ _ Files ['imagefile'] ['type']. ""; Copy "complete copy ..."; } Else {echo ""; Resonance "could not be copied, wrong file type (". $$ _FILES ['imagefile'] ['name'].) "; }}? & Gt; & Lt; Form name = "form1" method = "post" action = "index.php? Page = classupload & amp; userid = & lt; php echo" $ userid ";? & Gt;" Enctype = "Multipurpose / Farm-Data" & gt; & Lt; Input type = "file" name = "imagefile" & gt; & Lt; Input type = "submit" name = "submit" value = "submit" & gt; & Lt; / Form & gt; & Lt ;? Php} and {? & Gt; How did you come here? You can & lt; A href = "index.php? Page = login" & gt; Login & lt; / A & gt; Are not there. & Lt ;? Php}? & Gt;  

Is there any way to do this? Maybe even when the user is created? Thanks!

$ directoryPath = "/ home / domain / public_html / site_name / pics / profile /" $ UserName2; MKDIR ($ DirectX, 0644);

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -