Jump to content

[SOLVED] Can't figure out unexpected T_STRING error


darkforests

Recommended Posts

I am getting this error: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/brillian/public_html/classes1.php on line 3

 

from this file:

<?php
class Page {
public $Title;
public $img1;
public $img2;
public $img3;
public $img4;
public $img5;
public $Description;
public $ProjectLink;

public function __construct($title, $projectID) {
	mysql_connect("localhost", "user", "pass");
	mysql_select_db("database");
	$this->Title = $title;
	$portfolioSQL = "SELECT * from portfolio WHERE id=$projectID";
	$portfolioRES = pg_query($portfolioSQL);
	while($row = pg_fetch_assoc($portfolioRES)) {
		$this->img1 = $row["image1"];
		$this->img2 = $row["image2"];
		$this->img3 = $row["image3"];
		$this->img4 = $row["image4"];
		$this->img5 = $row["image5"];
		$this->Description = $row["description"];
		$this->ProjectLink = $row["link"];
	}

}
public function PrintHeader() {
?>	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ttitle - <?php echo $this->Title; ?></title>
</head>
<?php
}
public function PrintBody() {
?>
<body>
<p>Text</p>
<?php
}
public function PrintFooter() {
?>
<p>footer text</p>
</body>
</html>
<?php
}
}
?>

 

I can't figure out what the error is for the life of me, especially since its showing at the beginning of the file. Please Help!

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.