How can I get simba to go to a page and pick up on something? and return if that item is correct?
Any idea?
Thanks Mat
Printable View
How can I get simba to go to a page and pick up on something? and return if that item is correct?
Any idea?
Thanks Mat
Could you explain what you mean with?Quote:
pick up on something
Are you talking about a .txt file hosted on a server? if so then this should help:
Simba Code:program new;
Function GetInfo: String;
Begin
InitializeHTTPClientWrap(True); //initialize the HTTP client
Result := GetHTTPPage(0, 'URL here'); //get the info from the web page
Writeln(result); //write the result for debug purposes
FreeHTTPClient(0); //Free the HTTP client
End;
begin
if GetInfo = 'command here' then
Begin
ProcHere;
End;
end.
I haven't tested this. But it should work.
Not sure if you want to use InitializeHTTPClientWrap ;).
@OP:
Don't know what you mean by pick up on something, but if you meant get the page the it responds with, the HTML is in the page variable :).Simba Code:var
Client : integer;
Page : string;
begin
Client := InitializeHTTPClient(False);
AddPostVariable(Client, 'Name', 'Value');
AddPostVariable(Client, 'Name', 'Value');
Page := PostHTTPPageEx(Client, 'http://example.com/post.php');
FreeHTTPClient(Client);
end.
Like I want to make a page that gets there IP on load and checks if its in a database and will echo text on the page say 'yes' if its true or 'No' if its not in database.
GetPage also works to "visit" pages
I actually have all of this already written. I can share with you if you'd like.
php Code:mysql_connect('host', 'user', 'pass');
mysql_select_db('database');
$q = mysql_query('SELECT * FROM table WHERE ip="' . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . '" LIMIT 0,1');
echo (mysql_num_rows($q) == 1) ? 'true' : 'false';
Mine already has the addition and deletion of IP's built and everything too :) Just as simple as yours :p