Hi Stackers
I have a website where all requests are redirected silently (via .htaccess) to index.php and then PHP is used to show the correct page (by traversing the REQUEST_URI).
I was wondering if it's possible to submit POST data to a fake address too?
I've currently got my form like so
<form action="/whatplant/send-mail" method="post" id="contact-us-form">
And my .htaccess rule is
# redirect mail posting to index
RewriteRule send-mail index.php?send-mail [NC,L]
My index.php checks isset($_GET['send-mail']) which works fine.
This however seems to drop off all the POST data that should be sent to it.
Is there a way to keep the post data? I don't want to use GET because it can't send as much information, though it might not be an issue with a simple enquiry form.
Thank you!
EDIT: I changed the form's action to a test.php with print_r($_POST) and got the correct output. I am still having problems receiving the post data when the action is sent to index.php
Here is my .htaccess for redirecting to index.php
# serve files and dirs if they exist please, otherwise send to index
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php