Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.