Newbie - Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
PixieofDoom
Forum Newbie
Posts: 2
Joined: Sat Jun 06, 2009 6:15 pm

Newbie - Help

Post 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 :)
kalebaustin
Forum Newbie
Posts: 12
Joined: Mon Nov 19, 2007 11:28 am

Re: Newbie - Help

Post 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
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Newbie - Help

Post 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.
User avatar
PixieofDoom
Forum Newbie
Posts: 2
Joined: Sat Jun 06, 2009 6:15 pm

Re: Newbie - Help

Post 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.
User avatar
Raph
Forum Commoner
Posts: 43
Joined: Wed May 27, 2009 6:33 pm

Re: Newbie - Help

Post 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.
Post Reply