Re: Does HTACCESS block $_POST ?
| From: | Ed Greenberg | Date: | Mon, 21 Apr 2025 12:20:36 +0000 |
| Subject: | Re: Does HTACCESS block $_POST ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-328675@lists.php.net to get a copy of this message | ||
On 4/20/25 23:27, gordonisnz@gmail.com wrote:
Hello. Ive got an odd problem with my php (seems a recent issue)... Heres my htaccess: Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*)$ vyb6a.php [QSA,L] for the last few days, i'm no longer receiving ANY $_POST values... ive even got $r=print_r($_POST,true); echo $r; at the beginning of my script before anything else & nothing comes through. so i do think is an htaccess issue. Does anyone have an idea how to solve ? (im using clean URLs) Ps the script works fine - apart from receiving $_POST valuesHi, I think my code has posted variables through rewrites all the time. I've never considered that it wouldn't work. I went through a troubleshooting process in my mind (a dark and dangerous place) and came up with this. As a test, you might take out the htaccess and post to the page directly (unclean URLs) and see if the POST variables come through. Is the posted data present in $_REQUEST? Does your php.ini or other source of settings have enable_post_data_reading set on? I didn't even know that this setting existed until I went searching this morning. Is your php_max_size variable set in such a way to interfere with the posted variables? Perhaps you should try another script with just the first line (the print_r) statement and see if you can post to that, with and without a rewrite. Does your page contain a class? If so, is your print_r accidentally inside the class? (I got this from a 12 year old stack overflow post) Let us know how your troubleshooting is going. Hopefully some others will chime in. Ed Greenberg