• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Need Help with parse error in PHP

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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?
 
Ranch Hand
Posts: 71
PHP Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic