Page 1 of 1

HTTP POST questions

Posted: Mon May 27, 2013 10:17 pm
by Drnkhobo
Hey guys, im trying to mess around with this module (I know its on the forums here somewhere).

I have 3 questions maybe someone here has knowledge of:


1. What is the "ID" field for?

2. How can I send a message back from my server ? (see in the php 'echo $mail_sent ?' )

3. How can I create more key-value pairs to send data back and forth from my server ?

My PHP is non existent atm :lol:

Have a look at my example:
HTTP.fsm
(1.19 KiB) Downloaded 1028 times

Re: HTTP POST questions

Posted: Mon May 27, 2013 10:40 pm
by tester
There is an output node in this primitive "any returned data from the server".
My gues is, what goes back - depends on what you have on the server?
Anyway - what comes back from your server?

But there are IP based primitives (network client and network server), so probably you can use them with it. For example you send a request for IP, you get the IP, and then...

p.s.: my php is like my ruby... ;-)

Re: HTTP POST questions

Posted: Mon May 27, 2013 10:43 pm
by Drnkhobo
my php is like my ruby...

:lol:

Yeah I saw that and inside the fsm is my php script im using.

Ill post it here:

Code: Select all

<?php
//Capture data from $_POST array
$to = $_POST['to'];
//define the subject of the email
$subject = $_POST['subject'];
//define the message to be sent. Each line should be separated with \n
$message = $_POST['Message'];
$ID = $_POST['ID'];

//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: noreply@myemail.com\r\nReply-To: noreply@myemail.com";
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>


see there . .

Code: Select all

echo $mail_sent ? "Mail sent" : "Mail failed";


How do I get this to come back to the module?