Page 1 of 1

test PHP file does not execute correctly

PostPosted: 26. July 2012 23:57
by demzo
hello everyone,

i would be very happy if anyone could supply me with a hint:

i am new to PHP and have begun setting up a development environment on my PC. i installed XAMPP 1.8.0 and wished to test whether PHP is installed and working. i created a test file in the root folder, htdocs and executed it by typing localhost/test.php in the browser url field.

The browser returns the following message:

Parse error: syntax error, unexpected '>' in C:\xampp\htdocs\test.php on line 6

the test code which i entered is a standard test code:

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

any advice would be greatly helpful. thank you.

Re: test PHP file does not execute correctly

PostPosted: 27. July 2012 03:17
by hackattack142
It is a problem in your quotation marks on this line
Code: Select all
echo “<p>This is a PHP line</p>”;


it should be
Code: Select all
echo "<p>This is a PHP line</p>";