Hi everyone,
I am having a weird problem where I can't put spaces in my code. I am reading through Wrox - Beginning PHP 5, Apache and MySQL web development book and when I enter the code from the book on my computer I get weird syntax errors about strings, more details below:
Code from book:
<html>
<head>
<title>My Movie Site</title>
</head>
<body>
<?php
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>
Error:
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\Mock\index.php on line 7
I also get-
Code from book:
<html>
<head>
<title>My Movie Site - <?php echo $_REQUEST[‘favmovie’]; ?></title>
</head>
<body>
<?php
echo “My favorite movie is“;
echo $_REQUEST[‘favmovie’];
echo “<br>”;
$movierate = 5;
echo “My movie rating for this movie is: “;
echo $movierate;
?>
</body>
</html>
Error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\Mock\index.php on line 7
I have no idea why these errors would show up since I am just copying from the book but I think it has something to do with my installation, im guessing maybe I haven't set up the syntax correctly or something. I am using an XAMPP 2.0.