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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password error

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
Hi All,

I have a logon script where the user enters a login and password in a form. When the form is submitted I need to run a check against a DB. What seems to be happening is that the variable that should take the password is not being picked up by the function needed to validate the user.

It doesn't seem to be passed back to the page at all, this is a self referencing page BTW.

I added an echo to print the login and the password at the top of the page to check this and only the login is shown. Does php do something funny with the password input types?

see code:

$page="distrib";
require("commonmn.php");
require("dbconng.php");
//add header
$msg = "Welcome Distributors";
HTMLHeader();
echo $log, $password; -->nothing but the login after submission.......

if ((!$log)&& (!$password)) {
FirstOpen();
}else {
Dlogin($log, $password);
}



function FirstOpen()
{ global $distribName, $distirbID, $distribFName, $distribLName, $distribAddr;
global $distribAddr1, $distribAddr2, $distribCity, $distribZIP, $distribCountry;
global $distribPhone, $distribFax, $distribEmail, $distribTerr;

echo &quot;If you are a current distributor, please login. <br><br>&quot;;
//login form
echo &quot;<center><form name = login action = distrib.php method = post>
<table><tr><td>Login: <input type = text name = log size = 20></td>
<td>Password: <input type = password name = password size = 10></td></tr>
<tr><td align = right colspan = 2><input type = submit value = Login>
<input type = reset value = Clear></td></tr>
</table></form></center>

Please help

Thanks

Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
nothing funny is being done by php with the password type input coming from the browser.
and i tried your code and the echo worked fine printed both the log and password).
try this simple script first,without including anything:
Code:
<?php
echo &quot;username: &quot;. $log . &quot;<br>&quot;;
echo &quot;password: &quot; . $password . &quot;<br><br>&quot;;
?>

<center><form name = login action = temp.php method = post>
<table><tr><td>Login: <input type = text name = log size = 20></td>
<td>Password: <input type = password name = password size = 10></td></tr>
<tr><td align = right colspan = 2><input type = submit value = Login>
<input type = reset value = Clear></td></tr>
</table></form></center>
if this works then there's something wrong with one of your includes maybe or one of the functions.

hope this helps :) (-:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top