Jump to content
Sign in to follow this  
BJJ

how to send data to server

Recommended Posts

BJJ

Hi

How can i send data frome imputbox to php script on www server use http (POST)

Share this post


Link to post
Share on other sites
BJJ

I know how work Search function but if i make post i dont find nothing about send to PHP on web page

Share this post


Link to post
Share on other sites
BJJ

this is a my page

http://www.quzziy.za.pl/index.php

when you write some text in a box and send this text write on xxx.txt file in the server

i try send some text to this index.php witch AutoIt program

Please help

Share this post


Link to post
Share on other sites
BrettF

Well its obvious you don't know enough about the page you wish to submit data to, or how to use the search.

FYI, search for a HTTP post. So until then, you fail at searching.

Brett

Share this post


Link to post
Share on other sites
BJJ

i make this page , I think i dont must use login procedure becaouse i dont upload file to sarver only send data to this php script

Ps. I read a million and one titles about HTTP , send to php , FTP ect.

Share this post


Link to post
Share on other sites
BrettF

You fail at searching. First off your attitude to getting this complete is wrong. You should at least try. So far you haven't. You say you've searched, I really don't think you have even tried. I haven't bothered looking too hard at the page, but I can see you have a form. I suspect you either use POST or GET when you submit the form correct? Well then have a look at submitting HTTP post and GET requests. Search for that. And then when you're done with your answer in front of your face, post back here and say how you should have searched... Because reading the titles doesn't cut it, you have to read the posts as well...

Cheers,

Brett

P.S- Lesson 2 is that not many people will go out of their way to write scripts from scratch.

Share this post


Link to post
Share on other sites
BJJ

yes I tried and I read very much post's what i find in tag " PHP , HTTP , send , post , get , WGET , CURL , FTP , server "

But I have a hold-up becaouse I frome Poland and my English don't be good nvm.

I translate your post :)

So i found some examples frome other post in the forum

#include <HTTP.au3>
$from = "JOE"
$number = "***-***-****"
$msg = "hi"

$host = "quzziy.za.pl"
$page = "/index.php"
$vars = "trackResponses=No&Send.x=Yes&DOMAIN_NAME=@tmomail.com&min=" & $number & "&require_sender=" & $from & "&text=" & $msg & "count=" & 140-StringLen($msg) & "&msgTermsUse=1"

$data = _HTTPEncodeString($vars)
ConsoleWrite($data & @CRLF)
$socket = _HTTPConnect($host, 443)
$post = _HTTPPost($host, $page, $socket, $data)
ConsoleWrite(@error & @CRLF)
$recv = _HTTPRead($socket,1)
FileWrite( @ScriptDir & "\result.html", $recv[4] )oÝ÷ Úw±µ«­¢+ØÀÌØí½!QQ@ô=©
ÉÑ ÅÕ½ÐíÝ¥¹¡ÑÑÀ¹Ý¥¹¡ÑÑÁÉÅÕÍиԸÄÅÕ½Ðì¤)
½¹Í½±]ɥѡ}!QQAIÅÕÍÐ ÀÌØí½!QQ@°ÅÕ½ÐíA=MPÅÕ½Ðì°ÅÕ½Ðí¡ÑÑÀè¼½ÝÝܹÅÕéé¥ä¹é¹Á°½¥¹à¹Á¡ÀÅÕ½Ð줵Àì
I1¤()Õ¹}!QQAIÅÕÍÐ ÀÌØí½!QQ@°ÀÌØí½5Ñ¡½°ÀÌØí½UI0°ÀÌØí½ÑôÅÕ½Ðí­ÕÉÝÅÕ½Ðì¤(ÀÌØí½!QQ@¹=Á¸ ÀÌØí½5Ñ¡½°ÀÌØí½UI0°±Í¤(%ÀÌØí½5Ñ¡½ôÅÕ½ÐíA=MPÅÕ½ÐìQ¡¸ÀÌØí½!QQ@¹MÑIÅÕÍÑ!È ÅÕ½Ðí
½¹Ñ¹ÐµQåÁÅÕ½Ðì°ÅÕ½ÐíÁÁ±¥Ñ¥½¸½àµÝÝܵ½É´µÕɱ¹½ÅÕ½Ðì¤(ÀÌØí½!QQ@¹M¹ ÀÌØí½Ñ¤(IÑÕɸÀÌØí½!QQ@¹IÍÁ½¹ÍQáÐ)¹Õ¹oÝ÷ Úw±µ«­¢+Ø¥¹±Õ±Ðí%¹ÔÌÐì(¥¹±Õ±ÐíÉÉä¹ÔÌÐì(¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì()¥´ÀÌØíÕÉ°°ÀÌØíÁ½ÍÑÑ((ÀÌØíÕÉ°ôÅÕ½Ðí¡ÑÑÀè¼½ÝÝܹÅÕéé¥ä¹é¹Á°½¥¹à¹Á¡ÀÅÕ½Ðì(ÀÌØíÁ½ÍÑÑôÅÕ½ÐíͽµµÍÍÅÕ½Ðì((ÀÌØí½%¹ÑɹÐô}%
ÉÑ ÀÌØíÕÉ°±±Í±QÉÕ¤(ÀÌØí½%¹Ñɹй¹Ù¥Ñ ÀÌØíÕÉ°°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíÁ½ÍÑѤ)}%1½]¥Ð ÀÌØí½%¹ÑɹФ

But i think this example didn't a good way to solution my problem

i think this function send data to page but dont inject text to php script becaouse this script dont save my message , so dont take this data

Share this post


Link to post
Share on other sites
AzKay

Whats your php script?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites
BrettF

Share this post


Link to post
Share on other sites
BJJ

Source frome PHP

<?php

if(empty($_POST['temat'])&&empty($_POST['tresc'])){

?>

<form action="index.php" method="post">
Msg <textarea name="tresc"></textarea><br />
<input type="submit" value="Wyslij" />
</form>
<?php

}else{
$temat = $_POST['temat'];
$temat = addslashes($temat); 
$tresc = $_POST['tresc'];
$tresc = addslashes($tresc);

$do_zapisu = $temat."\n".$tresc."\n\n";

$fp = fopen('dane.txt', 'a');

fwrite($fp, $do_zapisu);

fclose($fp);

}
?>
Edited by Quzziy

Share this post


Link to post
Share on other sites
BJJ

some Idea ??

Share this post


Link to post
Share on other sites
BrettF

HTTP.au3 should have it covered, and it should be very similar to what you have.

Try something like this:

#include <HTTP.au3>
$from = "JOE"
$number = "***-***-****"
$msg = "hi"

$host = "quzziy.za.pl"
$page = "/index.php"
$vars = "tresc=" & $number & @CRLF & $from & @CRLF & $msg

$data = _HTTPEncodeString($vars)
ConsoleWrite($data & @CRLF)
$socket = _HTTPConnect($host, 80)
$post = _HTTPPost($host, $page, $socket, $data)
ConsoleWrite(@error & @CRLF)
$recv = _HTTPRead($socket,1)
FileWrite( @ScriptDir & "\result.html", $recv[4] )

Just an example. If you have any questions about what the code is doing, just ask :)

Cheers,

Brett

Share this post


Link to post
Share on other sites
BJJ

That's working Greate :)

Thanks

Share this post


Link to post
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
Sign in to follow this  

×