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 #178661 is a reply to message #178640] Mon, 16 July 2012 12:24 Go to previous messageGo to previous message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma:
Senior Member
Am 15.07.2012 14:16, schrieb The Natural Philosopher:

> tim(dot)whittingham(at)googlemail(dot)com wrote:
>> To my great embarassment. Came away with a copy of PHP5 & MySQL Bible
>> thinking to do a couple of hours study every day of my hols with a
>> view to learning a little 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>
>>
>> Saved as .html and viewed with Wampserver I got nothing
>> but

Why do you expect, that ".html" is interpreted as PHP script? Of course
it should be saved as ".php".

>> \n”); phpinfo(); ?>
>> on the resulting page. Copied and pasted in case of typos, same
>> result. Installed EasyPHP and got the same result. Uploaded file to
>> webserver and viewed it on the web:
>> \n”); phpinfo(); ?>
>> on its own and nothing but.
>>
>> Humph. So, Help please.
>>
>> Tim W
>
> AFAIK all php programs MUST start with <?php even if they are
> immediately reverted to text with ?>

No.

>
> So try
>
> <?php ?>
>
> as the first line.

No - this is not neccessary and no it does not make the webserver
believe it should forward HTML files to PHP. See above - the extension
is the key - ".php" and not ".html".


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
[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: Sat Nov 23 00:43:12 GMT 2024

Total time taken to generate the page: 0.04576 seconds