View Full Version : Posting to a page?
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
masterBB
03-15-2012, 06:50 PM
Could you explain what you mean with
pick up on something?
Are you talking about a .txt file hosted on a server? if so then this should help:
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.
Are you talking about a .txt file hosted on a server? if so then this should help:
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:
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.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 :).
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.
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.
Have you already written the code to do so? No need to use post variables to do that, just load the page and use PHP or something to get their IP and look it up in the database and return true/false.
Zyt3x
03-15-2012, 07:07 PM
GetPage also works to "visit" pages
Kyle Undefined
03-15-2012, 07:10 PM
I actually have all of this already written. I can share with you if you'd like.
I actually have all of this already written. I can share with you if you'd like.
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';
Kyle Undefined
03-15-2012, 07:19 PM
Mine already has the addition and deletion of IP's built and everything too :) Just as simple as yours :p
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.