For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > December 2005 > Newbie - PHP not integrated in html anymore - <submit> button launches dreamwea









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Newbie - PHP not integrated in html anymore - <submit> button launches dreamwea
Alain Chamoux

2005-12-06, 6:57 pm

....or asks instruction for the "download".

I created a little form post with action linking to a separate php
page. This worked ok for a while but suddenly the rest of the program
didn't unfold as before, but just edited the php code in dreamweaver
(or requested instructions of "what to do with the download - in
Firefox").

Any idea?
Many thanks

Alain, aka Newbie Magnum :-)
Alain Chamoux

2005-12-07, 3:56 am

<<>Yes, maybe a better description of the problem>>

The example below is taken from a introductory book to PHP (in French,
but it shouldn't matter :-). This example, typically, worked perfectly
at the beginning.

--------------------------
Error message :
--------------------------

Pressing the "Envoyer" (submit) button on the HTML page opens a window
with the following messages (approx. translation from French):

Quote

You chose to open

"dis_bonjour.php"

which is a file of type php.script

from c:\program files\eashPHP1-8\www.exemples.

What must FireFox do with this file ?

.. open with PHPfile
.. Record on disk

[ ] Always perform the same operation in the future

UnQuote

Note: I get the same type of message when I use IE instead of Firefox.
Before I amended the MIME set-up in folder option, the call to PHP was
even opening Dreamweaver.

Question : What do you mean by "parse error" and how can I correct it?

Many thanks in advance.

Alain


--------------------------
Html calling page :
--------------------------

<html>
<head>
<title>Programme Bonjour.htm</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<p> </p>
<form method="post" action="dis_bonjour.php">

<p> Prenom
<input type="text" name="prenom">
</p>

<p> Nom
<input type="text" name="nom">
</p>

<p>
<input type="submit" name="submit" value="Envoyer">
</p>

</form>
</body>
</html>

--------------------------
PHP routine :
--------------------------

<?
/* Fichier dis_bonjour.php */

print("<html><head><title>Bonjour Visiteur !</title>");
print("<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=iso-8859-1\"></head>");
print("<body bgcolor=\"#FFFFFF\" text=\"#000000\">");

print("Bonjour ");
echo $_POST['prenom'];
print(" ");
echo $_POST['nom'];

print("</body></html>");

?>

--------------------------


-----------------------------------------
On Tue, 06 Dec 2005 22:56:47 +0100, Stefan Rybacki
<stefan.rybacki@gmx.net> wrote:
[color=darkred]
>Alain Chamoux wrote:
>
>Ok.
>
>
>Parse Error.
>
>
>Yes, maybe a better description of the problem.
>
>Regards
>Stefan
>
Kimmo Laine

2005-12-07, 7:56 am

"Alain Chamoux" <achamoux@bluewin.ch> wrote in message
news:8a8dp19cs1059kg9h2nk2jq80g7c63vqu9@
4ax.com...
> <<>Yes, maybe a better description of the problem>>
>
> The example below is taken from a introductory book to PHP (in French,
> but it shouldn't matter :-). This example, typically, worked perfectly
> at the beginning.
>
> --------------------------
> Error message :
> --------------------------
>
> Pressing the "Envoyer" (submit) button on the HTML page opens a window
> with the following messages (approx. translation from French):



What ever the real problem is, the result is that the php code is not
executed, but it is passed directly as a file. Possible explanations are
incorrectly configured web server or lack of web server.

This looks kinda odd:
c:\program files\eashPHP1-8\www.exemples.

It should be something like http://localhost/www.examples or something. It
would appear you are opening the file directly from your computers
filesystem, when you should be opening it from a server. The server does the
magic of executing the php code, but when you open it directly, it treats it
as a downloadable file. This implys strongly that you haven't installed a
web server or at least you are not calling the files through it.

It's not a php problem in my opinion, you need to find out what a web server
is, how you configure it to execute php and how you call pages from the web
server instead of the filesystem.

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
antaatulla.sikanautaa@gmail.com.NOSPAM.invalid


Hilarion

2005-12-07, 7:56 am

Alain Chamoux wrote:
> ...or asks instruction for the "download".
>
> I created a little form post with action linking to a separate php
> page. This worked ok for a while but suddenly the rest of the program
> didn't unfold as before, but just edited the php code in dreamweaver
> (or requested instructions of "what to do with the download - in
> Firefox").
>
> Any idea?
> Many thanks
>
> Alain, aka Newbie Magnum :-)



It looks like your server does not treat this (or all) PHP scripts
as scripts. In that case the server allows a normal download of
such file (without executing it). To make sure hit the submit button
again and choose "download" when your browser asks you what to do
and check if the downloaded file contains the PHP script.

Cause of this problem may lay in wrong PHP script file extension
(not *.php, but eg. *.pgp) or the webserver PHP module got corrupt
or switched off.


Hilarion
Alain Chamoux

2005-12-07, 6:57 pm

Thanks to all.

In fact, I *had* accessed the html/php programs through the web server
already, to no avail. And again: the same setup and programs had
worked perfectly before.

But I start facing more annoying problems, very probably unrelated to
PHP : the well-known blue screen with a "IRQL_NOT_LESS_OR_EQUAL" text
that looks somewhat bizarre, because I haven't installed any new
hardware for a long time.

So I guess I'll have to put my PHP problems aside for a while :-) Time
to check my backups :-))

Thanks anyway.
Alain




On Wed, 7 Dec 2005 12:28:12 +0100, "Hilarion"
<hilarion@SPAM.op.SMIECI.pl> wrote:

>Alain Chamoux wrote:
>
>
>It looks like your server does not treat this (or all) PHP scripts
>as scripts. In that case the server allows a normal download of
>such file (without executing it). To make sure hit the submit button
>again and choose "download" when your browser asks you what to do
>and check if the downloaded file contains the PHP script.
>
>Cause of this problem may lay in wrong PHP script file extension
>(not *.php, but eg. *.pgp) or the webserver PHP module got corrupt
>or switched off.
>
>
>Hilarion

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com