Hi I've got this function...
And here's my php script...
[code]
<html>
<body>
<?php
$reqType = $_REQUEST['type'];
$newString = $_REQUEST['name'];
$newPass = $_REQUEST['pass'];
$newPass = md5($newPass);
if($reqType == "2")
$fp = fopen( "TEMPORARY HASH FILE" , "a+" ); //Holds the temporary hashed info to check against database
elseif($reqType == "1") //Open data file to add new act info
$fp = fopen( "DATABASE FILE.txt" , "a+" );
fwrite( $fp, $newString . $newPass);
fwrite( $fp, "\n");
fclose($fp)
?>
</body>
</html>
[code]
The way it works, is the user first makes an account, and their name and password get sent to the php file, which hashes it and sends it to the database file. Then the user can login, and when they do that they enter their name and password. These then get sent to the php file with reqType of 2, meaning that they get hashed and sent to the temporary data file. Then Blitz opens the temp one, and ideally reads the most recent entry (this is where I start having problems). Then it opens the permanent database file, and cycles through each entry to see if it matches the temporary one. The problem seems to come with reading the temporary info, because it almost never comes up equal! Any help would be, as always, greatly appreciated.
Function LogIn() name$ = Input("Enter name : ") pass$ = Input("Enter password : ") name = Replace(name," ","_") pass = Replace(pass," ","_") name = name + "|" tcp = OpenTCPStream("alloidgames.com", 80) If tcp Then WriteLine tcp, "GET /PHPFILE?type=2&name=" + name$ + "&pass="+ pass + " HTTP/1.0" WriteLine tcp, "HOST: alloidgames.com" WriteLine tcp, "" EndIf CloseTCPStream tcp tcp = OpenTCPStream("www.alloidgames.com",80) If tcp Then WriteLine tcp,"GET <a href="http://www.alloidgames.com/TEMPORARY" target="_blank">http://www.alloidgames.com/TEMPORARY</a> HASH FILE" WriteLine tcp,Chr$(10) If Not Eof(tcp) Then Repeat lastline$ = ReadLine$(tcp) Until Eof(tcp) End If End If CloseTCPStream tcp tcp = OpenTCPStream("www.alloidgames.com",80) If tcp Then WriteLine tcp,"GET <a href="http://www.alloidgames.com/DATABASE" target="_blank">http://www.alloidgames.com/DATABASE</a> FILE" WriteLine tcp,Chr$(10) If Not Eof(tcp) Then Repeat curline$ = ReadLine$(tcp) If curline$ = lastline$ Then Print "Success" WaitKey Exit End If Until Eof(tcp) End If End If CloseTCPStream tcp WaitKey End Function
And here's my php script...
[code]
<html>
<body>
<?php
$reqType = $_REQUEST['type'];
$newString = $_REQUEST['name'];
$newPass = $_REQUEST['pass'];
$newPass = md5($newPass);
if($reqType == "2")
$fp = fopen( "TEMPORARY HASH FILE" , "a+" ); //Holds the temporary hashed info to check against database
elseif($reqType == "1") //Open data file to add new act info
$fp = fopen( "DATABASE FILE.txt" , "a+" );
fwrite( $fp, $newString . $newPass);
fwrite( $fp, "\n");
fclose($fp)
?>
</body>
</html>
[code]
The way it works, is the user first makes an account, and their name and password get sent to the php file, which hashes it and sends it to the database file. Then the user can login, and when they do that they enter their name and password. These then get sent to the php file with reqType of 2, meaning that they get hashed and sent to the temporary data file. Then Blitz opens the temp one, and ideally reads the most recent entry (this is where I start having problems). Then it opens the permanent database file, and cycles through each entry to see if it matches the temporary one. The problem seems to come with reading the temporary info, because it almost never comes up equal! Any help would be, as always, greatly appreciated.