|
Re: why do examples fail to work? [message #171131 is a reply to message #171130] |
Mon, 27 December 2010 07:40 |
Henrik Carlqvist
Messages: 2 Registered: December 2010
Karma: 0
|
Junior Member |
|
|
richard <member(at)newsguy(dot)com> wrote:
> for my efforts, my result is ";}fclose($file);?>
You probably did not configure your web server to use php to parse the php
parts of the php files. Instead your server serves the source of your php
file to the browser.
regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc123(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost
|
|
|
Re: why do examples fail to work? [message #171135 is a reply to message #171130] |
Mon, 27 December 2010 08:30 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
El 27/12/2010 6:58, richard escribió/wrote:
> http://www.w3schools.com/php/php_file.asp
>
> <?php
> $file = fopen("welcome.txt", "r") or exit("Unable to open file!");
> //Output a line of the file until the end is reached
> while(!feof($file))
> {
> echo fgets($file). "<br />";
> }
> fclose($file);
> ?>
>
> for my efforts, my result is ";}fclose($file);?>
>
> regardless of what I enter for the name of the text file, even if it does
> exist. Or how I enter the path.
>
> If it matters, I am using Rapid PHP 2010.
> With the local php 5. server.
As you probably know, PHP runs on the server. If you see the original
source code in the browser, that means that you don't have a working PHP
set-up.
Read the Rapid PHP 2010 documentation to find out how to make its server
run properly or just discard the bundled stuff and install the original
programs, which are normally well documented.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|
|