redfire Posted October 3, 2013 Share Posted October 3, 2013 (edited) Hi and Good day, I tried something today with WinHTTP to send data to a php file and i get some compilation errors. here is my code. #include <inet.au3> $ip = _GetIP() $username = @UserName $computername = @ComputerName $osversion = @OsVersion ; string data info $info = $ip & "|" & $username & "|" & $computername & "|" & $osversion $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST" , "gate.php" , False) $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 4.0.20506)") $oHTTP.SetRequestHeader("Referrer", "http://www.REFERRERURL.com") $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.Send($info) MsgBox(11,"Message","HTTPRequest Complete") Please check for errors, i am new to this one too. Edited October 3, 2013 by redfire Link to comment Share on other sites More sharing options...
mrflibblehat Posted October 3, 2013 Share Posted October 3, 2013 1) If gate.php is just a local file it will not work 2) what errors are YOU getting? 3) It is worth trying the WinHTTP UDF made by TranceXX ('?do=embed' frameborder='0' data-embedContent>>) for POST and GET Operations [font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font] Link to comment Share on other sites More sharing options...
redfire Posted October 3, 2013 Author Share Posted October 3, 2013 I am sending it to a server, I am using lo1) If gate.php is just a local file it will not work 2) what errors are YOU getting? 3) It is worth trying the WinHTTP UDF made by TranceXX () for POST and GET Operations Hello, thank you again, How do you mean a local file? I want it to send data to a file in my localhost serveer , it keeps pointing my error, I suggest u compile and run to see the errors, its not saying anything about winhttp udf, kindly see for yourself how it goes. Link to comment Share on other sites More sharing options...
mrflibblehat Posted October 3, 2013 Share Posted October 3, 2013 (edited) The only error I get is from not being able to connect to gate.php, which is what I would expect. the host address should be the full url to your localhost server, not just gate.php If you are receiving different errors to this please show here what SCITE outputs. Edited October 3, 2013 by mrflibblehat [font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font] Link to comment Share on other sites More sharing options...
redfire Posted October 3, 2013 Author Share Posted October 3, 2013 (edited) The only error I get is from not being able to connect to gate.php, which is what I would expect. the host address should be the full url to your localhost server, not just gate.php If you are receiving different errors to this please show here what SCITE outputs. When you say, connect to the full url, kindly help me with a source code, let me see where the erros are. Do you mean something like this : $oHTTP.Open("POST","http://localhost","gate.php" False) I am a bit lost here Edited October 3, 2013 by redfire Link to comment Share on other sites More sharing options...
mrflibblehat Posted October 3, 2013 Share Posted October 3, 2013 (edited) $oHTTP.Open("POST", "http://localhost/gate.php", False) Try This. Edited October 3, 2013 by mrflibblehat [font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font] Link to comment Share on other sites More sharing options...
redfire Posted October 3, 2013 Author Share Posted October 3, 2013 $oHTTP.Open("POST", "http://localhost/gate.php", False) Try This. $oHTTP.Open("POST", "http://localhost/gate.php", False) Try This. Okay i tried it now, works fine now it brings out another error different from the first one. The $oHTTP.Send($info) is like having errors. why is that? Link to comment Share on other sites More sharing options...
mrflibblehat Posted October 3, 2013 Share Posted October 3, 2013 (edited) Looks like it is unable to complete the operation, which suggests it is unable to connect to that URL. Can you access http://localhost/gate.php manually? looks like ths syntax is correct Edited October 3, 2013 by mrflibblehat [font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font] Link to comment Share on other sites More sharing options...
Solution redfire Posted October 3, 2013 Author Solution Share Posted October 3, 2013 Looks like it is unable to complete the operation, which suggests it is unable to connect to that URL. Can you access http://localhost/gate.php manually? looks like ths syntax is correct Looks like it is unable to complete the operation, which suggests it is unable to connect to that URL. Can you access http://localhost/gate.php manually? looks like ths syntax is correct Hello, Were you able to decode where the errors were? Please Let me know what you came up with, I am still having the same errors. Please Let me know so i can correct. Thanking you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now