Genesis730 Posted July 3, 2010 Share Posted July 3, 2010 I hope someone can find an error with this. I keep getting "Parse error: parse error in process.php on line 145" 131 function procCreate(){ 132 global $session, $form; 133 if($session->logged_in){ 134 $dir = preg_replace("/(.*)(\/)$/","\\1", $dir); 135 $dir = $session->username; 136 $absolute_dir = $_SERVER['DOCUMENT_ROOT'].''.$dir; 137 if (!is_dir($absolute_dir)) { 138 mkdir($absolute_dir, 0777); 139 chmod($absolute_dir, 0777); 140 return $absolute_dir; 141 } 142 else { 143 echo "There was an error processing your request"; 144 } 145 else { 146 header("Location: index.php"); 147 } 148 } 149 } Quote Link to comment Share on other sites More sharing options...
AtomicRax Posted July 3, 2010 Share Posted July 3, 2010 You have two concurrent else statements. The following will redirect to index.php if NOT logged in...is that what you're trying to achieve? function procCreate(){ global $session, $form; if($session->logged_in){ $dir = preg_replace("/(.*)(\/)$/","\\1", $dir); $dir = $session->username; $absolute_dir = $_SERVER['DOCUMENT_ROOT'].''.$dir; if (!is_dir($absolute_dir)) { mkdir($absolute_dir, 0777); chmod($absolute_dir, 0777); return $absolute_dir; } else { echo "There was an error processing your request"; } } else { header("Location: index.php"); } } Quote Link to comment Share on other sites More sharing options...
Genesis730 Posted July 3, 2010 Author Share Posted July 3, 2010 Yeah, if they're not logged in, go to index.php, else create the directory, then if there's an error with the directory, echo there was an error processing the request. Quote Link to comment 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.