Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6588

Re: Stuck on Exercise 1

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: Stuck on Exercise 1
Date 2012-07-16 14:24 +0200
Organization A noiseless patient Spider
Message-ID <ju116r$k58$2@dont-email.me> (permalink)
References <a9778401-6b17-4963-aeeb-30e64816aa6e@googlegroups.com> <jtucba$78l$6@news.albasani.net>

Show all headers | View raw


Am 15.07.2012 14:16, schrieb The Natural Philosopher:

> tim.whittingham@googlemail.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

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Stuck on Exercise 1 tim.whittingham@googlemail.com - 2012-07-15 05:03 -0700
  Re: Stuck on Exercise 1 The Natural Philosopher <tnp@invalid.invalid> - 2012-07-15 13:16 +0100
    Re: Stuck on Exercise 1 Christoph Becker <cmbecker69@gmx.de> - 2012-07-15 14:42 +0200
      Re: Stuck on Exercise 1 The Natural Philosopher <tnp@invalid.invalid> - 2012-07-15 13:49 +0100
        Re: Stuck on Exercise 1 Tim Streater <timstreater@greenbee.net> - 2012-07-15 15:24 +0100
          Re: Stuck on Exercise 1 The Natural Philosopher <tnp@invalid.invalid> - 2012-07-15 21:38 +0100
    Re: Stuck on Exercise 1 Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-15 09:37 -0400
    Re: Stuck on Exercise 1 Tim Streater <timstreater@greenbee.net> - 2012-07-15 15:19 +0100
    Re: Stuck on Exercise 1 Arno Welzel <usenet@arnowelzel.de> - 2012-07-16 14:24 +0200
  Re: Stuck on Exercise 1 Shake <alex.estevezQUENO@QUENOfilnet.es> - 2012-07-15 15:28 +0200
    Re: Stuck on Exercise 1 tim.whittingham@googlemail.com - 2012-07-15 07:07 -0700
    Re: Stuck on Exercise 1 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-07-15 16:18 +0200
  Re: Stuck on Exercise 1 "J.O. Aho" <user@example.net> - 2012-07-15 16:06 +0200

csiph-web