p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: form action seems right, but now isn't


Message #1 by "Lawrence" <lkrubner@g...> on Tue, 26 Feb 2002 14:58:59 -0500
Okay, even stranger. Note the form action:



<form method="post" action=/testPage.php">



When I hit the submit button, I get bounced to the index.htm file of my web site. Now, that is

happening, in part, because I have an .htaccess file set such that any time there is a request for a

file that doesn't exist on my site, I redirect the requester to my home page.



The implication is that the web site has no such file. Which is fair since there is a quotation mark

missing. But why is there a quotation mark missing? This is the line that creates the line of HTML:



echo "<form method=\"post\" action=\"$self\">" ;







Message #2 by "Hermawan Haryanto" <hermawan@h...> on Wed, 27 Feb 2002 03:20:26 +0700
I don't know why it happen on  your server, but what happen on my server

when I did this string :

echo "<form method=\"post\" action=\"$self\">" ;

the result is :

<form method="post" action="">



But if I did it this way :

echo "<form method=\"post\" action=\"$PHP_SELF\">" ;

Then the result would might be the one that you looking for.



Thanks



Hermawan Haryanto

hermawan@h...



----- Original Message -----

From: "Lawrence" <lkrubner@g...>

To: "beginning php" <beginning_php@p...>

Sent: Wednesday, February 27, 2002 2:58 AM

Subject: [beginning_php] form action seems right, but now isn't





> Okay, even stranger. Note the form action:

>

> <form method="post" action=/testPage.php">

>

> When I hit the submit button, I get bounced to the index.htm file of my

web site. Now, that is

> happening, in part, because I have an .htaccess file set such that any

time there is a request for a

> file that doesn't exist on my site, I redirect the requester to my home

page.

>

> The implication is that the web site has no such file. Which is fair since

there is a quotation mark

> missing. But why is there a quotation mark missing? This is the line that

creates the line of HTML:

>

> echo "<form method=\"post\" action=\"$self\">" ;

>

>

>

>




$subst('Email.Unsub').

>



Message #3 by "Krister" <krister@m...> on Tue, 26 Feb 2002 21:27:56 +0100
Hi Lawrence



It is funny that I got <form method="post" action=""> with that line.

You should write:



echo "<form method=\"post\" action=\"$PHP_SELF\">";



Krister



----- Original Message -----

From: "Lawrence" <lkrubner@g...>

To: "beginning php" <beginning_php@p...>

Sent: Tuesday, February 26, 2002 8:58 PM

Subject: [beginning_php] form action seems right, but now isn't





> Okay, even stranger. Note the form action:

>

> <form method="post" action=/testPage.php">

>

> When I hit the submit button, I get bounced to the index.htm file of my

web site. Now, that is

> happening, in part, because I have an .htaccess file set such that any

time there is a request for a

> file that doesn't exist on my site, I redirect the requester to my home

page.

>

> The implication is that the web site has no such file. Which is fair since

there is a quotation mark

> missing. But why is there a quotation mark missing? This is the line that

creates the line of HTML:

>

> echo "<form method=\"post\" action=\"$self\">" ;

>

>

>

>




$subst('Email.Unsub').

>



Message #4 by "Lawrence" <lkrubner@g...> on Tue, 26 Feb 2002 15:55:43 -0500
From: "Hermawan Haryanto" <hermawan@h...>

> I don't know why it happen on  your server, but what happen on my server

> when I did this string :

> echo "<form method=\"post\" action=\"$self\">" ;

> the result is :

> <form method="post" action="">

>

> But if I did it this way :

> echo "<form method=\"post\" action=\"$PHP_SELF\">" ;

> Then the result would might be the one that you looking for.



Thanks for all the help. However, I was doing essentially what you suggest. Sorry I didn't post this

information before, but the variable $self had been previously defined as this:



$self  = $GLOBALS["PHP_SELF"] ;



So I'm doing the same thing you are. I'm just not getting the same result.








  Return to Index