HTTP POST questions

For general discussion related FlowStone
Post Reply
Drnkhobo
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

HTTP POST questions

Post 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
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: HTTP POST questions

Post 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... ;-)
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Drnkhobo
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: HTTP POST questions

Post 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?
Post Reply