Author |
Message |
27/07/2005 22:53:47
|
Anonymous
|
When entering guestbook following error appears at the top:
Parse error: parse error, unexpected '&', expecting T_STRING or T_VARIABLE or '{' or '$' in /home/turtlesj/public_html/dirtydolls/guestbook/lib/mysql.class.php on line 20
|
|
27/07/2005 23:58:47
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Surely the title of this thread answers your problem
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
28/07/2005 08:03:29
|
Anonymous
|
can help me to edit for error
Parse error: parse error, unexpected '&', expecting T_STRING or T_VARIABLE or '{' or '$' in /home/turtlesj/public_html/dirtydolls/guestbook/lib/mysql.class.php on line 20
|
|
28/07/2005 08:12:01
|
Anonymous
|
this error in my guestbook
code:
Parse error: parse error, unexpected '&', expecting T_STRING or T_VARIABLE or '{' or '$' in /home/turtlesj/public_html/dirtydolls/guestbook/lib/mysql.class.php on line 20
Below is a copy of my my sql class file
code:
<?php
/**
* ----------------------------------------------
* Advanced Guestbook 2.3.1 (PHP/MySQL)
* Copyright (c)2001 Chi Kien Uong
* URL: http://www.proxy2.de
* ----------------------------------------------
*/
class gbook_sql {
var $conn_id;
var $result;
var $record;
var $db = array();
var $port;
function gbook_sql() {
global $GB_DB;
$this->db =& $GB_DB;
if(ereg(":",$this->db['host'])) {
list($host,$port) = explode(":",$this->db['host']);
$this->port = $port;
} else {
$this->port = 3306;
}
}
function connect() {
$this->conn_id = mysql_connect($this->db['host'].":".$this->port,$this->db['user'],$this->db['pass']);
if ($this->conn_id == 0) {
$this->sql_error("Connection Error");
}
if (!mysql_select_db($this->db['dbName'], $this->conn_id)) {
$this->sql_error("Database Error");
}
return $this->conn_id;
}
function query($query_string) {
$this->result = mysql_query($query_string,$this->conn_id);
if (!$this->result) {
$this->sql_error("Query Error");
}
return $this->result;
}
function fetch_array($query_id) {
$this->record = mysql_fetch_array($query_id,MYSQL_ASSOC);
return $this->record;
}
function num_rows($query_id) {
return ($query_id) ? mysql_num_rows($query_id) : 0;
}
function num_fields($query_id) {
return ($query_id) ? mysql_num_fields($query_id) : 0;
}
function free_result($query_id) {
return mysql_free_result($query_id);
}
function affected_rows() {
return mysql_affected_rows($this->conn_id);
}
function close_db() {
if($this->conn_id) {
return mysql_close($this->conn_id);
} else {
return false;
}
}
function sql_error($message) {
global $TEC_MAIL;
$description = mysql_error();
$number = mysql_errno();
$error ="MySQL Error : $message\n";
$error.="Error Number: $number $description\n";
$error.="Date : ".date("D, F j, Y H:i:s")."\n";
$error.="IP : ".getenv("REMOTE_ADDR")."\n";
$error.="Browser : ".getenv("HTTP_USER_AGENT")."\n";
$error.="Referer : ".getenv("HTTP_REFERER")."\n";
$error.="PHP Version : ".PHP_VERSION."\n";
$error.="OS : ".PHP_OS."\n";
$error.="Server : ".getenv("SERVER_SOFTWARE")."\n";
$error.="Server Name : ".getenv("SERVER_NAME")."\n";
echo "<b><font size=4 face=Arial>$message</font></b><hr>";
echo "<pre>$error</pre>";
if (eregi("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\\.)+[a-z]{2,5}$", $TEC_MAIL) ) {
$headers = "From: ".$this->db['user']."@".$this->db['host']."\nX-Mailer: Advanced Guestbook 2";
// @mail("$TEC_MAIL","Guestbook - Error","$error","$headers");
}
exit();
}
}
?>
|
|
28/07/2005 10:23:48
|
Anonymous
|
The line in question is $this->db =& $GB_DB;. I'll look into it when I get home.
|
|
28/07/2005 12:45:00
|
Anonymous
|
yes , the line is $this->db =& $GB_DB; , why about line is error, please give me to answer ?
|
|
28/07/2005 13:48:16
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
The code is correct. It's a check. Did you make any changes just before this happened?
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
28/07/2005 14:58:07
|
Anonymous
|
no, i'm not a change the code.
|
|
29/07/2005 09:42:59
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
The you posted file is correct. Check the database information in the config.inc.php file.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
|