httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kafka 93" <ka...@www.antichri.st>
Subject Re: mod_rewrite and POST
Date Tue, 30 Apr 2002 20:13:29 GMT
Joshua wrote:
It would help if you gave us some additional info like:

- What version of apache.
- What do you rewriterules look like.

In general, client handling of externally-redirected POSTs is very
inconsistent.  Internal redirection should be ok, however.

I write:

Okay, I've now tried this on both PHP 4.0.6 and 4.2.0, with roughly the same 
results (taking into account some of the changes in terms of error reporting 
etc.) .. in both cases, Apache 1.3.24 has been used.

I've done more testing - hell, I've spent most of the day on this.  For a 
simple example of what I'm seeing, let's say I have a form in form.php that 
looks like:

<FORM ACTION='/form.php' METHOD='POST'>
	<INPUT NAME='foo' TYPE='text'>
	<INPUT TYPE=submit>
</form>
<?
Print "<P>Right now the variable is $foo ... <P>";
?>

.. then everything works fine (notwithstanding the need to set 
register_globals = On, since that's no longer the default on PHP 4.2.0 ..

However, if I change the form so that the target is, say, index.php, and use 
mod_rewrite with the following:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) http://my.server/foo.php

Then everything breaks.  Even though the rewritten form handler is the same 
as it was before!  And indeed, the page loads, so I see the main form again, 
but I get this:

Notice: Undefined variable: foo in foo.php on line 6

.... Is this making sense to anybody?  What seems to be happening is that 
mod_rewrite is trashing all of my form submission data, and I don't know 
why.  Am I missing something obvious?  Or is this a problem with the version 
of Apache I'm running?

Thanks,
--George


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message