Visualizzazione risultati 1 fino 4 di 4

Discussione: Problemi con script, funzioni non supportate? [era: Aiuto]

  1. #1
    Guest

    Predefinito Problemi con script, funzioni non supportate? [era: Aiuto]

    Salve a tutti, sono giorni che giro e rigiro questa parte di script, per capire quale sia l'errore che non fa visualizzare in php5 questa parte di script, credo che ci siano delle funioni non supportate da php5 ma non riesco a capire quali siano, potere aiutarmi?
    Codice PHP:


    <?php

    //controllo se alcune funzioni sono abilitate
    $phpversion = (!@phpversion()) ? '<b>PHP</b>: N/A' : '<b>PHP</b>: ' . phpversion();
    $mysql_get_server_info = (!@mysql_get_server_info()) ? '<b>MySQL</b>: N/A' : '<b>MySQL</b>: ' . mysql_get_server_info();
    $apache_get_version = (!@apache_get_version()) ? '<b>Web Server</b>: N/A' : '<b>Web Server</b>: ' . apache_get_version();
    $php_uname = (!@php_uname()) ? '<b>OS</b>: N/A' : '<b>OS</b>: ' . php_uname();
    echo
    $phpversion . ' ' . $mysql_get_server_info . ' ' . $apache_get_version . ' ' . $php_uname . '<br /><br />';

    //ricavo le info sulle tabelle

    if (@mysql_get_server_info() >= 5) {
    $status_table = mysql_query("SHOW TABLE STATUS WHERE Name IN ('$tab_news', '$tab_utenti', '$tab_config', '$tab_livelli', '$tab_categorie', '$tab_commenti')");
    }
    else {
    $status_table = mysql_query("SHOW TABLE STATUS LIKE 'news_%'");
    }

    while (
    $status_tb = mysql_fetch_array($status_table)) {
    $eccesso = ($status_tb['Data_free'] > 0) ? ' - <span style="color: rgb(255, 0, 0);">In eccesso di ' . round($status_tb['Data_free'] / 1024, 2) . ' KiB</span>: <a href="impostazioni.php?action=opt&amp;tab=' . $status_tb['Name'] . '" title="SQL: OPTIMIZE TABLE">ottimizza</a>' : NULL;
    $size = $status_tb['Data_length'] + $status_tb['Index_length'];

    //converto i bytes in KiB e MiB
    $tipo = 'bytes';

    if (
    $size > 1024) {
    $size = $size / 1024;
    $tipo = ' KiB';
    }

    if (
    $size > 2048) {
    $size = $size / 2048;
    $tipo = ' MiB';
    }
    $size = number_format($size, 1);
    echo
    '<label for="' . $status_tb['Name'] . '"><input type="checkbox" id="' . $status_tb['Name'] . '" name="selected_tbl[]" value="' . $status_tb['Name'] . '" checked="checked" />' . $status_tb['Name'] . '</label> - Dimensione: ' . $size . $tipo . ' ' . $eccesso . '<br/>';
    }
    $comp = (extension_loaded("zlib") ? '<img src="' . $img_path . '/sel_all.gif" alt="select" />Backup compresso <select name="compress"><option value="1" selected="selected">S&igrave; (.gz)</option><option value="0">No (.sql)</option></select> <input type="submit" name="backup" value="Backup" style="font-weight: bold;" />' : NULL);
    echo
    $comp . '<br />';
    ?></td>
    </tr>
    <tr>
    <td bgcolor="#FF0000" align="center" colspan="2">
    <input type="submit" name="submit" value="Modifica" style="font-weight: bold;" />
    <input type="reset" name="reset" value="Ripristina" /></td>
    </tr>
    </table>
    </form><br />
    <?php require_once ("footer.php"); ?>
    </body>
    </html>

  2. #2
    L'avatar di dreadnaut
    dreadnaut non è connesso Super Moderatore
    Data registrazione
    22-02-2004
    Messaggi
    6,270

    Predefinito

    Potresti aggiungere un error_reporting(E_ALL) all'inizio dello script, e lasciare che php ti dica quel'è l'error direttamente.
    Ultima modifica di dreadnaut : 02-03-2012 alle ore 13.29.57 Motivo: + link documentazione

  3. #3
    Guest

    Predefinito

    Citazione Originalmente inviato da dreadnaut Visualizza messaggio
    Potresti aggiungere un error_reporting(E_ALL) all'inizio dello script, e lasciare che php ti dica quel'è l'error direttamente.
    E magari usare un po' meno la @...

  4. #4
    Guest

    Predefinito

    ho pulito il codice dalle @ e viene fuori questo errore :
    Fatal error: Call to undefined function apache_get_version() in /membri/ligabuefansclub/news/admin/impostazioni.php on line 335
    che si riferisce a questa riga di codice
    Codice PHP:
    $apache_get_version = (!apache_get_version()) ? '<b>Web Server</b>: N/A' : '<b>Web Server</b>: ' . apache_get_version();
    Ultima modifica di lordbyron : 02-03-2012 alle ore 15.08.55

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •