form submit from mod_rewrite rule

New to mod_rewrite? This is a good place to start.

form submit from mod_rewrite rule

Postby grahowler » Sat Aug 30, 2003 12:15 pm

HI

I have a situation where, after using a rewrite rule, a form submission's $HTTP_POST_VARS arry is empty.

Lets say I have a rule...

rewriterule1/^[0-9]$ rewrite_page.php&var=$1 [L]

This is fine, then on rewrite_page.php I have a form...

<form action="submit_page.php" method="post">
<input type="text" name="text1">
<input type="text" name="text2">
<input type="submit" name="whatever" value="Go">
</form>

It will submit to submit_page.php but the $HTTP_POST_VARS arry is completely empty.

I've added phpinfo() to submit_page.php and it doesn't help much. In it $_SERVER['REQUEST_METHOD'] registers the request method as GET even though the form submission is clearly set: method="post"

Doing any of the following returns 0.

echo count($_POST);
echo count($HTTP_POST_VARS);
echo count($_GET);
echo count($HTTP_GET_VARS);

I am experiencing this problem on two different servers both acting exactly the same. Each sever has the following:

Apache/1.3.23 | PHP/4.1.2
Apache/1.3.28 | PHP/4.2.2

I am really at a loss here in and this is making life extremely difficult. If anyone has any ideas I would be most grateful.

thx!
grahowler
 

Postby aaroncimolini » Thu Sep 04, 2003 12:30 am

Sanity Check, have you tried this with the rewrite engine turned off?

Thats all I can suggest, hope it helps

Aaron
User avatar
aaroncimolini
 
Posts: 5
Joined: Thu Sep 04, 2003 12:14 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 37 guests

cron