• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

REG_BADRPT Error message

Question

kickAss001    0

I am having a problem with my guestbook in that when people sign the guestbook, it comes up with this message:

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Warning: eregi_replace(): REG_BADRPT in /home/benash8y/public_html/Guestbook/lib/vars.class.php on line 135

Can anyone help me ressolve this?

Thanks,

Ben

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
John    7

Moved to Web Programming

Could you post your code? Specifically, around line 135 in that file?

Share this post


Link to post
Share on other sites
  • 0
kickAss001    0
Moved to Web Programming

Could you post your code? Specifically, around line 135 in that file?

585900223[/snapback]

The code for line 135 is:

$strg = eregi_replace($row["word"], $replace, $strg);

The code for the whole page is:

<?php
/**
 * ----------------------------------------------
 * Advanced Guestbook 2.3.1 (PHP/MySQL)
 * Copyright ?2001 Chi Kien Uong
 * URL: [url=http://www.proxy2.de]http://www.proxy2.de[/url]
 * ----------------------------------------------
 */

class guestbook_vars extends gbook_sql {

    var $VARS;
    var $LANG;
    var $table = array();
    var $GB_TPL = array();
    var $SMILIES;
    var $template;

    function guestbook_vars($path='') {
        global $GB_TPL,$GB_TBL;
        $this->table =& $GB_TBL;
        $this->GB_TPL =& $GB_TPL;
        $this->gbook_sql();
        $this->connect();
        $this->template = new gb_template($path);
    }

    function getVars() {
        global $HTTP_COOKIE_VARS;
        $this->VARS = $this->fetch_array($this->query("SELECT * FROM ".$this->table['cfg']));
        $this->free_result($this->result);
        if (isset($HTTP_COOKIE_VARS['lang']) && !empty($HTTP_COOKIE_VARS['lang'])) {
            $this->template->set_lang($HTTP_COOKIE_VARS['lang']);
        } else {
            $this->template->set_lang($this->VARS["lang"]);
        }
        $this->LANG =& $this->template->get_content();
        return $this->VARS;
    }

    function emotion($message) {
        global $GB_PG;
        if (!isset($this->SMILIES)) {
            $this->query("SELECT * FROM ".$this->table['smile']);
            while ($this->fetch_array($this->result)) {
                $this->SMILIES[$this->record['s_code']] = "<img src=\"$GB_PG[base_url]/img/smilies/".$this->record['s_filename']."\" width=\"".$this->record['width']."\" height=\"".$this->record['height']."\">";
            }
        }
        if (isset($this->SMILIES)) {
            for(reset($this->SMILIES); $key=key($this->SMILIES); next($this->SMILIES)) {
                $message = str_replace("$key",$this->SMILIES[$key],$message);
            }
        }
        return $message;
    }

    function DateFormat($timestamp) {
        $timestamp += $this->VARS["offset"]*3600;
        list($wday,$mday,$month,$year,$hour,$minutes,$hour12,$ampm) = split("( )",date("w j n Y H i h A",$timestamp));
        if ($this->VARS["tformat"] == "AMPM") {
            $newtime = " $hour12:$minutes $ampm";
        } else {
            $newtime = " $hour:$minutes";
        }
        if ($this->VARS["dformat"] == "USx") {
            $newdate = " $month-$mday-$year";
        } elseif ($this->VARS["dformat"] == "US") {
            $month -= 1;
            $newdate = $this->template->WEEKDAY[$wday].", ".$this->template->MONTHS[$month]." $mday, $year";
        } elseif ($this->VARS["dformat"] == "Euro") {
            $month -= 1;
            $newdate = $this->template->WEEKDAY[$wday].", $mday. ".$this->template->MONTHS[$month]." $year";
        } else {
            $newdate = "$mday.$month.$year";
        }
        return ($newdate=$newdate.$newtime);
    }

    function AGCode($string) {
        $string=eregi_replace("\\[img\\](http://[^\\[]+)\\[/img\\]","<img src=\"\\1\" border=0>",$string);
        $string=eregi_replace("\\[b\\]([^\\[]*)\\[/b\\]","<b>\\1</b>",$string);
        $string=eregi_replace("\\[i\\]([^\\[]*)\\[/i\\]","<i>\\1</i>",$string);
        $string=eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\1</a>",$string);
        $string=eregi_replace("\\[url\\]www.([^\\[]*)\\[/url\\]","<a href=\"http://www.\\1\" target=\"_blank\">\\1</a>",$string);
        $string=eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\1</a>",$string);
        $string=eregi_replace("\\[url=http://([^\\[]+)\\]([^\\[]*)\\[/url\\]","<a href=\"http://\\1\" target=\"_blank\">\\2</a>",$string);
        return $string;
    }

    function FormatString($strg) {
        $strg = trim($strg);
        $strg = ereg_replace("[ ]+", " ", $strg);
        return $strg;
    }

    function CheckWordLength($strg) {
        $word_array = split ("[ |\n]",$strg);
        for ($i=0;$i<sizeof($word_array);$i++) {
            if (ereg("^\\[[a-z]{3,5}\\].+\\]",$word_array[$i])) {
                if (strlen($word_array[$i]) > 200) {
                    return false;
                }
            } elseif (strlen($word_array[$i]) > $this->VARS["max_word_len"]) {
                return false;
            }
        }
        return true;
    }

    function isBannedIp($ip) {
        $this->query("SELECT * from ".$this->table['ban']);
        if (!$this->result) {
            return false;
        }
        while ($row = $this->fetch_array($this->result)) {
            if (ereg("^$row[ban_ip]",$ip)) {
                return true;
            }
        }
        return false;
    }

    function FloodCheck($ip) {
        $the_time = time()-$this->VARS["flood_timeout"];
        $this->query("DELETE FROM ".$this->table['ip']." WHERE (timestamp < $the_time)");
        $this->query("SELECT * FROM ".$this->table['ip']." WHERE (guest_ip = '$ip')");
        $this->fetch_array($this->result);
        return ($this->record) ? true : false;
    }

    function CensorBadWords($strg) {
        $replace = "#@*%!";
        $this->query("select * from ".$this->table['words']);
        while ($row = $this->fetch_array($this->result)) {
        $strg = eregi_replace($row["word"], $replace, $strg);
        }
        return $strg;
    }

    function gb_error($ERROR) {
        global $GB_PG;
        $LANG =& $this->LANG;
        $VARS =& $this->VARS;
        eval("\$error_html = \"".$this->template->get_template($this->GB_TPL['header'])."\";");
        eval("\$error_html .= \"".$this->template->get_template($this->GB_TPL['error'])."\";");
        eval("\$error_html .= \"".$this->template->get_template($this->GB_TPL['footer'])."\";");
        return $error_html;
    }

}

?>

Code box added>

Edited by John

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.