Two Laptop Bag*
The moose likes PHP and the fly likes Need Help with parse error in PHP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "Need Help with parse error in PHP" Watch "Need Help with parse error in PHP" New topic
Author

Need Help with parse error in PHP

Phani Kumar Venkata
Greenhorn

Joined: Jun 18, 2013
Posts: 1


Hello Guys,

I am a newbie for PHP. I have just started today. I wrote a small hello world script but I could not execute it. I got a parser error when i try to run the script. Please see the code below:

<!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” xml:lang=”en” lang=”en”>
<head>
<title>Hello</title>
<link rel=”stylesheet” type=”text/css” href=”common.css” />
</head>
<body>
<h1><?php echo “Hello, world! ”; ?></h1>
</body>
</html>

I got an error like "( ! ) Parse error: syntax error, unexpected '!', expecting ',' or ';' in C:\wamp\www\hello_pretty.php on line 12".

Can anyone help me?
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 70

Did you paste this code directly from your editor? If you did, notice that your quote marks are slanted; that's because they are not plain quotes (ASCII 0x22) but rather the enhanced quotes used by a word processor. What editor did you use to create this file? (What OS are you running on?)

Try replacing all of the slanted quotes with standard quotes using a plain text editor.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Need Help with parse error in PHP
 
Similar Threads
Html page doesn't include styles,given in document.
PHP basics
PHP in General
Problem rendering facelets templates
Jersey Web Service - uses ExceptionMapper but client cant retrieve error message