why do examples fail to work?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

$file = fopen("welcome.txt", "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
  echo fgets($file). "<br />";

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.

Re: why do examples fail to work?

Quoted text here. Click to load it

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?

El 27/12/2010 6:58, richard escribió/wrote:
Quoted text here. Click to load it

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

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

Re: why do examples fail to work?

Quoted text here. Click to load it

Can you get any php code to run ?

The Software Developer Job Board

Site Timeline