Hello evryone! i am very new to PHP! I study it with ebook: PHP & MySQL For Dummies , 3rd Edition!
Once i try and have copy the whole code from the book like this(write in notepad)


_______________________

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<p>
<?php
echo “This is a PHP line”;
phpinfo();
?>
</body></html>

___________________________

and save to C:\wamp\www\ss\a.php then i open wamp server with crome and switch to
http://localhost/ss/a.php

but it show:
________________________________
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\ss\a.php on line 9
___________________________________

Why it is crazy like that?
in that book the author tell that it should display
_____________
This is an HTML line This is a PHP line
_______________

Help me please!
<FAKE SIGNATURE DELETED>

you just try either
echo phpinfo();

or remove the semicolon after the "This is a php line"

Reply if it fixes..

The type of quotes you used are invalid. I've never seen double italic quotes like that before but the following should do the job.

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<p>
<?php
//before was: echo “This is a PHP line”;
echo "This is a PHP line"; //now is
phpinfo();
?>
</body></html>

Hope that helps.

Use this code and mark this thread as solved , Thanks.

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
</p>
<?
echo "This is a PHP line";
phpinfo();
?>
</body></html>
This question has already been answered. Start a new discussion instead.