Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 28-08-2005, 11:10 PM   #1 (permalink)
Alpha Geek
 
NikhilVerma's Avatar
 
Join Date: May 2004
Location: India
Posts: 930
Default [Scripting] PHP Troubles


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
NikhilVerma is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 29-08-2005, 12:14 AM   #2 (permalink)
Broken In
 
Join Date: Sep 2004
Location: Mangalore, Karnataka
Posts: 180
Default

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
Quote:
<HTML>
<HEAD>
<TITLE>My first PHP program</TITLE>
</HEAD>
<BODY>

<?php

print("Hello, cruel world

\n");
phpinfo();

?>

</BODY>
</HTML>
alanpaladka is offline  
Old 29-08-2005, 12:39 AM   #3 (permalink)
Alpha Geek
 
NikhilVerma's Avatar
 
Join Date: May 2004
Location: India
Posts: 930
Default

* Smacks himself on the forehead *
How could I not see that !!
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 ?
NikhilVerma is offline  
Old 29-08-2005, 01:00 AM   #4 (permalink)
Version 2.0
 
Deep's Avatar
 
Join Date: Jan 2004
Location: Mumbai
Posts: 977
Default

Code:
echo ("\"Yes, You are an Idiot :P\"");
that should do the job

Deep
__________________
- Deep Ganatra -
www.whoisdeep.com
www.twitter.com/DeepXP/
Deep is offline  
Old 29-08-2005, 07:44 AM   #5 (permalink)
Alpha Geek
 
NikhilVerma's Avatar
 
Join Date: May 2004
Location: India
Posts: 930
Default

hehe...

Thanks a lot Deep, that worked like a charm...
NikhilVerma is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by abhidev
- by Sujeet
- by Sarath
- by Krow

Advertisement




All times are GMT +5.5. The time now is 08:53 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2