![]() |
|
|
#1 | |
|
Registered User
![]() |
[PHP] $_POST was empty due to syntax error
So last night I thought I'd install PHP5.2 on my WAMP server at home. Big mistake. 4 hours later I've wiped my server and reinstalled from WAMPServer2.0. Everything appears to be ok except my main login form wouldn't post or get data:
Code:
<?php
error_reporting(E_ALL);
echo "<pre>";
$data = file_get_contents('php://input');
var_dump($data);
print_r($_REQUEST);
print_r($_POST);
print_r( $GLOBALS );
print_r( $HTTP_GET_VARS );
print_r( $HTTP_POST_VARS );
echo "</pre>";
?>
Quote:
Any reason why a) the form would still show and error_reporting wouldn't catch it? b) the resulting post would be empty? It had me googling for about a hour and a half before I figured it out.
__________________
I know it sounds like I'm in denial, but I'm not. |
|
|
|
|
|
Advertisement
|
|
To remove these adverts, please create an account, or log in! You must have an account to post anyway :-) |
|
|
#3 |
|
Moderator
![]() |
Post the form html code.
__________________
Triathlon calendar; Website Development in Dublin 15; BusSched/TrainSched for Palm OS/Pocket PC/Windows |
|
|
|
|
|
#4 |
|
Registered User
![]() |
After a few more attempts, I took the form html code out of the function I had it in, and it seems to be work fine now. Not sure why that works, but why it worked pre-PHP5.2 or WAMPServer2.0. If forms won't work in functions, I'm in a lot of trouble
![]() ETA: Ignore all my rambling above. It turned out that it was posting but on the next page I redirect back to login if a login cookie isn't set. However I was using HTTP_COOKIE_VARS instead of _COOKIE and this was always unset, so it would always redirect back to the login page with an empty _REQUEST. Simple.
__________________
I know it sounds like I'm in denial, but I'm not. Last edited by corblimey; 01-09-2009 at 16:51. |
|
|
|
![]() |
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|