Page 1 of 1
HTTP POST not working?
Posted: Fri Nov 09, 2012 4:06 pm
by CoreStylerz
Dear support.
I have a great issue with HTTP POST primitive, because it does not send nothing.
I connected:
[string]http://www.website.com[string]
[string]/folder/folder2/script.php[string]
[array] var names [array]
[array] var data [array]
[trigger] trig. button [trigger].
All is setup as in the component reference. but it do nothing.
I tried to disable firewall. Nothing.
How i can solve this?
And another thing, how do i return data from php to the data received(string)?
Re: HTTP POST not working?
Posted: Fri Nov 09, 2012 6:17 pm
by support
Just tested it here and it all works ok?
Do you have an active php script for the HTTP to talk to? (you have to write this yourself on your server)
Here's an example: SendEmail.php
<?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";
?>
Here is FlowStone example to talk to this server script:
There is more information on HTTP Post here:
http://en.wikipedia.org/wiki/POST_%28HTTP%29
Re: HTTP POST not working?
Posted: Fri Nov 09, 2012 7:15 pm
by Drnkhobo
Hey Support, Ive tried your example and just added a bit more text to the message field.
It sends the mail but with only 7 characters. . . ?
I used your example EXACTLY so im confused why its sending only with 7 chars?
I also get a popup displaying my port number, is that correct?
Im using FS2 tho. . .
Re: HTTP POST not working?
Posted: Fri Nov 09, 2012 9:49 pm
by CoreStylerz
Hi thanks for fast reply.
Yes I already done a script in PHP that collect data from post and store in db, then should give a response.
The script use correctly $var = $_POST['var']..
What does not work is sending from fs. I can't understand what does block since the primitive produce no log or debug of what it does.
May the strings are too big?
I will send you details via pm with fan and links to script including source so you can have a look.
At first I though that the problem was made by local server, web matrix (iss + apache2), because it use ports.
Re: HTTP POST not working?
Posted: Tue Nov 13, 2012 12:07 pm
by CoreStylerz
Ok.. i entered http:// in the url and wasn't working
Re: HTTP POST not working?
Posted: Tue Nov 13, 2012 12:26 pm
by admin
I used your example EXACTLY so im confused why its sending only with 7 chars?
I also get a popup displaying my port number, is that correct?
Im using FS2 tho. . .
There was a bug in V2 that caused the pop up (now fixed in V3). You can test it in FS V3 FREE or upgrade.
There is no limit on characters we used this a lot and sent large data sets around using HTTP Post?