Jump to content

Syntax error??


Genesis730

Recommended Posts

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   }

Link to comment
Share on other sites

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");
         }
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.