1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

help me on php error

Discussion in 'PHP' started by talker1, Aug 5, 2011.

  1. #1
    
    <?php
    class database
        {
        var $Host = null;
        var $UserName = null;
        var $Password = null;
        var $DatabaseName = null;
        var $Error = null;
        var $Warning = null;
        var $Success = null;
        function __construct()
            {
            if (file_exists('connect.php'))
                {
                require_once('connect.php');
                }
            else
                {
                require_once('../connect.php');
                }
            if ((defined('DB_CRYPT') && DB_CRYPT))
                {
                $this->Host         = (defined('DB_HOST') ? $this->crypto(DB_HOST, 'jeroenblox') : '');
                $this->UserName     = (defined('DB_USERNAME') ? $this->crypto(DB_USERNAME, 'jeroenblox') : '');
                $this->Password     = (defined('DB_PASSWORD') ? $this->crypto(DB_PASSWORD, 'jeroenblox') : '');
                $this->DatabaseName = (defined('DB_NAME') ? $this->crypto(DB_NAME, 'jeroenblox') : '');
                }
            else
                {
                $this->Host         = (defined('DB_HOST') ? DB_HOST : '');
                $this->UserName     = (defined('DB_USERNAME') ? DB_USERNAME : '');
                $this->Password     = (defined('DB_PASSWORD') ? DB_PASSWORD : '');
                $this->DatabaseName = (defined('DB_NAME') ? DB_NAME : '');
                }
            $this->Error     = array();
            $this->Warning   = array();
            $this->Success   = array();
            $this->Connected = false;
            if ($this->connect())
                {
                $this->Connected = true;
                }
            }
        function connect()
            {
            @header('Content-type: text/html; charset=utf-8');
            if (!function_exists('mb_internal_encoding'))
                {
                exit('<html><head><title>Foutmelding</title><style type="text/css">body{margin:40px;font-family:Verdana;font-size:12px;color:#000;}#content{border:1px solid #999;background-color:#fff;padding: 25px;width:600px;position:absolute;left:50%;margin-left:-300px;}a{color:#000099;}h1{font-weight:normal;font-size:14px;color:#990000;margin:0 0 4px 0;}</style></head><body><div id="content"><h1>Uw server heeft geen ondersteuning voor multibyte string.</h1>Laat uw serverbeheerder kijken op <a href="http://www.php.net/manual/en/book.mbstring.php">http://www.php.net/manual/en/book.mbstring.php</a> voor meer informatie om uw server geschikt te maken voor het gebruik van WeFact Hosting.<br /><br />Zodra ondersteuning voor multibyte string is geactiveerd, kunt u verder met de installatie van WeFact Hosting.</div></body></html>');
                }
            else
                {
                @mb_internal_encoding('UTF-8');
                }
            if (!@mysql_connect($this->Host, $this->UserName, $this->Password))
                {
                $this->Error[] = "MySQL-server-connection problem";
                }
            if (!@mysql_select_db($this->DatabaseName))
                {
                $this->Error[] = "MySQL-database-connection problem";
                }
            if (count($this->Error) == 0)
                {
                $this->Connected = true;
                $q               = @mysql_query('SELECT @@SESSION.sql_mode as Modus');
                $v               = @mysql_fetch_assoc($q);
                if (strpos(strtolower($v['Modus']), 'strict') !== false)
                    {
                    exit('<html><head><title>Foutmelding</title><style type="text/css">body{margin:40px;font-family:Verdana;font-size:12px;color:#000;}#content{border:1px solid #999;background-color:#fff;padding: 25px;width:600px;position:absolute;left:50%;margin-left:-300px;}a{color:#000099;}h1{font-weight:normal;font-size:14px;color:#990000;margin:0 0 4px 0;}</style></head><body><div id="content"><h1>Uw MySQL-server draait in strict modus.</h1>Laat uw serverbeheerder de modus waarin MySQL draait veranderen, zodat deze niet in strict modus draait.<br /><br />Zodra de modus is gewijzigd, kunt u verder met WeFact Hosting.</div></body></html>');
                    }
                @mysql_query('SET collation_connection = \'utf8_general_ci\', CHARACTER SET \'utf8\', NAMES \'utf8\', collation_server = \'utf8_general_ci\', character_set_server = \'utf8\', character_set_results = \'utf8\', character_set_database = \'utf8\', character_set_connection = \'utf8\', character_set_client = \'utf8\', collation_database = \'utf8_general_ci\'');
                }
            return (0 < count($this->Error) ? false : true);
            }
        function close()
            {
            @mysql_close();
            }
        function query($sql)
            {
            if (!($qry = @mysql_query($sql)))
                {
                $this->Error[] = $this->Connected ? parse_error(__FILE__, 'database', mysql_error(), mysql_errno(), 'invalid query', array(
                    $sql,
                    mysql_error()
                )) : 'MySQL-fout: ' . mysql_error();
                }
            return $qry;
            }
        function getError()
            {
            return $db->Error;
            }
        function crypto($str, $ky = '')
            {
            $ori_str = $str;
            if ($ky == '')
                {
                return $str;
                }
            $ky = str_replace(chr(32), '', $ky);
            if (strlen($ky) < 8)
                {
                exit('key error');
                }
            $kl = (strlen($ky) < 32 ? strlen($ky) : 32);
            $k  = array();
            $i  = 0;
            while ($i < $kl)
                {
                $k[$i] = ord($ky[$i]) & 31;
                ++$i;
                }
            $j = 0;
            $i = 0;
            while ($i < strlen($str))
                {
                $e       = ord($str[$i]);
                $str[$i] = ($e & 224 ? chr($e ^ $k[$j]) : chr($e));
                ++$j;
                $j = ($j == $kl ? 0 : $j);
                ++$i;
                }
            if ((trim($str) != $str || rtrim($str) != $str))
                {
                $str = 'AA' . $ori_str . 'AA';
                $j   = 0;
                $i   = 0;
                while ($i < strlen($str))
                    {
                    $e       = ord($str[$i]);
                    $str[$i] = ($e & 224 ? chr($e ^ $k[$j]) : chr($e));
                    ++$j;
                    $j = ($j == $kl ? 0 : $j);
                    ++$i;
                    }
                }
            if ((substr($str, 0, 2) == 'AA' && substr($str, 0 - 2) == 'AA'))
                {
                $str = substr($str, 2, 0 - 2);
                }
            return $str;
            }
        }
    $db = new database();
    if (file_exists('class/settings.php'))
        {
        require_once('class/settings.php');
        }
    else
        {
        echo 'Kan settings.php niet vinden.';
        exit();
        }
    $settings = new settings();
    $settings->show();
    if (file_exists('language/language.php'))
        {
        require_once('language/language.php');
        }
    echo 'Kan language.php niet vinden.';
    exit();
    ?>
    
    PHP:
    error is line 87

    $this->Error[] = $this->Connected ? parse_error(__FILE__, 'database', mysql_error(), mysql_errno(), 'invalid query', array(
    $sql,
    mysql_error()
    )) : 'MySQL-fout: ' . mysql_error();


    Thank you
     
    talker1, Aug 5, 2011 IP
  2. Thorlax402

    Thorlax402 Member

    Messages:
    194
    Likes Received:
    2
    Best Answers:
    5
    Trophy Points:
    40
    #2
    "parse_error()" is not a defined php function.
     
    Thorlax402, Aug 5, 2011 IP
  3. sinha.sidhi

    sinha.sidhi Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes there is not defined parse_error() php function.
     
    sinha.sidhi, Aug 29, 2011 IP