Discussion:
php script not working in firefox
Bogdan Cristea
2007-08-29 09:59:35 UTC
Permalink
I have a html page with a search box using a php script. However the search
facility does not work, each time I press enter a new window appears asking
to open or save the file *.php. Is there something else I need to install in
order to have the php script working?
--
Bogdan Cristea
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Leo Eraly
2007-08-29 10:10:43 UTC
Permalink
Post by Bogdan Cristea
I have a html page with a search box using a php script. However the search
facility does not work, each time I press enter a new window appears asking
to open or save the file *.php. Is there something else I need to install in
order to have the php script working?
PHP works server-side. So it has nothing to do with your browser.
Probably there is something wrong with the server configuration.


Kind regards,
--
Leo Eraly
<leo at unstable dot be>
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Bogdan Cristea
2007-08-29 10:17:02 UTC
Permalink
Sorry, I was not clear enough. The web page is opened locally.
Post by Leo Eraly
Post by Bogdan Cristea
I have a html page with a search box using a php script. However the
search facility does not work, each time I press enter a new window
appears asking to open or save the file *.php. Is there something else I
need to install in order to have the php script working?
PHP works server-side. So it has nothing to do with your browser.
Probably there is something wrong with the server configuration.
Kind regards,
--
Bogdan Cristea
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Leo Eraly
2007-08-29 10:25:37 UTC
Permalink
Post by Bogdan Cristea
Sorry, I was not clear enough. The web page is opened locally.
I assume this is the reason why it's not working

A php page is parsed on the server and sends the html and output to the
client ( = your browser).

from http://be.php.net/manual/en/introduction.php

...
What distinguishes PHP from something like client-side JavaScript is
that the code is executed on the server.
...


You cannot open a php file locally in your browser. If you want to test
it on a local machine you need to run a webserver on your machine and
access the page by surfing to it (e.g http://localhost/page.php)

Leo
--
Leo Eraly
<leo at unstable dot be>
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Daniel Bauer
2007-08-29 10:27:48 UTC
Permalink
Post by Bogdan Cristea
Sorry, I was not clear enough. The web page is opened locally.
Post by Leo Eraly
Post by Bogdan Cristea
I have a html page with a search box using a php script. However the
search facility does not work, each time I press enter a new window
appears asking to open or save the file *.php. Is there something else
I need to install in order to have the php script working?
PHP works server-side. So it has nothing to do with your browser.
Probably there is something wrong with the server configuration.
Bogdan Cristea was right anyway... If it's opened locally you need a webserver
(apache) running on your computer. The webserver only executes those scripts
that are located in the directories that are configured for it. IIRC if you
installed the server with Yast then by default you have a directory /srv and
pages or scripts you place in (subdirectories in) there are executed.

Also, to make apache handle your scripts you must load the page correctly with
http://localhost/your_dir_inside_srv/your_page.html
(and *not*: file:///srv/your_dir/your_page.html)

hth

Daniel
--
Daniel Bauer photographer Basel Switzerland
professional photography: http://www.daniel-bauer.com
erotic art photos: http://www.bauer-nudes.com/en/linux.html
Madagascar special: http://www.fotograf-basel.ch/madagascar/
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Daniel Bauer
2007-08-29 10:29:35 UTC
Permalink
Sorry: I wanted to say, that Leo Eraly was right, of course :-)
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Kai Ponte
2007-08-29 13:07:42 UTC
Permalink
Post by Bogdan Cristea
I have a html page with a search box using a php script. However the search
facility does not work, each time I press enter a new window appears asking
to open or save the file *.php. Is there something else I need to install
in order to have the php script working?
Is PHP up and running as a service to apache?

Since PHP is a server-side script, if you're getting any "PHP" files on the
browser, your "server" isn't running or processing the file properly.

You need to make sure (a) the PHP script is properly written (b) apache is
running PHP as a module and (c) that the script is being called from within
your page.

HTH!
--
kai ponte
www.perfectreign.com
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Jos van Kan
2007-08-29 17:25:13 UTC
Permalink
Post by Bogdan Cristea
Sorry, I was not clear enough. The web page is opened locally.
Post by Leo Eraly
Post by Bogdan Cristea
I have a html page with a search box using a php script. However the
search facility does not work, each time I press enter a new window
appears asking to open or save the file *.php. Is there something else I
need to install in order to have the php script working?
PHP works server-side. So it has nothing to do with your browser.
Probably there is something wrong with the server configuration.
If you want to test php scripts without installing a full blown webserver you
may consider installing php on your machine and do a

php foo.php > foo.html

from the command line.

Alternatively there is the invaluable

http://www.meandeviation.com/tutorials/learnphp/php-syntax-check

Regards,
--
Jos van Kan registered Linux user #152704
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Loading...