Page 1 of 1

problems installing word press blogger software

Posted: Wed Jul 06, 2005 8:53 pm
by bruceg
I unzipped the wordpress code and uploaded to my server where I am supposed to be able to start using the software right away, but I get an error. Example page is :

http://www.inspired-evolution.com/wordpress/

the error is:

Parse error: parse error, unexpected $ in /hsphere/local/home/bruceg/inspired-evolution.com/wordpress/wp-includes/wp-db.php on line 348

php code is

Code: Select all

<?php
//  WordPress DB Class

//  ORIGINAL CODE FROM:
//  Justin Vincent (justin@visunet.ie)
//	http://php.justinvincent.com

define('EZSQL_VERSION', 'WP1.25');
define('OBJECT', 'OBJECT', true);
define('ARRAY_A', 'ARRAY_A', false);
define('ARRAY_N', 'ARRAY_N', false);

if (!defined('SAVEQUERIES'))
	define('SAVEQUERIES', false);

class wpdb {

	var $show_errors = true;
	var $num_queries = 0;	
	var $last_query;
	var $col_info;
	var $queries;

	// Our tables
	var $posts;
	var $users;
	var $categories;
	var $post2cat;
	var $comments;
	var $links;
	var $linkcategories;
	var $options;
	var $optiontypes;
	var $optionvalues;
	var $optiongroups;
	var $optiongroup_options;
	var $postmeta;

	// ==================================================================
	//	DB Constructor - connects to the server and selects a database

	function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
		$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
		if (!$this->dbh) {
			$this->bail("
<h1>Error establishing a database connection</h1>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at &lt;code&gt;$dbhost&lt;/code&gt;. This could mean your host's database server is down.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Are you sure you have the correct username and password?&lt;/li&gt;
	&lt;li&gt;Are you sure that you have typed the correct hostname?&lt;/li&gt;
	&lt;li&gt;Are you sure that the database server is running?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;
&quote;);
		}

		$this-&gt;select($dbname);
	}

	// ==================================================================
	//	Select a DB (if another one needs to be selected)

	function select($db) {
		if (!@mysql_select_db($db, $this-&gt;dbh)) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Can&#8217;t select database&lt;/h1&gt;
&lt;p&gt;We were able to connect to the database server (which means your username and password is okay) but not able to select the &lt;code&gt;$db&lt;/code&gt; database.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are you sure it exists?&lt;/li&gt;
&lt;li&gt;On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you don't know how to setup a database you should &lt;strong&gt;contact your host&lt;/strong&gt;. If all else fails you may find help at the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;&quote;);
		}
	}

	// ====================================================================
	//	Format a string correctly for safe insert under all PHP conditions
	
	function escape($str) {
		return addslashes($str);				
	}

	// ==================================================================
	//	Print SQL/DB error.

	function print_error($str = '') {
		global $EZSQL_ERROR;
		if (!$str) $str = mysql_error();
		$EZSQL_ERROR&#1111;] = 
		array ('query' =&gt; $this-&gt;last_query, 'error_str' =&gt; $str);

		// Is error output turned on or not..
		if ( $this-&gt;show_errors ) {
			// If there is an error then take note of it
			print &quote;&lt;div id='error'&gt;
			&lt;p class='wpdberror'&gt;&lt;strong&gt;WordPress database error:&lt;/strong&gt; &#1111;$str]&lt;br /&gt;
			&lt;code&gt;$this-&gt;last_query&lt;/code&gt;&lt;/p&gt;
			&lt;/div&gt;&quote;;
		} else {
			return false;	
		}
	}

	// ==================================================================
	//	Turn error handling on or off..

	function show_errors() {
		$this-&gt;show_errors = true;
	}
	
	function hide_errors() {
		$this-&gt;show_errors = false;
	}

	// ==================================================================
	//	Kill cached query results

	function flush() {
		$this-&gt;last_result = null;
		$this-&gt;col_info = null;
		$this-&gt;last_query = null;
	}

	// ==================================================================
	//	Basic Query	- see docs for more detail

	function query($query) {
		// initialise return
		$return_val = 0;
		$this-&gt;flush();

		// Log how the function was called
		$this-&gt;func_call = &quote;\$db-&gt;query(\&quote;$query\&quote;)&quote;;

		// Keep track of the last query for debug..
		$this-&gt;last_query = $query;

		// Perform the query via std mysql_query function..
		if (SAVEQUERIES)
			$this-&gt;timer_start();
		
		$this-&gt;result = @mysql_query($query, $this-&gt;dbh);
		++$this-&gt;num_queries;

		if (SAVEQUERIES)
			$this-&gt;queries&#1111;] = array( $query, $this-&gt;timer_stop() );

		// If there is an error then take note of it..
		if ( mysql_error() ) {
			$this-&gt;print_error();
			return false;
		}

		if ( preg_match(&quote;/^\\s*(insert|delete|update|replace) /i&quote;,$query) ) {
			$this-&gt;rows_affected = mysql_affected_rows();
			// Take note of the insert_id
			if ( preg_match(&quote;/^\\s*(insert|replace) /i&quote;,$query) ) {
				$this-&gt;insert_id = mysql_insert_id($this-&gt;dbh);	
			}
			// Return number of rows affected
			$return_val = $this-&gt;rows_affected;
		} else {
			$i = 0;
			while ($i &lt; @mysql_num_fields($this-&gt;result)) {
				$this-&gt;col_info&#1111;$i] = @mysql_fetch_field($this-&gt;result);
				$i++;
			}
			$num_rows = 0;
			while ( $row = @mysql_fetch_object($this-&gt;result) ) {
				$this-&gt;last_result&#1111;$num_rows] = $row;
				$num_rows++;
			}

			@mysql_free_result($this-&gt;result);

			// Log number of rows the query returned
			$this-&gt;num_rows = $num_rows;
			
			// Return number of rows selected
			$return_val = $this-&gt;num_rows;
		}

		return $return_val;
	}

	// ==================================================================
	//	Get one variable from the DB - see docs for more detail

	function get_var($query=null, $x = 0, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_var(\&quote;$query\&quote;,$x,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		// Extract var out of cached results based x,y vals
		if ( $this-&gt;last_result&#1111;$y] ) {
			$values = array_values(get_object_vars($this-&gt;last_result&#1111;$y]));
		}

		// If there is a value return it else return null
		return (isset($values&#1111;$x]) &amp;&amp; $values&#1111;$x]!=='') ? $values&#1111;$x] : null;
	}

	// ==================================================================
	//	Get one row from the DB - see docs for more detail

	function get_row($query = null, $output = OBJECT, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_row(\&quote;$query\&quote;,$output,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		if ( $output == OBJECT ) {
			return $this-&gt;last_result&#1111;$y] ? $this-&gt;last_result&#1111;$y] : null;
		} elseif ( $output == ARRAY_A ) {
			return $this-&gt;last_result&#1111;$y] ? get_object_vars($this-&gt;last_result&#1111;$y]) : null;
		} elseif ( $output == ARRAY_N ) {
			return $this-&gt;last_result&#1111;$y] ? array_values(get_object_vars($this-&gt;last_result&#1111;$y])) : null;
		} else {
			$this-&gt;print_error(&quote; \$db-&gt;get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N&quote;);
		}
	}

	// ==================================================================
	//	Function to get 1 column from the cached result set based in X index
	// se docs for usage and info

	function get_col($query = null , $x = 0) {
		if ( $query )
			$this-&gt;query($query);

		// Extract the column values
		for ( $i=0; $i &lt; count($this-&gt;last_result); $i++ ) {
			$new_array&#1111;$i] = $this-&gt;get_var(null, $x, $i);
		}
		return $new_array;
	}

	// ==================================================================
	// Return the the query as a result set - see docs for more details

	function get_results($query = null, $output = OBJECT) {
		$this-&gt;func_call = &quote;\$db-&gt;get_results(\&quote;$query\&quote;, $output)&quote;;

		if ( $query )
			$this-&gt;query($query);

		// Send back array of objects. Each row is an object
		if ( $output == OBJECT ) {
			return $this-&gt;last_result;
		} elseif ( $output == ARRAY_A || $output == ARRAY_N ) {
			if ( $this-&gt;last_result ) {
				$i = 0;
				foreach( $this-&gt;last_result as $row ) {
					$new_array&#1111;$i] = (array) $row;
					if ( $output == ARRAY_N ) {
						$new_array&#1111;$i] = array_values($new_array&#1111;$i]);
					}
					$i++;
				}
				return $new_array;
			} else {
				return null;
			}
		}
	}


	// ==================================================================
	// Function to get column meta data info pertaining to the last query
	// see docs for more info and usage

	function get_col_info($info_type = 'name', $col_offset = -1) {
		if ( $this-&gt;col_info ) {
			if ( $col_offset == -1 ) {
				$i = 0;
				foreach($this-&gt;col_info as $col ) {
					$new_array&#1111;$i] = $col-&gt;{$info_type};
					$i++;
				}
				return $new_array;
			} else {
				return $this-&gt;col_info&#1111;$col_offset]-&gt;{$info_type};
			}
		}
	}

	function timer_start() {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$this-&gt;time_start = $mtime&#1111;1] + $mtime&#1111;0];
		return true;
	}
	
	function timer_stop($precision = 3) {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$time_end = $mtime&#1111;1] + $mtime&#1111;0];
		$time_total = $time_end - $this-&gt;time_start;
		return $time_total;
	}

	function bail($message) { // Just wraps errors in a nice header and footer
	if ( !$this-&gt;show_errors )
		return false;
	header( 'Content-Type: text/html; charset=utf-8');		
	echo &lt;&lt;&lt;HEAD
	&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD//wordpress/

the error is:

Parse error: parse error, unexpected $ in /hsphere/local/home/bruceg/inspired-evolution.com/wordpress/wp-includes/wp-db.php on line 348

php code is

Code: Select all

<?php
//  WordPress DB Class

//  ORIGINAL CODE FROM:
//  Justin Vincent (justin@visunet.ie)
//	http://php.justinvincent.com

define('EZSQL_VERSION', 'WP1.25');
define('OBJECT', 'OBJECT', true);
define('ARRAY_A', 'ARRAY_A', false);
define('ARRAY_N', 'ARRAY_N', false);

if (!defined('SAVEQUERIES'))
	define('SAVEQUERIES', false);

class wpdb {

	var $show_errors = true;
	var $num_queries = 0;	
	var $last_query;
	var $col_info;
	var $queries;

	// Our tables
	var $posts;
	var $users;
	var $categories;
	var $post2cat;
	var $comments;
	var $links;
	var $linkcategories;
	var $options;
	var $optiontypes;
	var $optionvalues;
	var $optiongroups;
	var $optiongroup_options;
	var $postmeta;

	// ==================================================================
	//	DB Constructor - connects to the server and selects a database

	function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
		$this-&gt;dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
		if (!$this-&gt;dbh) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Error establishing a database connection&lt;/h1&gt;
&lt;p&gt;This either means that the username and password information in your &lt;code&gt;wp-config.php&lt;/code&gt; file is incorrect or we can't contact the database server at &lt;code&gt;$dbhost&lt;/code&gt;. This could mean your host's database server is down.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Are you sure you have the correct username and password?&lt;/li&gt;
	&lt;li&gt;Are you sure that you have typed the correct hostname?&lt;/li&gt;
	&lt;li&gt;Are you sure that the database server is running?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;
&quote;);
		}

		$this-&gt;select($dbname);
	}

	// ==================================================================
	//	Select a DB (if another one needs to be selected)

	function select($db) {
		if (!@mysql_select_db($db, $this-&gt;dbh)) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Can&#8217;t select database&lt;/h1&gt;
&lt;p&gt;We were able to connect to the database server (which means your username and password is okay) but not able to select the &lt;code&gt;$db&lt;/code&gt; database.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are you sure it exists?&lt;/li&gt;
&lt;li&gt;On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you don't know how to setup a database you should &lt;strong&gt;contact your host&lt;/strong&gt;. If all else fails you may find help at the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;&quote;);
		}
	}

	// ====================================================================
	//	Format a string correctly for safe insert under all PHP conditions
	
	function escape($str) {
		return addslashes($str);				
	}

	// ==================================================================
	//	Print SQL/DB error.

	function print_error($str = '') {
		global $EZSQL_ERROR;
		if (!$str) $str = mysql_error();
		$EZSQL_ERROR&#1111;] = 
		array ('query' =&gt; $this-&gt;last_query, 'error_str' =&gt; $str);

		// Is error output turned on or not..
		if ( $this-&gt;show_errors ) {
			// If there is an error then take note of it
			print &quote;&lt;div id='error'&gt;
			&lt;p class='wpdberror'&gt;&lt;strong&gt;WordPress database error:&lt;/strong&gt; &#1111;$str]&lt;br /&gt;
			&lt;code&gt;$this-&gt;last_query&lt;/code&gt;&lt;/p&gt;
			&lt;/div&gt;&quote;;
		} else {
			return false;	
		}
	}

	// ==================================================================
	//	Turn error handling on or off..

	function show_errors() {
		$this-&gt;show_errors = true;
	}
	
	function hide_errors() {
		$this-&gt;show_errors = false;
	}

	// ==================================================================
	//	Kill cached query results

	function flush() {
		$this-&gt;last_result = null;
		$this-&gt;col_info = null;
		$this-&gt;last_query = null;
	}

	// ==================================================================
	//	Basic Query	- see docs for more detail

	function query($query) {
		// initialise return
		$return_val = 0;
		$this-&gt;flush();

		// Log how the function was called
		$this-&gt;func_call = &quote;\$db-&gt;query(\&quote;$query\&quote;)&quote;;

		// Keep track of the last query for debug..
		$this-&gt;last_query = $query;

		// Perform the query via std mysql_query function..
		if (SAVEQUERIES)
			$this-&gt;timer_start();
		
		$this-&gt;result = @mysql_query($query, $this-&gt;dbh);
		++$this-&gt;num_queries;

		if (SAVEQUERIES)
			$this-&gt;queries&#1111;] = array( $query, $this-&gt;timer_stop() );

		// If there is an error then take note of it..
		if ( mysql_error() ) {
			$this-&gt;print_error();
			return false;
		}

		if ( preg_match(&quote;/^\\s*(insert|delete|update|replace) /i&quote;,$query) ) {
			$this-&gt;rows_affected = mysql_affected_rows();
			// Take note of the insert_id
			if ( preg_match(&quote;/^\\s*(insert|replace) /i&quote;,$query) ) {
				$this-&gt;insert_id = mysql_insert_id($this-&gt;dbh);	
			}
			// Return number of rows affected
			$return_val = $this-&gt;rows_affected;
		} else {
			$i = 0;
			while ($i &lt; @mysql_num_fields($this-&gt;result)) {
				$this-&gt;col_info&#1111;$i] = @mysql_fetch_field($this-&gt;result);
				$i++;
			}
			$num_rows = 0;
			while ( $row = @mysql_fetch_object($this-&gt;result) ) {
				$this-&gt;last_result&#1111;$num_rows] = $row;
				$num_rows++;
			}

			@mysql_free_result($this-&gt;result);

			// Log number of rows the query returned
			$this-&gt;num_rows = $num_rows;
			
			// Return number of rows selected
			$return_val = $this-&gt;num_rows;
		}

		return $return_val;
	}

	// ==================================================================
	//	Get one variable from the DB - see docs for more detail

	function get_var($query=null, $x = 0, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_var(\&quote;$query\&quote;,$x,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		// Extract var out of cached results based x,y vals
		if ( $this-&gt;last_result&#1111;$y] ) {
			$values = array_values(get_object_vars($this-&gt;last_result&#1111;$y]));
		}

		// If there is a value return it else return null
		return (isset($values&#1111;$x]) &amp;&amp; $values&#1111;$x]!=='') ? $values&#1111;$x] : null;
	}

	// ==================================================================
	//	Get one row from the DB - see docs for more detail

	function get_row($query = null, $output = OBJECT, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_row(\&quote;$query\&quote;,$output,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		if ( $output == OBJECT ) {
			return $this-&gt;last_result&#1111;$y] ? $this-&gt;last_result&#1111;$y] : null;
		} elseif ( $output == ARRAY_A ) {
			return $this-&gt;last_result&#1111;$y] ? get_object_vars($this-&gt;last_result&#1111;$y]) : null;
		} elseif ( $output == ARRAY_N ) {
			return $this-&gt;last_result&#1111;$y] ? array_values(get_object_vars($this-&gt;last_result&#1111;$y])) : null;
		} else {
			$this-&gt;print_error(&quote; \$db-&gt;get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N&quote;);
		}
	}

	// ==================================================================
	//	Function to get 1 column from the cached result set based in X index
	// se docs for usage and info

	function get_col($query = null , $x = 0) {
		if ( $query )
			$this-&gt;query($query);

		// Extract the column values
		for ( $i=0; $i &lt; count($this-&gt;last_result); $i++ ) {
			$new_array&#1111;$i] = $this-&gt;get_var(null, $x, $i);
		}
		return $new_array;
	}

	// ==================================================================
	// Return the the query as a result set - see docs for more details

	function get_results($query = null, $output = OBJECT) {
		$this-&gt;func_call = &quote;\$db-&gt;get_results(\&quote;$query\&quote;, $output)&quote;;

		if ( $query )
			$this-&gt;query($query);

		// Send back array of objects. Each row is an object
		if ( $output == OBJECT ) {
			return $this-&gt;last_result;
		} elseif ( $output == ARRAY_A || $output == ARRAY_N ) {
			if ( $this-&gt;last_result ) {
				$i = 0;
				foreach( $this-&gt;last_result as $row ) {
					$new_array&#1111;$i] = (array) $row;
					if ( $output == ARRAY_N ) {
						$new_array&#1111;$i] = array_values($new_array&#1111;$i]);
					}
					$i++;
				}
				return $new_array;
			} else {
				return null;
			}
		}
	}


	// ==================================================================
	// Function to get column meta data info pertaining to the last query
	// see docs for more info and usage

	function get_col_info($info_type = 'name', $col_offset = -1) {
		if ( $this-&gt;col_info ) {
			if ( $col_offset == -1 ) {
				$i = 0;
				foreach($this-&gt;col_info as $col ) {
					$new_array&#1111;$i] = $col-&gt;{$info_type};
					$i++;
				}
				return $new_array;
			} else {
				return $this-&gt;col_info&#1111;$col_offset]-&gt;{$info_type};
			}
		}
	}

	function timer_start() {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$this-&gt;time_start = $mtime&#1111;1] + $mtime&#1111;0];
		return true;
	}
	
	function timer_stop($precision = 3) {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$time_end = $mtime&#1111;1] + $mtime&#1111;0];
		$time_total = $time_end - $this-&gt;time_start;
		return $time_total;
	}

	function bail($message) { // Just wraps errors in a nice header and footer
	if ( !$this-&gt;show_errors )
		return false;
	header( 'Content-Type: text/html; charset=utf-8');		
	echo &lt;&lt;&lt;HEAD
	&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quote;&gt;
	&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
	&lt;head&gt;
		&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
		&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
		&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
		&lt;!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		--&gt;
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;
	echo $message;
	echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
	die();
	}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[/php:1 {

	var $show_errors = true;
	var $num_queries = 0;	
	var $last_query;
	var $col_info;
	var $queries;

	// Our tables
	var $posts;
	var $users;
	var $categories;
	var $post2cat;
	var $comments;
	var $links;
	var $linkcategories;
	var $options;
	var $optiontypes;
	var $optionvalues;
	var $optiongroups;
	var $optiongroup_options;
	var $postmeta;

	// ==================================================================
	//	DB Constructor - connects to the server and selects a database

	function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
		$this-&gt;dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
		if (!$this-&gt;dbh) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Error establishing a database connection&lt;/h1&gt;
&lt;p&gt;This either means that the username and password information in your &lt;code&gt;wp-config.php&lt;/code&gt; file is incorrect or we can't contact the database server at &lt;code&gt;$dbhost&lt;/code&gt;. This could mean your host's database server is down.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Are you sure you have the correct username and password?&lt;/li&gt;
	&lt;li&gt;Are you sure that you have typed the correct hostname?&lt;/li&gt;
	&lt;li&gt;Are you sure that the database server is running?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;
&quote;);
		}

		$this-&gt;select($dbname);
	}

	// ==================================================================
	//	Select a DB (if another one needs to be selected)

	function select($db) {
		if (!@mysql_select_db($db, $this-&gt;dbh)) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Can&#8217;t select database&lt;/h1&gt;
&lt;p&gt;We were able to connect to the database server (which means your username and password is okay) but not able to select the &lt;code&gt;$db&lt;/code&gt; database.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are you sure it exists?&lt;/li&gt;
&lt;li&gt;On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you don't know how to setup a database you should &lt;strong&gt;contact your host&lt;/strong&gt;. If all else fails you may find help at the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;&quote;);
		}
	}

	// ====================================================================
	//	Format a string correctly for safe insert under all PHP conditions
	
	function escape($str) {
		return addslashes($str);				
	}

	// ==================================================================
	//	Print SQL/DB error.

	function print_error($str = '') {
		global $EZSQL_ERROR;
		if (!$str) $str = mysql_error();
		$EZSQL_ERROR&#1111;] = 
		array ('query' =&gt; $this-&gt;last_query, 'error_str' =&gt; $str);

		// Is error output turned on or not..
		if ( $this-&gt;show_errors ) {
			// If there is an error then take note of it
			print &quote;&lt;div id='error'&gt;
			&lt;p class='wpdberror'&gt;&lt;strong&gt;WordPress database error:&lt;/strong&gt; &#1111;$str]&lt;br /&gt;
			&lt;code&gt;$this-&gt;last_query&lt;/code&gt;&lt;/p&gt;
			&lt;/div&gt;&quote;;
		} else {
			return false;	
		}
	}

	// ==================================================================
	//	Turn error handling on or off..

	function show_errors() {
		$this-&gt;show_errors = true;
	}
	
	function hide_errors() {
		$this-&gt;show_errors = false;
	}

	// ==================================================================
	//	Kill cached query results

	function flush() {
		$this-&gt;last_result = null;
		$this-&gt;col_info = null;
		$this-&gt;last_query = null;
	}

	// ==================================================================
	//	Basic Query	- see docs for more detail

	function query($query) {
		// initialise return
		$return_val = 0;
		$this-&gt;flush();

		// Log how the function was called
		$this-&gt;func_call = &quote;\$db-&gt;query(\&quote;$query\&quote;)&quote;;

		// Keep track of the last query for debug..
		$this-&gt;last_query = $query;

		// Perform the query via std mysql_query function..
		if (SAVEQUERIES)
			$this-&gt;timer_start();
		
		$this-&gt;result = @mysql_query($query, $this-&gt;dbh);
		++$this-&gt;num_queries;

		if (SAVEQUERIES)
			$this-&gt;queries&#1111;] = array( $query, $this-&gt;timer_stop() );

		// If there is an error then take note of it..
		if ( mysql_error() ) {
			$this-&gt;print_error();
			return false;
		}

		if ( preg_match(&quote;/^\\s*(insert|delete|update|replace) /i&quote;,$query) ) {
			$this-&gt;rows_affected = mysql_affected_rows();
			// Take note of the insert_id
			if ( preg_match(&quote;/^\\s*(insert|replace) /i&quote;,$query) ) {
				$this-&gt;insert_id = mysql_insert_id($this-&gt;dbh);	
			}
			// Return number of rows affected
			$return_val = $this-&gt;rows_affected;
		} else {
			$i = 0;
			while ($i &lt; @mysql_num_fields($this-&gt;result)) {
				$this-&gt;col_info&#1111;$i] = @mysql_fetch_field($this-&gt;result);
				$i++;
			}
			$num_rows = 0;
			while ( $row = @mysql_fetch_object($this-&gt;result) ) {
				$this-&gt;last_result&#1111;$num_rows] = $row;
				$num_rows++;
			}

			@mysql_free_result($this-&gt;result);

			// Log number of rows the query returned
			$this-&gt;num_rows = $num_rows;
			
			// Return number of rows selected
			$return_val = $this-&gt;num_rows;
		}

		return $return_val;
	}

	// ==================================================================
	//	Get one variable from the DB - see docs for more detail

	function get_var($query=null, $x = 0, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_var(\&quote;$query\&quote;,$x,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		// Extract var out of cached results based x,y vals
		if ( $this-&gt;last_result&#1111;$y] ) {
			$values = array_values(get_object_vars($this-&gt;last_result&#1111;$y]));
		}

		// If there is a value return it else return null
		return (isset($values&#1111;$x]) &amp;&amp; $values&#1111;$x]!=='') ? $values&#1111;$x] : null;
	}

	// ==================================================================
	//	Get one row from the DB - see docs for more detail

	function get_row($query = null, $output = OBJECT, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_row(\&quote;$query\&quote;,$output,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		if ( $output == OBJECT ) {
			return $this-&gt;last_result&#1111;$y] ? $this-&gt;last_result&#1111;$y] : null;
		} elseif ( $output == ARRAY_A ) {
			return $this-&gt;last_result&#1111;$y] ? get_object_vars($this-&gt;last_result&#1111;$y]) : null;
		} elseif ( $output == ARRAY_N ) {
			return $this-&gt;last_result&#1111;$y] ? array_values(get_object_vars($this-&gt;last_result&#1111;$y])) : null;
		} else {
			$this-&gt;print_error(&quote; \$db-&gt;get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N&quote;);
		}
	}

	// ==================================================================
	//	Function to get 1 column from the cached result set based in X index
	// se docs for usage and info

	function get_col($query = null , $x = 0) {
		if ( $query )
			$this-&gt;query($query);

		// Extract the column values
		for ( $i=0; $i &lt; count($this-&gt;last_result); $i++ ) {
			$new_array&#1111;$i] = $this-&gt;get_var(null, $x, $i);
		}
		return $new_array;
	}

	// ==================================================================
	// Return the the query as a result set - see docs for more details

	function get_results($query = null, $output = OBJECT) {
		$this-&gt;func_call = &quote;\$db-&gt;get_results(\&quote;$query\&quote;, $output)&quote;;

		if ( $query )
			$this-&gt;query($query);

		// Send back array of objects. Each row is an object
		if ( $output == OBJECT ) {
			return $this-&gt;last_result;
		} elseif ( $output == ARRAY_A || $output == ARRAY_N ) {
			if ( $this-&gt;last_result ) {
				$i = 0;
				foreach( $this-&gt;last_result as $row ) {
					$new_array&#1111;$i] = (array) $row;
					if ( $output == ARRAY_N ) {
						$new_array&#1111;$i] = array_values($new_array&#1111;$i]);
					}
					$i++;
				}
				return $new_array;
			} else {
				return null;
			}
		}
	}


	// ==================================================================
	// Function to get column meta data info pertaining to the last query
	// see docs for more info and usage

	function get_col_info($info_type = 'name', $col_offset = -1) {
		if ( $this-&gt;col_info ) {
			if ( $col_offset == -1 ) {
				$i = 0;
				foreach($this-&gt;col_info as $col ) {
					$new_array&#1111;$i] = $col-&gt;{$info_type};
					$i++;
				}
				return $new_array;
			} else {
				return $this-&gt;col_info&#1111;$col_offset]-&gt;{$info_type};
			}
		}
	}

	function timer_start() {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$this-&gt;time_start = $mtime&#1111;1] + $mtime&#1111;0];
		return true;
	}
	
	function timer_stop($precision = 3) {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$time_end = $mtime&#1111;1] + $mtime&#1111;0];
		$time_total = $time_end - $this-&gt;time_start;
		return $time_total;
	}

	function bail($message) { // Just wraps errors in a nice header and footer
	if ( !$this-&gt;show_errors )
		return false;
	header( 'Content-Type: text/html; charset=utf-8');		
	echo &lt;&lt;&lt;HEAD
	&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quote;&gt;
	&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
	&lt;head&gt;
		&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
		&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
		&are I am supposed to be able to start using the software right away, but I get an error. Example page is :

http://www.inspired-evolution.com/wordpress/

the error is:

Parse error: parse error, unexpected $ in /hsphere/local/home/bruceg/inspired-evolution.com/wordpress/wp-includes/wp-db.php on line 348

php code is

Code: Select all

<?php
//  WordPress DB Class

//  ORIGINAL CODE FROM:
//  Justin Vincent (justin@visunet.ie)
//	http://php.justinvincent.com

define('EZSQL_VERSION', 'WP1.25');
define('OBJECT', 'OBJECT', true);
define('ARRAY_A', 'ARRAY_A', false);
define('ARRAY_N', 'ARRAY_N', false);

if (!defined('SAVEQUERIES'))
	define('SAVEQUERIES', false);

class wpdb {

	var $show_errors = true;
	var $num_queries = 0;	
	var $last_query;
	var $col_info;
	var $queries;

	// Our tables
	var $posts;
	var $users;
	var $categories;
	var $post2cat;
	var $comments;
	var $links;
	var $linkcategories;
	var $options;
	var $optiontypes;
	var $optionvalues;
	var $optiongroups;
	var $optiongroup_options;
	var $postmeta;

	// ==================================================================
	//	DB Constructor - connects to the server and selects a database

	function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
		$this-&gt;dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
		if (!$this-&gt;dbh) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Error establishing a database connection&lt;/h1&gt;
&lt;p&gt;This either means that the username and password information in your &lt;code&gt;wp-config.php&lt;/code&gt; file is incorrect or we can't contact the database server at &lt;code&gt;$dbhost&lt;/code&gt;. This could mean your host's database server is down.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Are you sure you have the correct username and password?&lt;/li&gt;
	&lt;li&gt;Are you sure that you have typed the correct hostname?&lt;/li&gt;
	&lt;li&gt;Are you sure that the database server is running?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;
&quote;);
		}

		$this-&gt;select($dbname);
	}

	// ==================================================================
	//	Select a DB (if another one needs to be selected)

	function select($db) {
		if (!@mysql_select_db($db, $this-&gt;dbh)) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Can&#8217;t select database&lt;/h1&gt;
&lt;p&gt;We were able to connect to the database server (which means your username and password is okay) but not able to select the &lt;code&gt;$db&lt;/code&gt; database.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are you sure it exists?&lt;/li&gt;
&lt;li&gt;On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you don't know how to setup a database you should &lt;strong&gt;contact your host&lt;/strong&gt;. If all else fails you may find help at the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;&quote;);
		}
	}

	// ====================================================================
	//	Format a string correctly for safe insert under all PHP conditions
	
	function escape($str) {
		return addslashes($str);				
	}

	// ==================================================================
	//	Print SQL/DB error.

	function print_error($str = '') {
		global $EZSQL_ERROR;
		if (!$str) $str = mysql_error();
		$EZSQL_ERROR&#1111;] = 
		array ('query' =&gt; $this-&gt;last_query, 'error_str' =&gt; $str);

		// Is error output turned on or not..
		if ( $this-&gt;show_errors ) {
			// If there is an error then take note of it
			print &quote;&lt;div id='error'&gt;
			&lt;p class='wpdberror'&gt;&lt;strong&gt;WordPress database error:&lt;/strong&gt; &#1111;$str]&lt;br /&gt;
			&lt;code&gt;$this-&gt;last_query&lt;/code&gt;&lt;/p&gt;
			&lt;/div&gt;&quote;;
		} else {
			return false;	
		}
	}

	// ==================================================================
	//	Turn error handling on or off..

	function show_errors() {
		$this-&gt;show_errors = true;
	}
	
	function hide_errors() {
		$this-&gt;show_errors = false;
	}

	// ==================================================================
	//	Kill cached query results

	function flush() {
		$this-&gt;last_result = null;
		$this-&gt;col_info = null;
		$this-&gt;last_query = null;
	}

	// ==================================================================
	//	Basic Query	- see docs for more detail

	function query($query) {
		// initialise return
		$return_val = 0;
		$this-&gt;flush();

		// Log how the function was called
		$this-&gt;func_call = &quote;\$db-&gt;query(\&quote;$query\&quote;)&quote;;

		// Keep track of the last query for debug..
		$this-&gt;last_query = $query;

		// Perform the query via std mysql_query function..
		if (SAVEQUERIES)
			$this-&gt;timer_start();
		
		$this-&gt;result = @mysql_query($query, $this-&gt;dbh);
		++$this-&gt;num_queries;

		if (SAVEQUERIES)
			$this-&gt;queries&#1111;] = array( $query, $this-&gt;timer_stop() );

		// If there is an error then take note of it..
		if ( mysql_error() ) {
			$this-&gt;print_error();
			return false;
		}

		if ( preg_match(&quote;/^\\s*(insert|delete|update|replace) /i&quote;,$query) ) {
			$this-&gt;rows_affected = mysql_affected_rows();
			// Take note of the insert_id
			if ( preg_match(&quote;/^\\s*(insert|replace) /i&quote;,$query) ) {
				$this-&gt;insert_id = mysql_insert_id($this-&gt;dbh);	
			}
			// Return number of rows affected
			$return_val = $this-&gt;rows_affected;
		} else {
			$i = 0;
			while ($i &lt; @mysql_num_fields($this-&gt;result)) {
				$this-&gt;col_info&#1111;$i] = @mysql_fetch_field($this-&gt;result);
				$i++;
			}
			$num_rows = 0;
			while ( $row = @mysql_fetch_object($this-&gt;result) ) {
				$this-&gt;last_result&#1111;$num_rows] = $row;
				$num_rows++;
			}

			@mysql_free_result($this-&gt;result);

			// Log number of rows the query returned
			$this-&gt;num_rows = $num_rows;
			
			// Return number of rows selected
			$return_val = $this-&gt;num_rows;
		}

		return $return_val;
	}

	// ==================================================================
	//	Get one variable from the DB - see docs for more detail

	function get_var($query=null, $x = 0, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_var(\&quote;$query\&quote;,$x,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		// Extract var out of cached results based x,y vals
		if ( $this-&gt;last_result&#1111;$y] ) {
			$values = array_values(get_object_vars($this-&gt;last_result&#1111;$y]));
		}

		// If there is a value return it else return null
		return (isset($values&#1111;$x]) &amp;&amp; $values&#1111;$x]!=='') ? $values&#1111;$x] : null;
	}

	// ==================================================================
	//	Get one row from the DB - see docs for more detail

	function get_row($query = null, $output = OBJECT, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_row(\&quote;$query\&quote;,$output,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		if ( $output == OBJECT ) {
			return $this-&gt;last_result&#1111;$y] ? $this-&gt;last_result&#1111;$y] : null;
		} elseif ( $output == ARRAY_A ) {
			return $this-&gt;last_result&#1111;$y] ? get_object_vars($this-&gt;last_result&#1111;$y]) : null;
		} elseif ( $output == ARRAY_N ) {
			return $this-&gt;last_result&#1111;$y] ? array_values(get_object_vars($this-&gt;last_result&#1111;$y])) : null;
		} else {
			$this-&gt;print_error(&quote; \$db-&gt;get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N&quote;);
		}
	}

	// ==================================================================
	//	Function to get 1 column from the cached result set based in X index
	// se docs for usage and info

	function get_col($query = null , $x = 0) {
		if ( $query )
			$this-&gt;query($query);

		// Extract the column values
		for ( $i=0; $i &lt; count($this-&gt;last_result); $i++ ) {
			$new_array&#1111;$i] = $this-&gt;get_var(null, $x, $i);
		}
		return $new_array;
	}

	// ==================================================================
	// Return the the query as a result set - see docs for more details

	function get_results($query = null, $output = OBJECT) {
		$this-&gt;func_call = &quote;\$db-&gt;get_results(\&quote;$query\&quote;, $output)&quote;;

		if ( $query )
			$this-&gt;query($query);

		// Send back array of objects. Each row is an object
		if ( $output == OBJECT ) {
			return $this-&gt;last_result;
		} elseif ( $output == ARRAY_A || $output == ARRAY_N ) {
			if ( $this-&gt;last_result ) {
				$i = 0;
				foreach( $this-&gt;last_result as $row ) {
					$new_array&#1111;$i] = (array) $row;
					if ( $output == ARRAY_N ) {
						$new_array&#1111;$i] = array_values($new_array&#1111;$i]);
					}
					$i++;
				}
				return $new_array;
			} else {
				return null;
			}
		}
	}


	// ==================================================================
	// Function to get column meta data info pertaining to the last query
	// see docs for more info and usage

	function get_col_info($info_type = 'name', $col_offset = -1) {
		if ( $this-&gt;col_info ) {
			if ( $col_offset == -1 ) {
				$i = 0;
				foreach($this-&gt;col_info as $col ) {
					$new_array&#1111;$i] = $col-&gt;{$info_type};
					$i++;
				}
				return $new_array;
			} else {
				return $this-&gt;col_info&#1111;$col_offset]-&gt;{$info_type};
			}
		}
	}

	function timer_start() {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$this-&gt;time_start = $mtime&#1111;1] + $mtime&#1111;0];
		return true;
	}
	
	function timer_stop($precision = 3) {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$time_end = $mtime&#1111;1] + $mtime&#1111;0];
		$time_total = $time_end - $this-&gt;time_start;
		return $time_total;
	}

	function bail($message) { // Just wraps errors in a nice header and footer
	if ( !$this-&gt;show_errors )
		return false;
	header( 'Content-Type: text/html; charset=utf-8');		
	echo &lt;&lt;&lt;HEAD
	&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quote;&gt;
	&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
	&lt;head&gt;
		&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
		&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
		&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
		&lt;!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		--&gt;
		&lt;/style&gt;
	&lt;/head&gt;
	&ample page is :

http://www.inspired-evolution.com/wordpress/

the error is:

Parse error: parse error, unexpected $ in /hsphere/local/home/bruceg/inspired-evolution.com/wordpress/wp-includes/wp-db.php on line 348

php code is

Code: Select all

&lt;?php
//  WordPress DB Class

//  ORIGINAL CODE FROM:
//  Justin Vincent (justin@visunet.ie)
//	http://php.justinvincent.com

define('EZSQL_VERSION', 'WP1.25');
define('OBJECT', 'OBJECT', true);
define('ARRAY_A', 'ARRAY_A', false);
define('ARRAY_N', 'ARRAY_N', false);

if (!defined('SAVEQUERIES'))
	define('SAVEQUERIES', false);

class wpdb {

	var $show_errors = true;
	var $num_queries = 0;	
	var $last_query;
	var $col_info;
	var $queries;

	// Our tables
	var $posts;
	var $users;
	var $categories;
	var $post2cat;
	var $comments;
	var $links;
	var $linkcategories;
	var $options;
	var $optiontypes;
	var $optionvalues;
	var $optiongroups;
	var $optiongroup_options;
	var $postmeta;

	// ==================================================================
	//	DB Constructor - connects to the server and selects a database

	function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
		$this-&gt;dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
		if (!$this-&gt;dbh) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Error establishing a database connection&lt;/h1&gt;
&lt;p&gt;This either means that the username and password information in your &lt;code&gt;wp-config.php&lt;/code&gt; file is incorrect or we can't contact the database server at &lt;code&gt;$dbhost&lt;/code&gt;. This could mean your host's database server is down.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Are you sure you have the correct username and password?&lt;/li&gt;
	&lt;li&gt;Are you sure that you have typed the correct hostname?&lt;/li&gt;
	&lt;li&gt;Are you sure that the database server is running?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;
&quote;);
		}

		$this-&gt;select($dbname);
	}

	// ==================================================================
	//	Select a DB (if another one needs to be selected)

	function select($db) {
		if (!@mysql_select_db($db, $this-&gt;dbh)) {
			$this-&gt;bail(&quote;
&lt;h1&gt;Can&#8217;t select database&lt;/h1&gt;
&lt;p&gt;We were able to connect to the database server (which means your username and password is okay) but not able to select the &lt;code&gt;$db&lt;/code&gt; database.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Are you sure it exists?&lt;/li&gt;
&lt;li&gt;On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you don't know how to setup a database you should &lt;strong&gt;contact your host&lt;/strong&gt;. If all else fails you may find help at the &lt;a href='http://wordpress.org/support/'&gt;WordPress Support Forums&lt;/a&gt;.&lt;/p&gt;&quote;);
		}
	}

	// ====================================================================
	//	Format a string correctly for safe insert under all PHP conditions
	
	function escape($str) {
		return addslashes($str);				
	}

	// ==================================================================
	//	Print SQL/DB error.

	function print_error($str = '') {
		global $EZSQL_ERROR;
		if (!$str) $str = mysql_error();
		$EZSQL_ERROR&#1111;] = 
		array ('query' =&gt; $this-&gt;last_query, 'error_str' =&gt; $str);

		// Is error output turned on or not..
		if ( $this-&gt;show_errors ) {
			// If there is an error then take note of it
			print &quote;&lt;div id='error'&gt;
			&lt;p class='wpdberror'&gt;&lt;strong&gt;WordPress database error:&lt;/strong&gt; &#1111;$str]&lt;br /&gt;
			&lt;code&gt;$this-&gt;last_query&lt;/code&gt;&lt;/p&gt;
			&lt;/div&gt;&quote;;
		} else {
			return false;	
		}
	}

	// ==================================================================
	//	Turn error handling on or off..

	function show_errors() {
		$this-&gt;show_errors = true;
	}
	
	function hide_errors() {
		$this-&gt;show_errors = false;
	}

	// ==================================================================
	//	Kill cached query results

	function flush() {
		$this-&gt;last_result = null;
		$this-&gt;col_info = null;
		$this-&gt;last_query = null;
	}

	// ==================================================================
	//	Basic Query	- see docs for more detail

	function query($query) {
		// initialise return
		$return_val = 0;
		$this-&gt;flush();

		// Log how the function was called
		$this-&gt;func_call = &quote;\$db-&gt;query(\&quote;$query\&quote;)&quote;;

		// Keep track of the last query for debug..
		$this-&gt;last_query = $query;

		// Perform the query via std mysql_query function..
		if (SAVEQUERIES)
			$this-&gt;timer_start();
		
		$this-&gt;result = @mysql_query($query, $this-&gt;dbh);
		++$this-&gt;num_queries;

		if (SAVEQUERIES)
			$this-&gt;queries&#1111;] = array( $query, $this-&gt;timer_stop() );

		// If there is an error then take note of it..
		if ( mysql_error() ) {
			$this-&gt;print_error();
			return false;
		}

		if ( preg_match(&quote;/^\\s*(insert|delete|update|replace) /i&quote;,$query) ) {
			$this-&gt;rows_affected = mysql_affected_rows();
			// Take note of the insert_id
			if ( preg_match(&quote;/^\\s*(insert|replace) /i&quote;,$query) ) {
				$this-&gt;insert_id = mysql_insert_id($this-&gt;dbh);	
			}
			// Return number of rows affected
			$return_val = $this-&gt;rows_affected;
		} else {
			$i = 0;
			while ($i &lt; @mysql_num_fields($this-&gt;result)) {
				$this-&gt;col_info&#1111;$i] = @mysql_fetch_field($this-&gt;result);
				$i++;
			}
			$num_rows = 0;
			while ( $row = @mysql_fetch_object($this-&gt;result) ) {
				$this-&gt;last_result&#1111;$num_rows] = $row;
				$num_rows++;
			}

			@mysql_free_result($this-&gt;result);

			// Log number of rows the query returned
			$this-&gt;num_rows = $num_rows;
			
			// Return number of rows selected
			$return_val = $this-&gt;num_rows;
		}

		return $return_val;
	}

	// ==================================================================
	//	Get one variable from the DB - see docs for more detail

	function get_var($query=null, $x = 0, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_var(\&quote;$query\&quote;,$x,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		// Extract var out of cached results based x,y vals
		if ( $this-&gt;last_result&#1111;$y] ) {
			$values = array_values(get_object_vars($this-&gt;last_result&#1111;$y]));
		}

		// If there is a value return it else return null
		return (isset($values&#1111;$x]) &amp;&amp; $values&#1111;$x]!=='') ? $values&#1111;$x] : null;
	}

	// ==================================================================
	//	Get one row from the DB - see docs for more detail

	function get_row($query = null, $output = OBJECT, $y = 0) {
		$this-&gt;func_call = &quote;\$db-&gt;get_row(\&quote;$query\&quote;,$output,$y)&quote;;
		if ( $query )
			$this-&gt;query($query);

		if ( $output == OBJECT ) {
			return $this-&gt;last_result&#1111;$y] ? $this-&gt;last_result&#1111;$y] : null;
		} elseif ( $output == ARRAY_A ) {
			return $this-&gt;last_result&#1111;$y] ? get_object_vars($this-&gt;last_result&#1111;$y]) : null;
		} elseif ( $output == ARRAY_N ) {
			return $this-&gt;last_result&#1111;$y] ? array_values(get_object_vars($this-&gt;last_result&#1111;$y])) : null;
		} else {
			$this-&gt;print_error(&quote; \$db-&gt;get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N&quote;);
		}
	}

	// ==================================================================
	//	Function to get 1 column from the cached result set based in X index
	// se docs for usage and info

	function get_col($query = null , $x = 0) {
		if ( $query )
			$this-&gt;query($query);

		// Extract the column values
		for ( $i=0; $i &lt; count($this-&gt;last_result); $i++ ) {
			$new_array&#1111;$i] = $this-&gt;get_var(null, $x, $i);
		}
		return $new_array;
	}

	// ==================================================================
	// Return the the query as a result set - see docs for more details

	function get_results($query = null, $output = OBJECT) {
		$this-&gt;func_call = &quote;\$db-&gt;get_results(\&quote;$query\&quote;, $output)&quote;;

		if ( $query )
			$this-&gt;query($query);

		// Send back array of objects. Each row is an object
		if ( $output == OBJECT ) {
			return $this-&gt;last_result;
		} elseif ( $output == ARRAY_A || $output == ARRAY_N ) {
			if ( $this-&gt;last_result ) {
				$i = 0;
				foreach( $this-&gt;last_result as $row ) {
					$new_array&#1111;$i] = (array) $row;
					if ( $output == ARRAY_N ) {
						$new_array&#1111;$i] = array_values($new_array&#1111;$i]);
					}
					$i++;
				}
				return $new_array;
			} else {
				return null;
			}
		}
	}


	// ==================================================================
	// Function to get column meta data info pertaining to the last query
	// see docs for more info and usage

	function get_col_info($info_type = 'name', $col_offset = -1) {
		if ( $this-&gt;col_info ) {
			if ( $col_offset == -1 ) {
				$i = 0;
				foreach($this-&gt;col_info as $col ) {
					$new_array&#1111;$i] = $col-&gt;{$info_type};
					$i++;
				}
				return $new_array;
			} else {
				return $this-&gt;col_info&#1111;$col_offset]-&gt;{$info_type};
			}
		}
	}

	function timer_start() {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$this-&gt;time_start = $mtime&#1111;1] + $mtime&#1111;0];
		return true;
	}
	
	function timer_stop($precision = 3) {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$time_end = $mtime&#1111;1] + $mtime&#1111;0];
		$time_total = $time_end - $this-&gt;time_start;
		return $time_total;
	}

	function bail($message) { // Just wraps errors in a nice header and footer
	if ( !$this-&gt;show_errors )
		return false;
	header( 'Content-Type: text/html; charset=utf-8');		
	echo &lt;&lt;&lt;HEAD
	&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quote;&gt;
	&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
	&lt;head&gt;
		&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
		&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
		&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
		&lt;!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		--&gt;
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;
	echo $message;
	echo &quote;&lt;/body&gt;&here I am supposed to be able to start using the software right away, but I get an error. Example page is :

http://www.inspired-evolution.com/wordpress/

the error is:

Parse error: parse error, unexpected $ in /hsphere/local/home/bruceg/inspired-evolution.com/wordpress/wp-includes/wp-db.php on line 348

php code is

Code: Select all

<?php
//  WordPress DB Class

//  ORIGINAL CODE FROM:
//  Justin Vincent (justin@visunet.ie)
//	http://php.justinvincent.com

define('EZSQL_VERSION', 'WP1.25');
define('OBJECT', 'OBJECT', true);
define('ARRAY_A', 'ARRAY_A', false);
define('ARRAY_N', 'ARRAY_N', false);

if (!defined('SAVEQUERIES'))
	define('SAVEQUERIES', false);

class wpdb {

	var $show_errors = true;
	var $num_queries = 0;	
	var $last_query;
	var $col_info;
	var $queries;

	// Our tables
	var $posts;
	var $users;
	var $categories;
	var $post2cat;
	var $comments;
	var $links;
	var $linkcategories;
	var $options;
	var $optiontypes;
	var $optionvalues;
	var $optiongroups;
	var $optiongroup_options;
	var $postmeta;

	// ==================================================================
	//	DB Constructor - connects to the server and selects a database

	function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
		$this->dbh = @mysql_connect

Re: problems installing word press blogger software

Posted: Wed Jul 06, 2005 9:21 pm
by neophyte
bruceg wrote:

Code: Select all

<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		-->
		</style>
	</head>
	<body>
	<h1 id="logo"><img alt="WordPress" src="http://static.wolse;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		-->
		</style>
	</head>
	<body>
	<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
	//echo $message;
	//echo "</body></html>";
	//die();
	}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?>
See the comments above. The problem is somewhere between where the echo HEAD >>> starts and ends. I'm not familar with this syntax. Never use it myself. The missing $ though indicates a syntax erro;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2t;?php

function bail($message) { // Just wraps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo &lt;&lt;&lt;HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[/quote] See the comments above. The problem is somewhere between where the echo HEAD ;lt;?php

function bail($message) { // Just wraps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
-->
</style>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="hp;amp;gt;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
-->
</style>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
//echo $message;
//echo "</body></html>";
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?>
[/quote] See the comments above. The problem is somewhere between where the echo HEAD >>> starts and ends. I'm not familar with this syntax. Never use it myself. The missing $ though indicates a syntax error somewhere.er and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo &lt;&lt;&lt;HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[/quote] See the comments above. The problem is somewhere between where the echo HEer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo &lt;&lt;&lt;HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST)"bruceg"]

Code: Select all

<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		-->
		</style>
	</head>
	<body>
	<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /&]
<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		-->
		</style>
	</head>
	<body>
	<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
	//echo $message;
	//echo "</body></html>";
	//die();
	}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?>
[/quote]-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[/ntent-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&ation bail($message) { // Just wraps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
-->
</style>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
//echo $message;
//echo "</body></html>";
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?>
[/quote] See the comments above. The problem is somewhere between where the echo HEAD >>> starts and ends. I'm not familar with this syntax. Never use it myself. The missing $ though indicates a syntax error somewhere./THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... al.dtd"&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;& wraps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo &lt;&lt;&lt;HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[/quote] See the "bruceg"]

Code: Select all

<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			pa130abc]
<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		-->
		</style>
	</head>
	<body>
	<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENr( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		-->
		</style>
	</head>
	<body>
	<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
	//echo $message;
	//echo "&l]
<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 1<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		-->
		</style>
	</head>
	<body>
	<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
	//echo $message;
	//echo "</body></html>";
	//die();
	}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?>
[/quote] See the comments above. The problem is somewhere between where the echo HEAD >>> starts and ends. I'm not familar with this syntax. Never use it myself. The missing $ though indicates a syntax error somewhere.
function bail($message) { // Just wraps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[/quote] See header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
-->
</style>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
//echo $message;
//echo "</body></html>";
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?>
[/quote] See the comments above. The problem is somewhere between where the echo HEAD >>> starts and ends. I'm not familar with this syntax. Never use it myself. The missing $ though indicates a syntax error somewhere."bruceg"]

Code: Select all

<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>WordPress &rsaquo; Error</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type="text/css">
		<!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		-->
		</style>
	</head>
	<body>
	<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
	//echo $message;
	//echo "</body></html>";
	//die();
	}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?>
[/quote] See the comments above. The problem is somewhere between where the echo HEAD >>> starts and ends. I'm not familar with this syntax. Never use it myself. The missing $ Just wraps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
<!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[ps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<&lt;HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[/quote] See the n a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<&lt;HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
"bruceg"]

Code: Select all

<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quote;&gt;
	&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
	&lt;head&gt;
		&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
		&lt;meta http-equiv=&quote;Content-Type" content="text/html; charset=utf-8" />
		<style media="screen" type=&quote;text/css&quote;&gt;
		&lt;!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, "Times New Roman", Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			lineion bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo <<<HEAD
	<!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quote;&gt;
	&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
	&lt;head&gt;
		&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
		&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
		&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
		&lt;!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		--&gt;
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
	//echo $message;
	//echo &quote;&lt;/body&gt;&lt;/html&g"bruceg"]

Code: Select all

<?php

	function bail($message) { // Just wraps errors in a nice header and footer
	//if ( !$this->show_errors )
	//	return false;
	//header( 'Content-Type: text/html; charset=utf-8');		
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...	
echo &lt;&lt;&lt;HEAD
	&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quote;&gt;
	&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
	&lt;head&gt;
		&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
		&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
		&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
		&lt;!--
		html {
			background: #eee;
		}
		body {
			background: #fff;
			color: #000;
			font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
			margin-left: 25%;
			margin-right: 25%;
			padding: .2em 2em;
		}
		
		h1 {
			color: #006;
			font-size: 18px;
			font-weight: lighter;
		}
		
		h2 {
			font-size: 16px;
		}
		
		p, li, dt {
			line-height: 140%;
			padding-bottom: 2px;
		}
	
		ul, ol {
			padding: 5px 5px 5px 20px;
		}
		#logo {
			margin-bottom: 2em;
		}
		--&gt;
		&lt;/style&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
	//echo $message;
	//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
	//die();
	}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;
[/quote] See the comm) { // Just wraps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo &lt;&lt;&lt;HEAD
&lt;!DOCTYPE html PUBLIC &quote;-//W3C//DTD XHTML 1.0 Transitional//EN&quote; &quote;http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... &quote;&gt;
&lt;html xmlns=&quote;http://www.w3.org/1999/xhtml&quote;&gt;
&lt;head&gt;
&lt;title&gt;WordPress &amp;rsaquo; Error&lt;/title&gt;
&lt;meta http-equiv=&quote;Content-Type&quote; content=&quote;text/html; charset=utf-8&quote; /&gt;
&lt;style media=&quote;screen&quote; type=&quote;text/css&quote;&gt;
&lt;!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, &quote;Times New Roman&quote;, Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1 id=&quote;logo&quote;&gt;&lt;img alt=&quote;WordPress&quote; src=&quote;http://static.wordpress.org/logo.png&quote; /&gt;&lt;/h1&gt;
HEAD;

///ENDING HERE
//echo $message;
//echo &quote;&lt;/body&gt;&lt;/html&gt;&quote;;
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?&gt;

<?php

function bail($message) { // Just wraps errors in a nice header and footer
//if ( !$this->show_errors )
// return false;
//header( 'Content-Type: text/html; charset=utf-8');
//THE PROBLEM IS SOMEWHERE STARTING HERE AND...
echo <<<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress &rsaquo; Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
<!--
html {
background: #eee;
}
body {
background: #fff;
color: #000;
font-family: Georgia, "Times New Roman", Times, serif;
margin-left: 25%;
margin-right: 25%;
padding: .2em 2em;
}

h1 {
color: #006;
font-size: 18px;
font-weight: lighter;
}

h2 {
font-size: 16px;
}

p, li, dt {
line-height: 140%;
padding-bottom: 2px;
}

ul, ol {
padding: 5px 5px 5px 20px;
}
#logo {
margin-bottom: 2em;
}
-->
</style>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="http://static.wordpress.org/logo.png" /></h1>
HEAD;

///ENDING HERE
//echo $message;
//echo "</body></html>";
//die();
}
}

$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
?>
[/quote] See the comments above. The problem is somewhere between where the echo HEAD >>> starts and ends. I'm not familar with this syntax. Never use it myself. The missing $ though indicates a syntax error somewhere.