PHP: Unable to see variables from POST of a form
I have a very basic form with two fields (a login form). The variables are
posted to a script (shown below), however I am unable to see any posted
vars. I have no idea what I am doing wrong, can somebody help me out?
<?php
add_page_content();
function add_page_content() {
$error = true;
echo ' <div id="page_content">
<h3>Login</h3>
<div id="login_form">
'
. ($error ? '<p class="text_red">Wrong username and/or
password.</p>' : '') . '
<form action="login.php" method="post" enctype="text/plain">
<div id="login_fields">
<div>
<label>Username:</label>
<input id="admin_user_input" type="text"
name="username" ' . ($error ? ('value="' .
htmlspecialchars($_POST["username"]) . '"') : '')
. '>
</div>
<div>
<label>Password:</label>
<input id="admin_pass_input" type="password"
name="password">
</div>
</div>
<input id="login_submit_button" type="submit"
name="submit" value="Go">
</form>
' . 'username: ' . $_POST["username"] . '
</div>
</div>';
}
?>
EDIT: Ops, I have no idea what happened, I lost half of my post... here I
go retyping it:
If I trace the post vars of the request using httpfox addon, here is what
I get: -let's assume I will fill "user" into the username field, "pass"
into password. RAW:
username=user
password=pass
submit=Go
PRETTY:
Parameter Value
username userpassword
Thanks a lot for feedback!
No comments:
Post a Comment