[Scripting] PHP Troubles

Status
Not open for further replies.

NikhilVerma

Padawan
Well I've been getting this problem for quite some time now.

This is a very simple PHP script found in the "Php5 and mySQL Bible"

Code:
<HTML>
<HEAD>
<TITLE>My first PHP program</TITLE>
</HEAD>
<BODY>

<?php

print(“Hello, cruel world

\n�);
phpinfo();

?>

</BODY>
</HTML>

The problem is this when I try to run it. I get this error.

Code:
Parse error: syntax error, unexpected ',' in C:\xampp\htdocs\site\test.php on line 9

What could the error be?
I have made some php scripts earlier and I noticed this problem always occurs with the "echo" or "print" command.

Can you guys shed any light ?

I use XAMPP latest version.

If anyone wants I can post the "phpinfo();" output too...

Thanks in advance
 

alanpaladka

Journeyman
Dear NikhilVerma,

The Double Quotes are wrong in your Script. Please use "" type double quotes. The modified script is below. Please copy it and run :D
<HTML>
<HEAD>
<TITLE>My first PHP program</TITLE>
</HEAD>
<BODY>

<?php

print("Hello, cruel world

\n");
phpinfo();

?>

</BODY>
</HTML>
 
OP
NikhilVerma

NikhilVerma

Padawan
* Smacks himself on the forehead *
How could I not see that !! :evil:
Thanks for your reply alanpaladka ... :)




But I have one more question...
How can I use echo command to output quotes ??


The one that this command is supposed to to...

echo (" "I am an Idiot" ");

I know it's wrong, but what's the right way ?
 
Status
Not open for further replies.
Top Bottom