Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 21

Discussione: Fatal Error

  1. #1

    Fatal Error

    Salve a tutti! Nel file setting.php ho impostato il database così
    Codice PHP:
    $db_server 'localhost';              # Database server / host
    $db_user 'universal3000';                  # Database user
    $db_pass '';         # database password
    $db_name 'my_universal3000';               # Database name
    $db_prefix ''
    Poi ho configurato così
    Codice PHP:
    $scripturl 'http://universal3000.altervista.org/chat/index.php'#absolute url to your chat index file
    $source '/membri/universal3000/chat/Source'# path to your source files
    $themedir 'http://universal3000.altervista.org/chat/Style'# url to your styles directory 
    .
    Ma cliccando nel file install.php, esce questo errore
    Fatal error: main() [function.require]: Failed opening required '/membri/universal3000/chat/Source/Class.php' (include_path='.:') in /membri/universal3000/wap/install.php on line 24
    Dove sta il problema? vi metto il link http://universal3000.altervista.org/wap/install.php Grazie 1000 :master:

  2. #2
    certo che se non posti il file install.php è un po' dura

  3. #3

    Re: Fatal Error

    Originariamente inviato da Leviathan73
    Fatal error: main() [function.require]: Failed opening required '/membri/universal3000/chat/Source/Class.php' (include_path='.:') in /membri/universal3000/wap/install.php on line 24
    L'errore segnalato mi sembra autoesplicativo:
    in /membri/universal3000/wap/install.php stai cercando di includere il file /membri/universal3000/chat/Source/Class.php, ma non è presente nel percorso di inclusione che è "."
    ;-)

    insomma controlla i settaggi del tuo serverweb.

  4. #4
    Il file install.php è questo
    Codice PHP:
    define('OEC',true);
    require_once(
    dirname(__FILE__) . '/Settings.php');
    require_once(
    $source '/Class.php');
    $info = new loadinfo;

    // Connect to MySQL database
    $db_connect = @mysql_connect($db_server$db_user$db_pass);

    if(!
    $db_connect || !@mysql_select_db($db_name$db_connect))
        die(
    $info -> db_error());

    if(!empty(
    $_GET['step']))
    {
        if(
    $_GET['step'] == '2')
        {
            
    mysql_query("CREATE TABLE `{$db_prefix}boot` (
              `memberName` varchar(80) NOT NULL,
              `boot_time` int(11) NOT NULL,
              `room` int(11) NOT NULL,
              `reason` text NOT NULL,
              PRIMARY KEY  (`boot_time`)
            ) ENGINE=MyISAM;"
    );
            
            
    mysql_query("CREATE TABLE `{$db_prefix}invites` (
              `inv_id` int(11) NOT NULL auto_increment,
              `room_id` int(11) NOT NULL,
              `MemberName` varchar(245) NOT NULL,
              `msg` text NOT NULL,
              PRIMARY KEY  (`inv_id`)
            ) ENGINE=MyISAM;"
    );
            
            
    mysql_query("CREATE TABLE `{$db_prefix}membergroups` (
              `ID_GROUP` smallint(5) unsigned NOT NULL auto_increment,
              `groupName` varchar(80) NOT NULL default '',
              PRIMARY KEY  (`ID_GROUP`)
            ) ENGINE=MyISAM;"
    );
            
            
    mysql_query("INSERT INTO `{$db_prefix}membergroups` VALUES (1, 'Administrators');");
            
    mysql_query("INSERT INTO `{$db_prefix}membergroups` VALUES (4, 'Members');");
            
    mysql_query("INSERT INTO `{$db_prefix}membergroups` VALUES (2, 'Global Moderator');");
            
    mysql_query("INSERT INTO `{$db_prefix}membergroups` VALUES (3, 'Room Moderator');");
            
            
    mysql_query("CREATE TABLE `{$db_prefix}members` (
              `memberName` varchar(245) NOT NULL default '',
              `memberID` int(11) NOT NULL auto_increment,
              `membergroupID` int(11) NOT NULL default '0',
              `password` varchar(80) NOT NULL default '',
              `email` varchar(245) NOT NULL default '',
              `gender` varchar(6) default NULL,
              `location` varchar(245) default NULL,
              `dateRegistered` int(11) NOT NULL default '0',
              `lastLogin` int(11) NOT NULL default '0',
              `banned` int(4) NOT NULL default '0',
              `Posts` int(11) NOT NULL default '0',
              `about` text,
              `Browser` varchar(245) default NULL,
              `pic` varchar(245) default NULL,
              `IP` varchar(60) default NULL,
              `auth_code` int(11) NOT NULL default '0',
              `color` varchar(60) NOT NULL default 'yellow',
              PRIMARY KEY  (`memberID`)
            ) ENGINE=MyISAM;"
    );
            
            
    mysql_query("CREATE TABLE `{$db_prefix}messages` (
              `msgID` int(11) NOT NULL auto_increment,
              `roomID` int(11) NOT NULL default '0',
              `message` varchar(245) NOT NULL default '',
              `to_user` varchar(245) default NULL,
              `poster` varchar(245) NOT NULL default '',
              `time` int(11) NOT NULL default '0',
              PRIMARY KEY  (`msgID`)
            ) ENGINE=MyISAM;"
    );
            
            
    mysql_query("CREATE TABLE `{$db_prefix}moderators` (
              `room` int(11) NOT NULL,
              `mod_id` int(11) NOT NULL,
              PRIMARY KEY  (`room`)
            ) ENGINE=MyISAM;"
    );
            
            
    mysql_query("CREATE TABLE `{$db_prefix}online` (
              `time` int(10) NOT NULL default '0',
              `member_Name` varchar(245) default NULL,
              `ID_Room` int(11) default NULL,
              PRIMARY KEY  (`time`)
            ) ENGINE=MyISAM;"
    );
            
            
    mysql_query("CREATE TABLE `{$db_prefix}rooms` (
              `RoomID` int(4) NOT NULL auto_increment,
              `RoomName` varchar(245) NOT NULL default '',
              `CreatedBy` varchar(245) NOT NULL default '',
              `is_public` int(1) NOT NULL default '1',
              PRIMARY KEY  (`RoomID`)
            ) ENGINE=MyISAM;"
    );
            
            
    mysql_query("INSERT INTO `{$db_prefix}rooms` VALUES (1, 'The Lounge', '', 1);");
            
    mysql_query("INSERT INTO `{$db_prefix}rooms` VALUES (7, 'Friends', '', 1);");
            
    mysql_query("INSERT INTO `{$db_prefix}rooms` VALUES (6, 'Flirt', '', 1);");
            
            
    $info -> above();
            echo 
    '<p class="windowbg">Register Power user</p>
                <form action="'
    ,$_SERVER['PHP_SELF'],'?step=3" method="post">
                    Username:

                    <input type="text" name="user" size="21" />

                    E-mail:

                    <input type="text" name="email" size="21" />

                    Password:

                    <input type="password" name="password" />

                    <input type="submit" value="Register" />
                </form>'
    ;
        }
        if(
    $_GET['step'] == '3')
        {
            
    $info -> above();
            
    $admin addslashes($_POST['user']);
            
    $email addslashes($_POST['email']);
            
    $password md5(addslashes($_POST['password']));
            
            if(
    $admin == '')
            die(
    'Username field was left empty, [url="install.php?step=2"]Back[/url]');
            
            if(
    $email == '')
            die(
    'Email field was left empty, [url="install.php?step=2"]Back[/url]');
            
            if(
    $password <3)
            die(
    'Password too short!! [url="install.php?step=2"]Back[/url]');
            
            
    mysql_query("
                INSERT INTO 
    {$db_prefix}members
                SET memberName = '
    $admin', email = '$email', password = '$password', membergroupID = '1', dateRegistered = '".time()."'");
            
            echo 
    '<p class="catbg">Your installation was successful, please remove the install.php file before you continue...

                                   [url="'
    ,$scripturl,'"]Next[/url]</p>';
        }
        echo 
    '</body>
        </html>'
    ;
    }
    else {
        
    $page_title 'UNIVERSAL 3000 Installation</p>';
        
    $info -> above();
        echo 
    '<h2>Welcome to UNIVERSAL 3000 Setup wizard</h2>';
        
            echo 
    '<p class="windowbg">It seems everything is setup properly, you
                                     may proceed to [url="install.php?step=2"]step 2[/url]</p>'
    ;
    }

    ?> 

  5. #5
    Guarda che se imposti una variabile con gli apici singoli, sfrutti una funzione di php(che svolge tutt'altra cosa).
    Prova con $var= "" con gli apici doppi

  6. #6
    Ok, dove devo metterlo esattamente? Non riesco a trovarlo

  7. #7
    Intendevo cosi:
    $db_server = "localhost"; # Database server / host

    invece di
    $db_server = 'localhost'; # Database server / host
    E cosi per tutte le altre variabili

  8. #8
    Ho messo così nel file setting.php
    Codice PHP:
    $db_server "localhost";              # Database server / host
    $db_user "universal3000";                  # Database user
    $db_pass "";         # database password
    $db_name "my_universal3000";               # Database name
    $db_prefix ""
    e cliccando il file install.php spunta questa scritta
    Fatal error: main() [function.require]: Failed opening required '/membri/universal3000/chat/Source/Class.php' (include_path='.:') in /membri/universal3000/wap/install.php on line 24

  9. #9
    Originariamente inviato da ilnetsurfer
    Guarda che se imposti una variabile con gli apici singoli, sfrutti una funzione di php(che svolge tutt'altra cosa).
    Prova con $var= "" con gli apici doppi
    Scusa, potrei sapere che funzione viene sfruttata???

    Che sappia io

    $a = "testo";

    è esattamente uguale a

    $a = 'testo';

    E ti giuro che di php ne ho macinato.

    Comunque, constatato che l'errore non è lì, come giustamente diceva MacApp, va controllato il percorso di Class.php ed eventualmente (aggiungo io) se si dispone dei diritti di lettura nella cartella e sul file

  10. #10
    No permessi chmod non c'è ne sono. Quà c'è il file class.php
    Codice PHP:
    <?if(!defined('OEC'))
        die(
    'Hacking attempt...');

    // my first attempt to apply OOP (object-oriented programming) in a script :) ...
    class loadinfo {
        
        function 
    above()
        {
            global 
    $page_title$themedir$info$context$scripturl$timeZone;
            
            echo 
    '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                <title>'
    ,$page_title,'</title>
                <link rel="stylesheet" href="'
    ,$themedir,'/default.css" type="text/css" />
            <body>'
    ;
            if(isset(
    $_SESSION['user']) && isset($_SESSION['password']))
            {
                
    $info -> get_invite();
                foreach(
    $context['invites'] as $invite)
                {
                    echo 
    '<p class="titlebg" align="center" style="font-size:x-small">',$invite['msg'],'

                    accept? [url="'
    ,$scripturl,'?action=inv&amp;do=accept&amp;id=',$invite['id'],'&amp;r=',$invite['r_id'],'&amp;sid=',session_id(),'"]Yes[/url] | 
                            [url="'
    ,$scripturl,'?action=inv&amp;do=decline&amp;id=',$invite['id'],'&amp;r=',$invite['r_id'],'&amp;sid=',session_id(),'"]No[/url]';
                }
                
                
    $info -> booted();
                foreach(
    $context['booted'] as $boot)
                {
                    
    $newTime $boot['exp_time'] + ($timeZone 60 60);
                    if(
    time() < ($boot['exp_time']))
                    {
                        die(
    '<p class="catbg">Booted!</p>
                                <p class="windowbg">Sorry '
    .$context['member']['name'].' you have been booted from this room

                                REASON: '
    .$boot['reason'].'</p>

    Boot expires: '
    .(date('D, M j , H:i:s',$newTime)).'</p>');
                    }
                }
            }
        
        }

        function 
    wap_above()
        {
            global 
    $page_title$info$context$timeZone;

            echo 
    '<?xml version="1.0" encoding="iso-8859-1"?>
            <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
            <wml>
                <card title="'
    ,$page_title,'">';
            if(isset(
    $_SESSION['user']) && isset($_SESSION['password']))
            {
                
    $info -> get_invite();
                foreach(
    $context['invites'] as $invite)
                {
                    echo 
    '

    [size="1"]'
    ,$invite['msg'],'[/size]</p>';
                }
                
                
    $info -> booted();
                foreach(
    $context['booted'] as $boot)
                {
                    if(
    time() < ($boot['exp_time']))
                    {
                        
    $newTime $boot['exp_time'] + ($timeZone 60 60);
                        die(
    '

    [b][size="1"]Booted![/size][/b]</p>
                                

    Sorry '
    .$context['member']['name'].' you have been booted from this room

                                REASON: '
    .$boot['reason'].'</p>

    Boot expires: '
    . (date('D, M j , H:i:s',$newTime)).'</p></card></wml>');
                    }
                }
            }
        
        }
        
        function 
    member_data()
        {
            global 
    $db_prefix$context;

            
    $result mysql_query("SELECT m.memberName, m.memberID, m.membergroupID, m.banned, m.email, m.gender, m.dateRegistered, m.Posts,
                              m.Browser, m.IP, m.color, g.ID_GROUP, g.groupName
                              FROM 
    {$db_prefix}members AS m
                              LEFT JOIN 
    {$db_prefix}membergroups AS g ON (ID_GROUP = membergroupID)
                              WHERE memberName = '
    {$_SESSION['user']}'
                              LIMIT 1"
    ) or die(mysql_error());
            while(
    $row mysql_fetch_assoc($result))
            {
                
    $context['member']['id'] = $row['memberID'];
                
    $context['member']['name'] = $row['memberName'];
                
    $context['member']['group'] = $row['groupName'];
                
    $context['member']['groupID'] = $row['ID_GROUP'];
                
    $context['member']['email'] = $row['email'];
                
    $context['member']['gender'] = $row['gender'];
                
    $context['member']['registered'] = $row['dateRegistered'];
                
    $context['member']['posts'] = $row['Posts'];
                
    $context['member']['browser'] = $row['Browser'];
                
    $context['member']['ip'] = $row['IP'];
                
    $context['member']['color'] = $row['color'];
                
    $context['member']['banned'] = $row['banned'];
            }
            
    mysql_free_result($result);
        }
        
        function 
    update_member_data($member)
        {
            global 
    $scripturl$context$error$page_title$db_prefix$info;
            
            if(isset(
    $_POST['password']) && $_POST['password1'])
                {
                    if(
    strlen($_POST['password']) <=4)
                    
    $error 'password too short!';
                    if(
    $_POST['password'] != $_POST['password1'])
                    
    $profile_error .= 'password did not match!';
                    
    $password_hash md5($_POST['password']);
                }
                else
                {
                    
    $password_hash $member['password'];
                }
                if(isset(
    $_POST['about']))
                
    $about = ($_POST['about']);
                if(
    strlen($about) > 300)
                
    $profile_error '

    Your [b]About[/b] Description, exceeds 300 characters...
    </p>'
    ;
                if(isset(
    $_POST['gender']))
                
    $gender $_POST['gender'];
                if(isset(
    $_POST['location']))
                
    $location $_POST['location'];
                if(isset(
    $_POST['photo']))
                
    $pic $_POST['photo'];
                if(isset(
    $_POST['color']))
                
    $color $_POST['color'];

                if(isset(
    $profile_error))
                {
                    echo 
    $profile_error'

    [url="'
    .$scripturl.'?u='.$user['id'].'&amp;action=profile&amp;do=settings"]« Back[/url]</p>';
                }
                else
                {
                    
    mysql_query("UPDATE
                                
    {$db_prefix}members
                                SET email = '
    {$_POST['email']}', password = '$password_hash', gender = '$gender', location = '$location', about = '{$_POST['about']}', pic = '{$_POST['photo']}', color = '$color', membergroupID = '$_POST[group]'
                                WHERE memberName = '
    {$member['name']}'
                                OR memberID = '
    {$member['id']}'") or die(mysql_error());
                    if(
    WAP)
                    {
                        echo 
    '<card title="Processing...">
                                <onevent type="ontimer">
                                    <go href="'
    $scripturl'?action=profile&amp;wap&amp;sid=',session_id(),'" method="get"></go>
                                </onevent><timer value="20"/>
                                

    Processing your request, please wait...</p>
                                <p align="center">[url="'
    ,$scripturl,'?action=profile&amp;u=',$_GET['u'],'&amp;wap&amp;sid=',session_id(),'"]View Profile[/url]</p>
                             </card>'
    ;
                    }
                    else{
                    echo 
    '<p class="titlebg">Profile Updated</p>
                          <p align="center">[url="'
    ,$scripturl,'?action=profile&amp;u=',$_GET['u'],'&amp;sid=',session_id(),'"]&gt;&gt;View Profile&lt;&lt;[/url]</p>';
                    }
                }
        }
        
        function 
    cleanRequest()
        {
            if(!
    get_magic_quotes_gpc())
            {
                
    $_GET array_map('trim'$_GET);
                
    $_POST array_map('trim'$_POST);
                
    $_COOKIE array_map('trim'$_COOKIE);
                
                
    $_GET array_map('addslashes'$_GET);
                
    $_POST array_map('addslashes'$_POST);
                
    $_COOKIE array_map('addslashes'$_COOKIE);
            }
        }
        
        function 
    write_logs()
        {
            global 
    $db_prefix$context$room;
            
            
    // Checks if the user has been logged already
            
    $query mysql_query("SELECT count(*)
                                        FROM 
    {$db_prefix}online
                                        WHERE member_Name = '
    {$context['member']['name']}'
                                        AND ID_Room = '
    $room'
                                        OR ID_Room = '0'"
    ) or die(mysql_error());
                    
    $in mysql_fetch_array($query);
                    
    // put them in the online list
                    
    if($in['count(*)'] == 0)
                    {
                        if(!
    $room == 0)
                        {
                            
    mysql_query("INSERT
                                        INTO 
    {$db_prefix}online
                                        (time, member_Name, ID_Room)
                                        VALUES('"
    .time()."','{$context['member']['name']}','$room')");
                        }
                        else {
                        
    mysql_query("INSERT
                                    INTO 
    {$db_prefix}online
                                    (time, member_Name, ID_Room)
                                    VALUES('"
    .time()."','{$context['member']['name']}','0')");
                        }
                    }
                    
    // or update their online status
                    
    else
                    {
                        
    mysql_query("UPDATE
                                     
    {$db_prefix}online
                                     SET time = '"
    .time()."', ID_Room = '$room'
                                     WHERE member_Name = '
    {$context['member']['name']}'");
                        
                        
    mysql_query("UPDATE
                                    
    {$db_prefix}online
                                    SET time = '"
    .time()."', ID_Room = '0'
                                    WHERE member_Name = 
    {$context['member']['name']}'");
                    }
                
                    
    mysql_query("UPDATE
                                
    {$db_prefix}members
                                SET Browser = '"
    .$_SERVER['HTTP_USER_AGENT']."', IP = '".$_SERVER['REMOTE_ADDR']."', lastLogin = '".time()."'
                                WHERE memberName = '
    {$context['member']['name']}'");
        }
        
        function 
    cleanup()
        {
            global 
    $db_prefix;

            
    mysql_query("
                DELETE
                FROM 
    {$db_prefix}messages
                WHERE time<'"
    .(time()-300)."'
                LIMIT 1"
    );
        
            
    mysql_query("DELETE
                        FROM 
    {$db_prefix}online
                        WHERE time<'"
    .(time()-4)."'");
        }
        
        function 
    banned()
        {
        
            
    // Dont cache this error
            
    header('Expires: Tue, 17 Dec 1986 03:00:00 GMT');
            
    header('Last-Modified: 'gmdate('D, d M Y H:i:s') . ' GMT');
            
    header('Cache-Control: no-cache, no-store, must-revalidate');
        
            if(isset(
    $_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !==false)
            {
                echo 
    '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
                    <html xmlns="http://www.w3.org/1999/xhtml">
                        <head>
                        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                            <title>Banned</title>
                        </head>
                        <body>
                            <h2>Banned!!</h2>
                            Sorry '
    ,$_SESSION['user'],' you have been banned from using this chat system, please contact the site administrator.
                        </body>
                    </html>'
    ;
            }
            else
            {
                
    header('Content-Type: text/vnd.wap.wml');
                echo 
    '<?xml version="1.0"?>
                <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.xml">
                <wml>
                    <card title="Banned">
                        

    [b]Banned!![/b]
    </p>
                        

    Sorry '
    ,$_SESSION['user'],' you have been banned from using this chat system, please contact the site administrator.</p>
                    </card>
                </wml>'
    ;
            }
        }
        
        function 
    db_error()
        {
            global 
    $site_title;
            
            
    // Dont cache this error
            
    header('Expires: Tue, 17 Dec 1986 03:00:00 GMT');
            
    header('Last-Modified: 'gmdate('D, d M Y H:i:s') . ' GMT');
            
    header('Cache-Control: no-cache, no-store, must-revalidate');
        
            if(isset(
    $_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !==false)
            {

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.