Page 1 of 1

Newbie - Help

Posted: Sat Jun 06, 2009 6:20 pm
by PixieofDoom
Hi there - sorry if this has been answered before somewhere.

I am completely new to php & decided to buy a guide by O'Reilly. It starts with the classic Hello World exercise, but when i coded it into Notepad ++, the echo text does not show up when previewing :( .. ive prob missed something stupidly simple - so if anyone can give me a gentle slap in the right direction, it would be appreciated lol

<?php echo 'Hello. world!' ?>
The tags are highlighted yellow with a red font colour :?

Many thanks :)

Re: Newbie - Help

Posted: Sat Jun 06, 2009 7:02 pm
by kalebaustin
Do you have a webserver/php installed?

Don't know which book you have, but O'reilley should have appendix in the back on how to install apache/mysql

Re: Newbie - Help

Posted: Sat Jun 06, 2009 8:12 pm
by califdon
To further explain what ~kalebaustin is referring to, PHP is a "server script language", which means it is not like HTML and you can't just open a PHP script file in a browser and expect anything to work. A PHP script is interpreted by a web server, so unless you request a file to be sent to your browser by a web server, you won't see any result from the script. You can install Apache on your local machine, if you like, and/or you can upload your scripts to your hosting service and then request them from the server.

Re: Newbie - Help

Posted: Sun Jun 07, 2009 1:11 am
by PixieofDoom
Hi, many thanks for the help.

I will have a look at either using my hosting service, or a friend suggested that I try myusbserver, with apache whilst im learning.

Re: Newbie - Help

Posted: Sun Jun 07, 2009 9:56 am
by Raph
Change

Code: Select all

<?php echo 'Hello. world!' ?>
to this:

Code: Select all

<?php echo 'Hello. world!'[b][color=#FF0000];[/color][/b] ?>
The semicolon you missed is highlighted.