Solar Posted March 2, 2009 Share Posted March 2, 2009 How would I create a subfolder with there name using this code? } /** * The user has submitted the registration form and the * results have been processed. */ else if(isset($_SESSION['regsuccess'])){ /* Registration was successful */ if($_SESSION['regsuccess']){ echo "<h1>Registered!</h1>"; echo "<p>Thank you <b>".$_SESSION['reguname']."</b>, for registering on PasteIt! " ."you may now create your own website! <a href=\"index.php\">log in</a>.</p>"; } So by using ".$_SESSION['reguname']." Make a subfolder name with that. What would the script look like and where can I place it in this script? Oh and inserting a simple like php page as well. That would be similar right? Quote Link to comment https://forums.phpfreaks.com/topic/147604-solved-create-folder/ Share on other sites More sharing options...
premiso Posted March 2, 2009 Share Posted March 2, 2009 mkdir I believe is what you would be looking for. For the file fopen, fwrite and fclose is what you are after. Quote Link to comment https://forums.phpfreaks.com/topic/147604-solved-create-folder/#findComment-774877 Share on other sites More sharing options...
GraphiX Posted March 2, 2009 Share Posted March 2, 2009 Complete w3schools section on it http://www.w3schools.com/PHP/php_file.asp Quote Link to comment https://forums.phpfreaks.com/topic/147604-solved-create-folder/#findComment-774892 Share on other sites More sharing options...
Solar Posted March 2, 2009 Author Share Posted March 2, 2009 <?php } /** * The user has submitted the registration form and the * results have been processed. */ else if(isset($_SESSION['regsuccess'])){ /* Registration was successful */ if($_SESSION['regsuccess']){ echo "<h1>Registered!</h1>"; echo "<p>Thank you <b>".$_SESSION['reguname']."</b>, for registering on PasteIt! " ."you may now create your own website! <a href=\"index.php\">log in</a>.</p>"; } ?> I'm having trouble inserting; <?php mkdir("".$_SESSION['reguname']."/", 0700); ?> Into the coding. I've inserted it above the "Thank You" and I get a line of error; Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\pasteit\register.php on line 37 Hmmm, is it because of where I am placing it? :/ Quote Link to comment https://forums.phpfreaks.com/topic/147604-solved-create-folder/#findComment-774894 Share on other sites More sharing options...
Solar Posted March 2, 2009 Author Share Posted March 2, 2009 Oops! Figured it out! Thanks, I had pressed a key on the keyboard that inserted a random character in the php Quote Link to comment https://forums.phpfreaks.com/topic/147604-solved-create-folder/#findComment-774908 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.