Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Parse error: syntax error, unexpected T_STRING

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #205101
    jurotek
    Participant

    $config_file = preg_replace(“#\?>$#”, “”, $config_file); $config_file = trim($config_file);

    #205105
    jurotek
    Participant

    Thanx Senff,
    I just uploaded EE to server and my index.php was empty and I got that above error.

    Here is the whole code:

    $config_file = preg_replace(“#\?>$#”, “”, $config_file); $config_file = trim($config_file);
    // Add the new data string
    $config_file .= $newline.$newline.$new_data.$newline;
    // Add the closing PHP tag back
    $config_file .= ‘?>’; } } if ( ! $fp = fopen($this->config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) { return FALSE; } flock($fp, LOCK_EX); fwrite($fp, $config_file, strlen($config_file)); flock($fp, LOCK_UN); fclose($fp); if ( ! empty($this->_config_path_errors)) { return $this->_config_path_errors; } else { return TRUE; } // <?php BBEdit bug fix
    }

    #205107
    Alen
    Participant

    @jurotek

    Please format the code properly. There could be some stripped code that we’re not seeing.

    could be the curly quotes

    That could be this forum jumbling stuff up because it’s not formatted correctly.

    Use Markdown, use 3 ticks (`) then type php, then close it by another 3 ticks. So like this.

    #205108
    jurotek
    Participant

    “`php
    <?php

    $config_file = preg_replace(“#\?>$#”, “”, $config_file); $config_file = trim($config_file); // Add the new data string $config_file .= $newline.$newline.$new_data.$newline; // Add the closing PHP tag back $config_file .= ‘?>’; } } if ( ! $fp = fopen($this->config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) { return FALSE; } flock($fp, LOCK_EX); fwrite($fp, $config_file, strlen($config_file)); flock($fp, LOCK_UN); fclose($fp); if ( ! empty($this->_config_path_errors)) { return $this->_config_path_errors; } else { return TRUE; } // <?php BBEdit bug fix
    }
    ?>

    #205110
    jurotek
    Participant
    <?php
    
    $config_file = preg_replace("#\?>$#", "", $config_file); $config_file = trim($config_file); // Add the new data string $config_file .= $newline.$newline.$new_data.$newline; // Add the closing PHP tag back $config_file .= '?>'; } } if ( ! $fp = fopen($this->config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) { return FALSE; } flock($fp, LOCK_EX); fwrite($fp, $config_file, strlen($config_file)); flock($fp, LOCK_UN); fclose($fp); if ( ! empty($this->_config_path_errors)) { return $this->_config_path_errors; } else { return TRUE; } // <?php BBEdit bug fix
        }
    ?>
    
    #205112
    Alen
    Participant
    <?php
    
    $config_file = preg_replace("#\?>$#", "", $config_file);
    $config_file = trim($config_file);
    
    // Add the new data string
    $config_file .= $newline.$newline.$new_data.$newline;
    
    // Add the closing PHP tag back
    $config_file .= '?>';
    
    } // <-- ERROR
    
    } // <-- ERROR
    
    if ( ! $fp = fopen($this->config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE) ) {
      return FALSE;
    }
    
    flock($fp, LOCK_EX);
    fwrite($fp, $config_file, strlen($config_file));
    flock($fp, LOCK_UN); fclose($fp);
    
    if ( ! empty($this->_config_path_errors) ) {
      return $this->_config_path_errors;
    }
    else {
      return TRUE;
    }
    // <?php BBEdit bug fix
    
    } // <-- ERROR
    
    #205113
    jurotek
    Participant

    Perfect. Thank you Alen!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.