darkforests Posted January 10, 2008 Share Posted January 10, 2008 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. Link to comment https://forums.phpfreaks.com/topic/85293-solved-cant-figure-out-unexpected-t_string-error/ Share on other sites More sharing options...
btherl Posted January 10, 2008 Share Posted January 10, 2008 You're trying to run php 5 code with php 4 Link to comment https://forums.phpfreaks.com/topic/85293-solved-cant-figure-out-unexpected-t_string-error/#findComment-435205 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.