Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

password variable returns empty field

Status
Not open for further replies.

Delboy14

Programmer
Jun 21, 2001
213
0
0
GB
I know this is simple but I am not sure what is wrong,
I am trying to implement a password field, but when I reference it in the resulting page from the form the password variable is empty. Does anyone know why?


The password code for page one
<code>
<input type=&quot;password&quot; name&quot;password&quot;>

</code>

page2 this is where I use the &quot;$password&quot; variable from the form however the password is empty? also the other variable $Forname_Drop returns the correct value from the form, does anyone know my error?

<code>
if($Forname_Drop==$PasswordCells[0])
{
if($password==$PasswordCells[1])
{
echo &quot;Password & Name Correct&quot;;?><br><?php
}
else
{
echo &quot;Name Correct & Password InCorrect&quot;;?><br><?php

}
}
else
{
echo &quot;Name InCorrect&quot;; ?><br><?php
}
</code>
 
Do you have a = between name and &quot;password&quot; in the input tag? The above does not have it.
 
Here's a little tip I find useful when I have strangeties like that...

if you're using post do it as follows, if you're using get just replace post with get.

foreach ($_POST as $key=>$value) {
echo $key.&quot;=>&quot;.$value.&quot;<BR>&quot;;
}

Then you'll know exactly what variables are being passed along and what they're values are.

That way if it's because you spelled password pasword, you'll see it right there, or if it's because you have your globals off and need to read $_POST[&quot;password&quot;] instead, you'll know it's there... etc.

-Rob
 
thanks for both replies, its definetley these small things that waste the most time :cool:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top