PHP where is my error here?

Freddy

New member
both my editor and Wamp server complain about a parse error at line 8??
<html>
<head>
<title>My Movie Site - <?php echo $favmovie; ?></title>
</head>
<body>
<?php
//delete this line: define(“FAVMOVIE”, “The Life of Brian”);
echo “My favorite movie is “;
echo $favmovie;
echo “<br>”;
$movierate = 5;
echo “My movie rating for this movie is: “;
echo $movierate;
?>
</body>
</html>

This example comes from Beginning PHP5 Apache mysql from Wrox.
Where is the ERROR??

Compiler says:
Parsing Error: PHPDocument1 line 8 - syntax error, unexpected T_STRING, expecting ',' or ';'
 
Is all your variables set?

EDIT:
The problem is that the double quotes are weird, maybe it's the character set your using. use single quotes instead.

<html>
<head>
<title>My Movie Site - <?php echo $favmovie; ?></title>
</head>
<body>
<?php
//delete this line: define(“FAVMOVIE”, “The Life of Brian”);
echo 'My favorite movie is ';
echo $favmovie;
echo '<br>';
$movierate = 5;
echo 'My movie rating for this movie is: ';
echo $movierate;
?>
</body>
</html>

Or

This code could also be shortened to this:

<html>
<head>
<title>My Movie Site - <?php echo $favmovie; ?></title>
</head>
<body>
<?php
//delete this line: define(“FAVMOVIE”, “The Life of Brian”);
echo "My favorite movie is $favmovie <br>";
$movierate=5;
echo "My movie rating for this movie is: $movierate";
?>
</body>
</html>

but watch out for the double quotes before directly copy pasting.
 
No idea what you are doing here.....
You have commented out a function declaration that has no definition...
favmovie is not given a value before being printed...

This is a bunch of nothing in all actuality. This code won't do anything other than print:

My favorite movie is
My movie rating for this movie is: 5
 
i'm not big on programming or HTML but i believe you might need an @ in front of echo, test it out and if it doesn't work im sorry for wasting your time.
 
i'm not big on programming or HTML but i believe you might need an @ in front of echo, test it out and if it doesn't work im sorry for wasting your time.
 
Back
Top