I really tried to figure out this problem but did not success. In my website, I have 2 basic forms. One for log in and one for registration. When I was testing the code in Apache, it was working wonderful. The forms can pass the inputs to another php page and perform checks. But when I moved the code to a hosting server, the form could not pass any data (I made sure I typed in those fields.) I really ran out of ideas what I have done wrong. The PHP version in Apache is 5.4.7, and the php version in hosting is 5.2.17. Below is the code of the forms:
<form action="register_check.php" method="post" style="text-align:center">
<input type="text" name="username" class="form-control" autocomplete="off" placeholder="Username"/>
<input type="password" name="password" class="form-control" placeholder="Password"/>
<input type="password" name="password_again" class="form-control" placeholder="Please type the password again"/>
<input type="text" name="email" class="form-control" placeholder="Email"/><br/>
<input type="hidden" name="token" value="">
<input type="submit" name="register" class="btn btn-primary"/>
</form>
<form action="login_check.php" method="post" style="text-align:center">
<input type="text" name="username" class="form-control" autocomplete="off" placeholder="Username"/>
<input type="password" name="password" class="form-control" placeholder="Password"/>
<input type="hidden" name="token" value="">
<label
<input type="checkbox" name="remember" id="remember"> Remember Me
</label>
<input type="submit" name="login" class="btn btn-primary"/>
</form>
When I was testing in Apache locally, the data could successfully pass to register_check.php or login_check.php depends on which button I pressed. To make sure the data was able to pass through, I wrote this on both register_check.php and login_check.php:
var_dump($_POST);
die();
Even when I typed nothing into the fields, I got an array back:
array(6) { ["username"]=> string(0) "" ["password"]=> string(0) "" ["password_again"]=> string(0) "" ["email"]=> string(0) "" ["token"]=> string(0) "" ["register"]=> string(6) "Submit" }
But now my headache begins. I moved the exactly same code to my hosting server. I typed nothing in the form, and pressed submit. The var_dump gave me back this result:
array(0) { }
and even when I typed something into the input fields, it still gave me back the same result:
array(0) { }
I really ran out of ideas what could have went wrong. Before I was suspecting the php version 5.2.17 might be too old, but to me that is kinda impossible cause this is just a form processing.
So I hope somebody can tell me what is wrong. I couldn't sleep because of this weird problem. Thank you so much!