nerdco Posted March 11, 2006 Share Posted March 11, 2006 Hey,I have a registration process for a upload site I'm creating. When they register a 8 digit long key is created to be their home folder and stored in a mysql table ('users'). Now when they activate their account I want it to create a directory based on the 'directory' key.[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?if ($_GET['action'] == "activate") {?><?$alias = $_REQUEST['alias'];$activationcode = $_REQUEST['code'];$sql = mysql_query("UPDATE users SET access='1' WHERE alias='$alias' code='$activation'");$sql_doublecheck = mysql_query("SELECT * FROM users WHERE alias='$alias' AND access='1'");$doublecheck = mysql_num_rows($sql_doublecheck);if($doublecheck == 0){ echo "An error occured during the activation of your account";} elseif ($doublecheck > 0) {[!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--] $result = mysql_query("SELECT * FROM users WHERE alias='$alias'"); $row = mysql_fetch_array( $result ); mkdir("/home/nerdco/public_html/uploader/storage/.$row['directory']", 0777); echo "Your account is now active, you may now login";[!--colorc--][/span][!--/colorc--]}?><?exit;}?>[/quote]I've tried to do it but I get the followed error:Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/nerdco/public_html/uploader/index.php on line 43Thanks in advance,nerd Link to comment https://forums.phpfreaks.com/topic/4675-mkdir-relative-to-mysql/ Share on other sites More sharing options...
txmedic03 Posted March 11, 2006 Share Posted March 11, 2006 [code]$result = mysql_query("SELECT * FROM users WHERE alias='".$alias."' LIMIT 1");$row = mysql_fetch_array($result);mkdir("/home/nerdco/public_html/uploader/storage/".$row['directory'], 0777);echo "Your account is now active, you may now login";[/code]This should resolve your problem. Link to comment https://forums.phpfreaks.com/topic/4675-mkdir-relative-to-mysql/#findComment-16368 Share on other sites More sharing options...
nerdco Posted March 11, 2006 Author Share Posted March 11, 2006 Hey,Thanks, exactly what I want :)nerd Link to comment https://forums.phpfreaks.com/topic/4675-mkdir-relative-to-mysql/#findComment-16374 Share on other sites More sharing options...
txmedic03 Posted March 11, 2006 Share Posted March 11, 2006 Glad I could help. :-) Link to comment https://forums.phpfreaks.com/topic/4675-mkdir-relative-to-mysql/#findComment-16375 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.