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); $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 { } } else { } }
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!
string(4) "1234"
Hasło wprowadzone: 1234
string(4) "1234"
Password is wrong!