FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Stuck on Exercise 1
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Stuck on Exercise 1 [message #178645 is a reply to message #178639] Sun, 15 July 2012 14:06 Go to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma:
Senior Member
On 15/07/12 14:03, tim(dot)whittingham(at)googlemail(dot)com wrote:

> elementary PHP to assist me with my CMS website work.
> Read through the first couple of Chapters until I came to
> Chapter 4 and 'Your First PHP Program 'Hello World'' in
> which I am instructed to type
>
> <HTML>
> <HEAD>
> <TITLE>My first PHP program</TITLE>
> </HEAD>
> <BODY>
> <?php
> print(“Hello, cruel world<BR><BR>\n”);
> phpinfo();
> ?>
> </BODY>
> </HTML>

As Shake already pointed out, the “ and ” ain't the same as " and you
should use a text editor instead of an office application to edit your
php scripts.
As you seems to be a microsoft user, I suggest you download and install
notepad++ and you find their homepage at http://notepad-plus-plus.org


> Saved as .html and viewed with Wampserver I got nothing

This will tell your Apache that the file will be an html file and it
will not be parsed by the php engine (contrary to what The Natural
Philosopher wrote). You need to either reconfigure your Apache to handle
all .html files as php scripts (this will mean all files ending with
..html will be parsed by the php engine and give overhead for your
computer if you are serving plain html files), the best solution is to
name the file to end with .php and the file will be parsed by the php
engine.

> but
>
> \n”); phpinfo(); ?>

This for your script file isn't a plain html file, so it will try it's
best to understand your HTML and present what you wrote, if you would
choose to look at the source of the HTML page in your browser, you will
see it's exactly the same as what you wrote in your file.


--

//Aho
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Lost $_SESSION in Google Chrome
Next Topic: Business Developer for IT company
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 20:21:09 GMT 2024

Total time taken to generate the page: 0.05624 seconds