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


Groups > comp.lang.php > #6572

Re: Stuck on Exercise 1

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: Stuck on Exercise 1
Date Sun, 15 Jul 2012 16:06:30 +0200
Lines 52
Message-ID <a6g137F7duU1@mid.individual.net> (permalink)
References <a9778401-6b17-4963-aeeb-30e64816aa6e@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Trace individual.net sVmxtzQHhpHwL5C6SgtHvQOw8LZzgHDyv99pUvbY80FkvGiHjRnkZnuCi1kLL4oKDz
Cancel-Lock sha1:zrPxdew8AXHq2wof5XuY7ZmSs8U=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120613 Thunderbird/13.0
In-Reply-To <a9778401-6b17-4963-aeeb-30e64816aa6e@googlegroups.com>
Xref csiph.com comp.lang.php:6572

Show key headers only | View raw


On 15/07/12 14:03, tim.whittingham@googlemail.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

Back to comp.lang.php | Previous | Next — Previous 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