I have a simple IFTTT recipe that triggers whenever an instagram
photo is posted with the hashtag #dog (used as an example since it triggers nearly every second and makes it easy to troubleshoot). This works fine. The associated action is with Maker
to submit a GET
call to a website as pictured below.
This then runs a very simple PHP
script as below.
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$dump = $conn->real_escape_string(var_export($_GET, true));
$sql = sprintf("INSERT INTO table (dump) VALUES ('%s');", $dump);
echo $sql;
if ($conn->query($sql) !== TRUE) {
echo "#######Error: ". $conn->error ."#######<br/>";
}
$conn->close();
This should simply 'dump' the $GET
array into the MySQL
table. When I use the browser to run the PHP
script such as
http://www.example.com?data=test&data2=testing
I get the correct response in the DB. However, when triggered through IFTTT I get an empty array.
I've tried all the options for Content Type
and both POST
and GET
Methods
but nothing is submitted either way. I have found a workaround by putting the GET call together in the URL field, BUT this isn't tidy and I figure it should work so want to understand the problem. Also, I'd like to POST rather the GET if possible.
I assume the problem to be with the Body
and it not being formatted correctly, but I've tried every combination I can think of and what you see here is how the example on IFTTT is displayed.
Does anyone have any ideas or a known solution.
Thanks,