I have a the below code to capture URL variables and push them to an RDS database. When I open the below as a page using this url
It works perfectly. But when using formstack webhooks to push the data only the date field works.
The main difference is how they execute is the webhook does not open the page on the browser.
Is there something I am missing or is the an AWS RDS limitation.
<?php
$userid = $_GET['UniqueID'];
$username = $_GET['usename'];
$useremail = $_GET['useemail'];
$userphone = $_GET['usephone'];
$userref = $_GET['refid'];
$link = mysqli_connect('xxxx.xxxx.ap-southeast-2.rds.amazonaws.com', 'xxxxx', 'xxxxxx','xxxxxxx');
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// Check if server is alive
if (mysqli_ping($link))
{
echo "Connection is ok!";
}
else
{
echo "Error: ". mysqli_error($link);
}
mysqli_query($link,"INSERT INTO landing_post (`useid`, `name`, `email`, `phone`, `refid`, `DateTime` ) VALUES ('$userid', '$username', '$useremail', '$userphone', '$userref', CURDATE())")
or die(mysqli_error($link));
echo "Entered data successfully\n";
mysqli_close($link);
?>