Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Parse error: syntax error, unexpected $end

    <?php

    $_CONFIG['host'] = "mysql.bet-up.com";

    $_CONFIG['user'] = "rossoblu";

    $_CONFIG['pass'] = "***";

    $_CONFIG['dbname'] = " betup?jmm";



    $_CONFIG['table_utenti'] = "tipster";



    $_CONFIG['expire'] = 60;

    $_CONFIG['regexpire'] = 24; //in ore



    $_CONFIG['check_table'] = array(

    "username" => "check_username",

    "password" => "check_global",

    "name" => "check_global",

    "surname" => "check_global",

    "indirizzo" => "check_global",

    "occupazione" => "check_global",

    "mail" => "check_global"

    );

    {

    function check_username($value){

    global $_CONFIG;



    $value = trim($value);

    if($value == "")

    return "Il campo non può essere lasciato vuoto";

    $query = mysql_query("

    SELECT id

    FROM ".$_CONFIG['tipster']."

    WHERE username='".$value."'");

    if(mysql_num_rows($query) != 0)

    return "Nome utente già utilizzato";



    return true

    or die(mysql_error());



    {

    function check_global($value){

    global $_CONFIG;



    $value = trim($value);

    if($value == "")

    return "Il campo non può essere lasciato vuoto";



    return true

    or die(mysql_error());







    //--------------


    define('AUTH_LOGGED', 99);

    define('AUTH_NOT_LOGGED', 100);



    define('AUTH_USE_COOKIE', 101);

    define('AUTH_USE_LINK', 103);

    define('AUTH_INVALID_PARAMS', 104);

    define('AUTH_LOGEDD_IN', 105);

    define('AUTH_FAILED', 106);



    define('REG_ERRORS', 107);

    define('REG_SUCCESS', 108);

    define('REG_FAILED', 109);



    $conn = mysql_connect($_CONFIG['host'], $_CONFIG['user'], $_CONFIG['pass']) or die('Impossibile stabilire una connessione');

    mysql_select_db($_CONFIG['dbname'])?>
    Aiuto ragazzi, mi da l'errore che ho scritto sul titolo del topic..

    Ho già visto alcune discussioni simili sul forum e il problema sembra essere qualche parentesi lasciata chiusa o aperta... qualcuno mi può aiutare? Grazie mille

  2. #2
    Certo! hai molti errori di sintassi.

    si deve ricordare che bisogna a chiusare le tutte funzione che ti apertare e solo aperti le funzione. anche ricordi che i definizioni (e.g. return true; ecc ecc) si devono essere finito con un ;

    Mi spiego:

    il tuo codice:
    Codice PHP:
    {

    function 
    check_username($value){

    global 
    $_CONFIG;



    $value trim($value);

    if(
    $value == "")

    return 
    "Il campo non può essere lasciato vuoto";

    $query mysql_query("

    SELECT id

    FROM "
    .$_CONFIG['tipster']."

    WHERE username='"
    .$value."'");

    if(
    mysql_num_rows($query) != 0)

    return 
    "Nome utente già utilizzato";



    return 
    true

    or die(mysql_error()); 
    il mio codice:
    Codice PHP:
    function check_username($value){

    global 
    $_CONFIG;



    $value trim($value);

    if(
    $value == "")

    return 
    "Il campo non può essere lasciato vuoto";

    $query mysql_query("

    SELECT id

    FROM "
    .$_CONFIG['tipster']."

    WHERE username='"
    .$value."'");

    if(
    mysql_num_rows($query) != 0)

    return 
    "Nome utente già utilizzato";



    return 
    true;


    Ecco il codice:
    Codice PHP:
    <?php

    $_CONFIG
    ['host'] = "mysql.bet-up.com";

    $_CONFIG['user'] = "rossoblu";

    $_CONFIG['pass'] = "***";

    $_CONFIG['dbname'] = " betup?jmm";



    $_CONFIG['table_utenti'] = "tipster";



    $_CONFIG['expire'] = 60;

    $_CONFIG['regexpire'] = 24//in ore



    $_CONFIG['check_table'] = array(

    "username" => "check_username",

    "password" => "check_global",

    "name" => "check_global",

    "surname" => "check_global",

    "indirizzo" => "check_global",

    "occupazione" => "check_global",

    "mail" => "check_global"

    );


    function 
    check_username($value){

    global 
    $_CONFIG;



    $value trim($value);

    if(
    $value == "")

    return 
    "Il campo non può essere lasciato vuoto";

    $query mysql_query("

    SELECT id

    FROM "
    .$_CONFIG['tipster']."

    WHERE username='"
    .$value."'");

    if(
    mysql_num_rows($query) != 0)

    return 
    "Nome utente già utilizzato";



    return 
    true;

    }


    function 
    check_global($value){

    global 
    $_CONFIG;



    $value trim($value);

    if(
    $value == "")

    return 
    "Il campo non può essere lasciato vuoto";



    return 
    true;

    }





    //--------------


    define('AUTH_LOGGED'99);

    define('AUTH_NOT_LOGGED'100);



    define('AUTH_USE_COOKIE'101);

    define('AUTH_USE_LINK'103);

    define('AUTH_INVALID_PARAMS'104);

    define('AUTH_LOGEDD_IN'105);

    define('AUTH_FAILED'106);



    define('REG_ERRORS'107);

    define('REG_SUCCESS'108);

    define('REG_FAILED'109);



    $conn mysql_connect($_CONFIG['host'], $_CONFIG['user'], $_CONFIG['pass']) or die('Impossibile stabilire una connessione');

    mysql_select_db($_CONFIG['dbname']);
    ?>
    buona fortuna mio amico!

    Ciao,
    Dennis
    Nuovo Blog di Programmazione! (Lo ha i tutti tipi! PHP e C/C++)
    Per piacere lo supporti!

  3. #3
    Grazie mille.

    Sei stato davvero gentilissimo

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.