Created
May 4, 2017 12:25
-
-
Save BrianEmilius/70fb473cc72414cd451d92a403fc9ece to your computer and use it in GitHub Desktop.
Revisions
-
BrianEmilius created this gist
May 4, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ <?php require_once 'functions.php'; if (requestMethodCheck('GET')) { $myArray = getRequestArray(INPUT_GET); $name = $myArray['name']; $origin = $_SERVER['HTTP_REFERER']; $ip = $_SERVER['REMOTE_ADDR']; $target = $myArray['target']; $data = array('action' => 'clicktracking', 'name' => $name, 'origin' => $origin, 'ip' => $ip); $data_string = json_encode($data); $ch = curl_init('http://localhost/undervisning/reklamer/api.php'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch); header("Location: $target"); }