Jump to content

[SOLVED] Simple PHP password issue.


Foser

Recommended Posts

For some reason my own password script does not work.

 

 

Process.php

<?php 
$pw = $_POST['pw'];
if ($pw == "1234"){ 
echo "You are Successfully Logged in!"; }
else {
echo "You are not an authorized user."; }
?>

 

 

index.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Basic Single Password</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="pw" method="post" action="process.php">
  <input name="textfield" type="password" size="6" maxlength="4">
  <input type="submit" name="Submit" value="Submit">
</form>

</body>
</html>

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/52090-solved-simple-php-password-issue/
Share on other sites

change

 

<input name="textfield" type="password" size="6" maxlength="4">

to

<input name="pw" type="password" size="6" maxlength="4">

 

or

 

$pw = $_POST['textfield'];

 

 

<input name="textfield" type="password" size="6" maxlength="4">

 

then please click solved!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.