Witam,
Mam kod który przed zapisem danych żąda hasła.
if ($sVar->Command != NULL) {
if ( sha1($_POST['psswd']) == PWD_SHA) {
if ($sVar->Command=='Add'){
$sVar = getVariablesAdd($sVar);
if (!addQuerySelect($conn,$sVar)) {
}
}
elseif ($sVar->Command=='Erase'){
$sVar = getVariablesErase($sVar);
if (!EraseQuery($conn,$sVar->id)) {
}
}
elseif ($sVar->Command=='Update'){
$sVar = getVariablesUpdate($sVar);
$ipAddFile = fopen(IPtextName
, "r") or
die("Unable to open file!"); $baseURL = 'http://'. $ipAdd;
$fullURL = $baseURL;
switch ($sVar->action) {
case "Update From List":
$fullURL = $baseURL. '/gpio/u';;
break;
case "Get Current Status":
$fullURL = $baseURL. '/gpio/s';
break;
case "Set On":
$fullURL = $baseURL. '/gpio/1';
break;
case "Set Off":
$fullURL = $baseURL. '/gpio/0';
break;
}
}
else {
die('Something not right!'); }
}
else {
echo "Hasło wprowadzone: ";echo
($_POST['psswd']) ; die('Password is wrong!'); }
}
Niestety coś mi on nie działa bo otrzymuję komunikat o błędnym haśle.
Cytat
Hasło z pliku: 1234
string(4) "1234"
Hasło wprowadzone: 1234
string(4) "1234"
Password is wrong!