I have a php page which is designed around mobile functionality and loads information from search criteria, information is gathered on the page and that information is then POSTed automatically to a database when the page opens to record the visit and works flawlessly, this is the code:
$mysqli = new mysqli($servername, $username, $password, $dbname);
$stmt = $mysqli->prepare("INSERT INTO `analytics_scans` (`ip_address`, `property_id`, `address`, `town`, `agent_name`, `office`) VALUES (?,?,?,?,?,?)");
$stmt->bind_param('sissss', $_SERVER['REMOTE_ADDR'], $id, $address, $town, $agent, $office);
$stmt->execute();
On this page are 3 'buttons/images' Call, Mail and Share what I want to do is record these events into 3 separate tables exactly as in the code above without leaving the page, I can't reload it because it will record a further page visit. I can't duplicate the one shown and point to the other tables as it's the click it has to record.
Ideally something like an onClick function would be the solution but I'm sure that's not possible without leaving the page.
Any help is appreciated.