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


Groups > comp.lang.php > #6572

Re: Stuck on Exercise 1

From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: Stuck on Exercise 1
Date 2012-07-15 16:06 +0200
Message-ID <a6g137F7duU1@mid.individual.net> (permalink)
References <a9778401-6b17-4963-aeeb-30e64816aa6e@googlegroups.com>

Show all headers | 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