Jason2gs
2007-07-05 02:32:41
I'm trying to make a small remote login script, using SCAR and PHP, just to play around, but I'm having a bit of a problem.
PHP Code:
[PHP]<?php
$User = $_POST['TheUsername'];
$Pass = $_POST['ThePassword'];
$GoodUser = 'username';
$GoodPass = 'password';
if ($GoodUser = $User and $GoodPass = $Pass) {
echo 'Thank you ;)';
} else {
echo 'Invalid username or password';
}
?>[/PHP]
SCAR Script:
The problem:
Basically, it doesn't work :)
If I comment out one of the AddPostVariable, it registers as an invalid login. As it should.
If I run the script as-is, it registers as a correct login.
If I just change one of the variable values to something else:
It too registers as a valid login :rolleyes:
Please help? I'm still quite new to PHP, but I'm learning :)
PHP Code:
[PHP]<?php
$User = $_POST['TheUsername'];
$Pass = $_POST['ThePassword'];
$GoodUser = 'username';
$GoodPass = 'password';
if ($GoodUser = $User and $GoodPass = $Pass) {
echo 'Thank you ;)';
} else {
echo 'Invalid username or password';
}
?>[/PHP]
SCAR Script:
program New;
var
Client: Integer;
ClientData: String;
begin
Client := InitializeHTTPClient(True, True);
ClearPostData(Client);
AddPostVariable(Client, 'TheUsername', 'username');
AddPostVariable(Client, 'ThePassword', 'password');
ClientData := PostHTTPPageEx(Client, 'http://68.40.80.30:7400/Login.php');
Writeln(ClientData);
end.The problem:
Basically, it doesn't work :)
If I comment out one of the AddPostVariable, it registers as an invalid login. As it should.
If I run the script as-is, it registers as a correct login.
If I just change one of the variable values to something else:
AddPostVariable(Client, 'TheUsername', 'username111');It too registers as a valid login :rolleyes:
Please help? I'm still quite new to PHP, but I'm learning :)