Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Log data received at postback?

So yeah i entered my site url to the php file as a postback, and these are the instructions

[Image: lSu0Z1a.png]

And i did

$offerid = $_GET['offer_id'];
$offername = $_GET['offer_name'];
$affiliateid = $_GET['affiliate_id'];
$ip = $_GET['ip'];
$ran = $_GET['ran'];

But it's not working... Is there a way i could log what i am receiving and save it as a file? How?
file_put_contents("log.txt",$data)
(Jul 27, 2017 06:44 AM)Charger Wrote:  file_put_contents("log.txt",$data)

How do i set $data? Because as i said i tried with those variables, but i don't know what exactly am i getting... how could i log it all that i am getting
(Jul 27, 2017 09:33 AM)FaberCastell Wrote:  How do i set $data? Because as i said i tried with those variables, but i don't know what exactly am i getting... how could i log it all that i am getting

PHP Code

<?php 
$data 
= $offerid . "\r\n" . $offername  . "\r\n"  . $affiliateid  . "\r\n"  . $ip   . "\r\n"  .  $ran  . "\r\n"; 

Puts each of these variables on a new line use the code posted from charger to add to text file.
(Jul 27, 2017 12:25 PM)CodeBinary Wrote:  
PHP Code

<?php 
$data 
= $offerid . "/r/n" . $offername  . "/r/n"  . $affiliateid  . "/r/n"  . $ip   . "/r/n"  .  $ran  . "/r/n"; 

Puts each of these variables on a new line use the code posted from charger to add to text file.

Your "/r/n"'s should be "\r\n". Along with that, "\n" is the standard POSIX style so unless you're on Windows you should be using that.
(Jul 27, 2017 12:29 PM)Vana Wrote:  Your "/r/n"'s should be "\r\n". Along with that, "\n" is the standard POSIX style so unless you're on Windows you should be using that.

O ya my bad im usually using html so I use <br> i don't work with text files much.
(Jul 27, 2017 12:25 PM)CodeBinary Wrote:  
PHP Code

<?php 
$data 
= $offerid . "\r\n" . $offername  . "\r\n"  . $affiliateid  . "\r\n"  . $ip   . "\r\n"  .  $ran  . "\r\n"; 

Puts each of these variables on a new line use the code posted from charger to add to text file.


what i want is $data = all data that i receive, because i don't know what exactly am i getting, so i can see what i am working with
(Jul 27, 2017 03:50 PM)FaberCastell Wrote:  what i want is $data = all data that i receive, because i don't know what exactly am i getting, so i can see what i am working with

PHP Code

<?php

$data 
= json_encode($_GET) . "\n";
file_put_contents("log.txt", $data, FILE_APPEND);

?>


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by JASDec 19, 2017 08:57 AM 8 230 Dec 19, 2017 08:57 AM
Last Post: JAS
[PHP] by JASDec 7, 2017 02:35 PM 4 185 Dec 7, 2017 02:35 PM
Last Post: Charger
[PHP] by CodeBinaryApr 16, 2016 08:53 AM 8 210 Apr 16, 2016 08:53 AM
Last Post: CodeBinary