Click to See Complete Forum and Search --> : php Error


Elivmar
03-02-2005, 06:32 PM
I dont want to use a host that you have to pay for untill I get better at php so for now I use a free website at hostultra.com.
Now it supports php and when I enter
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>

everything turns up correct but for every other code it looks like this
Parse error: parse error, unexpected T_STRING in /data/hosted/elivmar/index.php on line 3

I have it saved as .php

What could be the problem?
The code I use shouldnt be wrong because I used the copy tool and copied the code off a tutorial to see if it works.

phpnovice
03-02-2005, 06:42 PM
Just because you copied and pasted the code doesn't mean it is correct -- where publishing is concerned, there's many a slip between the cup and the lip. So, what is on lines 1 through 4 of the document?

Elivmar
03-02-2005, 07:05 PM
This is what i put
<html>
<body>
<?php//
This is a comment/*
This is
a comment
block
*/
?>


</body>
</html>

MstrBob
03-02-2005, 07:56 PM
It should be:


<?php
//This is a comment
/*
This is
a comment
block
*/
?>


no? Comments beginning with two slashes (//) can only span that same line. Unlike the comment block. And you can't start a comment block on the same line as a comment.