Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

HTTP POST questions

For general discussion related FlowStone

HTTP POST questions

Postby Drnkhobo » Mon May 27, 2013 10:17 pm

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 948 times
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: HTTP POST questions

Postby tester » Mon May 27, 2013 10:40 pm

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

Re: HTTP POST questions

Postby Drnkhobo » Mon May 27, 2013 10:43 pm

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?
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA


Return to General

Who is online

Users browsing this forum: No registered users and 57 guests