Jump to content

http post to .php file - need help


Recommended Posts

I whant to make an application to send data to a .php file with POST command but I do not know how.

I have made an atempt to make the .php file:

<?php

$mesaj = "Nume: ".@$_POST["data"]."<br>";

$fp = fopen("EmailData.txt", "a");

fwrite($fp, $mesaj."||");

fclose($fp);

echo "&ok=ok&";

?>

,but I do not know how to sent data with autoit to the @$_POST from the php file...

I have tryed:

#include <HTTP.au3>

$resp = _HTTPPost("www.digitalenergy.ro", "/AutoTeamViewer/send.php", 20, "merge")

MsgBox(0,@error,$resp)

HTTP.au3 from : HTTP.au3

but it does not work...I get @error=2, but anyway, I am not sure this is the way to do it.

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Link to comment
Share on other sites

PHP File:

<?php

$mesaj = "Nume: ".@$_REQUEST["data"]."<br>";

$fp = fopen("EmailData.txt", "a");
fwrite($fp, $mesaj."||");
fclose($fp);


echo "&ok=ok&";

?>

AutoIt:

InetGet("www.digitalenergy.ro/AutoTeamViewer/send.php?data=lolhacks")

See ?

Thx for reply. The php code worked perfectly when executed from the browser but the autoit code doesn't work and return 0. Is there something else I could try?

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Link to comment
Share on other sites

Try this please:

InetGet("http://www.digitalenergy.ro/AutoTeamViewer/send.php?data=lolhacks","result.txt")

$data = FileRead("result.txt")

MsgBox(0, "Result", $data )

Edit: I tested on http://www.digitalenergy.ro/ but it doesn't work. Verify that this isn't your problem.

Edited by Manadar
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...