php - How to receive values from server request (s2s)? -
i'm trying receive values s2s (postback) pixel, means server requests link www.example.com/?cid=xxxx & want save cid values mysql database. i've tried run code on browser , work fine, when used receive s2s pixel doesn't. i think problem i'm using request, might wrong thing when it's server server. difference between page called client, , when called server?
<?php $servername = "localhost"; $username = "xxxx"; $password = "xxxx"; $dbname = "xxxx"; // create connection $conn = new mysqli($servername, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } // set values insert date_default_timezone_set('asia/jerusalem'); $cid= $_request['cid']; $year= date('y'); $month= date('m'); $day= date('d'); $hour= date('g'); $mediumid= substr($cid, 0, 1); $publisherid= substr($cid, 1, 2); $placementid= substr($cid, 3, 2); $creativeid= substr($cid, 5, 3); $pos= strpos($cid, "_pid") + 4; $dynamicid= substr($cid, 8, ($pos-12)); $sql = "insert ftds (day, month, year, hour, mediumid, publisherid, placementid, creativeid, dynamicid) values ('$day', '$month', '$year', '$hour', '$mediumid', '$publisherid', '$placementid', '$creativeid', '$dynamicid')"; if ($conn->query($sql) === true) { echo "200"; } else { echo "error: " . $sql . "<br>" . $conn->error; } $conn->close(); ?>
Comments
Post a Comment