2 Replies - 975 Views - Last Post: 04 October 2009 - 08:21 AM Rate Topic: -----

#1 greenbluekidz   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 59
  • Joined: 05-January 09

Parse error: syntax error, unexpected '>' - Not sure why I

Post icon  Posted 04 October 2009 - 07:46 AM

I am learning PHP for the first time. I am doing an example from my text pertaining to working with functions. I am getting the following error when I attempt to view my code:

Parse error: syntax error, unexpected '>' in C:\xampp\xampp\htdocs\TwoFunctions.php on line 16

I am not sure why I am getting an error as I'm entering verbatim what is printed in the text. There doesn't appear to be any syntax mistakes.

Code is as follows:

<!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>Two Functions</title>
<meta http-equiv="content-type"
	content="text/html; charset=iso-8859-1" />
</head>

<body>
<?php
function printMessage($FirstMessage){
	echo "<p>$FirstMessage</p>;
}
function returnMessage(){
	return "<p>This message was returned from a function.</p>";
}
printMessage("This message was printed from a function.");
$ReturnValue = returnMessage();
echo $ReturnValue;
?>
</body>
</html>




Thanks for your assistance!

Is This A Good Question/Topic? 0
  • +

Replies To: Parse error: syntax error, unexpected '>' - Not sure why I

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Parse error: syntax error, unexpected '>' - Not sure why I

Posted 04 October 2009 - 07:57 AM

 echo "<p>$FirstMessage</p>;


You didn't close your quote.
Was This Post Helpful? 1
  • +
  • -

#3 greenbluekidz   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 59
  • Joined: 05-January 09

Re: Parse error: syntax error, unexpected '>' - Not sure why I

Posted 04 October 2009 - 08:21 AM

That was it?? Thanks for your help!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1