Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2005
    Messaggi
    28

    errore di parse non lo trovo help

    Mi da questo errore e non lo trovo: Parse error: parse error, unexpected '}' in C:\Programmi\EasyPHP 2.0b1\www\beef\submit_config.php on line 50




    <?
    include ('pw.php');

    $cache_dir = getcwd() . '/cache';
    $config_file_dir = getcwd() . '/include';
    $config_file = $config_file_dir . '/config.inc.php';

    if ( strcmp( $_GET['passwd'], $passwd) == 0 )
    {

    if (!function_exists('file_put_contents')) {
    define('FILE_APPEND', 1);
    function file_put_contents($n, $d, $flag = false) {
    $mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ? 'a' : 'w';
    $f = @fopen($n, $mode);
    if ($f === false) {
    return 0;
    } else {
    if (is_array($d)) $d = implode($d);
    $bytes_written = fwrite($f, $d);
    fclose($f);
    return $bytes_written;
    }
    }
    }

    $beef_domain = "define('BEEF_DOMAIN', 'CONFIG');\n";
    $base_dir = "define('BASE_DIR', 'CONFIG');\n";

    $config = $_GET["config"];
    if(empty($config)) {
    echo "ERROR: no config passed";
    exit(0);
    }

    $base_dir = preg_replace('/CONFIG/', getcwd() . '/', $base_dir);
    $beef_domain = preg_replace('/CONFIG/', $config, $beef_domain);

    // check permissions on the include and cache
    if((is_writable($config_file) || is_writable($config_file_dir)) && is_writable($cache_dir)) {
    $rtn = file_put_contents($config_file, "<?\n" . $base_dir . $beef_domain . "?>\n");

    ?>
    <h2>BeEF Successfuly Configured</h2>

    <form name="configform">
    <input class="button" type="button" value="Finished" onClick="javascript:location.href='<? echo $config ?>/ui'"/>
    </form>
    <?php
    } else {
    ?>
    <h2>Error</h2>
    Permissions on the <?php printf(getcwd() . '/include' ) ?> directory are incorrect. Running the
    following command will corrent the problem:

    # chown <?php printf(get_current_user() . " " . getcwd() . '/include' ) ?>

    # chown -R <?php printf(get_current_user() . " " . getcwd() . '/cache' ) ?>

    <?
    }
    } else { // the password was incorrect
    ?>
    <h2>Password</h2>
    Incorrect BeEF password, please try again.
    <?
    }
    ?>

  2. #2
    guarda che hai messo due if e due else consecutivi ..
    ovvero:

    -if{...}
    -if{...}
    -else{...}
    -else{...}

    Così l'ultimo else non è relativo a nessun if.. probabilmente hai chiuso il primo if troppo presto, e volevi fare una cosa tipo
    Codice PHP:
    if(...) {
        if(...) {
        } 
        else{
        }

    else{


    contolla il tuo codice da
    Codice PHP:
     if(empty($config)) {
    echo 
    "ERROR: no config passed";
    exit(
    0);

    ciau

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.