Not getting form post data

When I click the submit button, the form just reloads. I do not get the post data. I guess "if (empty($_POST))" returns true after the submit button is pressed with data in the password input field. What am I doing wrong?
<?php
// IF THERE IS NOTHING IN $_POST, REQUEST THE PASSWORD
if (empty($_POST))
{
?>
<body bgcolor="#F4F4F4">
<form name="getpassword" enctype="text/plain" method="post">
	<table style="width: 764px; height: 84px;" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td colspan="2" align="center"><font size="5">Secure messaging system</font></td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr valign="middle">
			<td colspan="2" align="center">
				<big>Enter your password: &nbsp;</big>
				<input size="30" maxlength="30" name="password" type="password">
				&nbsp;&nbsp;
				<input value="Submit" type="submit">
			</td>
		</tr>

	</table>
</form>
</body>
<?php
}
// END OF THE FORM SCRIPT

// WE HAVE GOT SOMETHING IN $_POST - RUN THE ACTION SCRIPT
else
{
    // THERE IS POST DATA - PROCESS IT
	// ACTIVATE THIS TO SEE WHAT IS COMING THROUGH
    echo "<pre>"; var_dump($_FILES); var_dump($_POST); echo "</pre>\n";
}

Open in new window

LVL 39
thenelsonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Remove enctype="text/plain"
Is there a specific reason you are using it, it is normally used when you have file uploads?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thenelsonAuthor Commented:
That did it. Why did enctype="text/plain" prevent the post?
0
GaryCommented:
In PHP the only valid options are
application/x-www-form-urlencoded
multipart/form-data

Like I said the only times I see enctype is for file uploads as the first one is the default type.
0
thenelsonAuthor Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.