Need a simple PHP script coded

Status
Not open for further replies.

phatzilla

Supreme Member
Joined
Apr 9, 2009
Messages
1,428
Reaction score
1,086
I'm not a PHP guy but im pretty sure this should be possible and simple to do:

Basically i want a PHP script that whenever anything sends a GET/POST request to it, it will pickup the exact request(raw) and save it in a txt file for later review. I would like to see the raw request exactly as it was sent to the php script / server. Hit me up if you can do this for me
 
Last edited:
Are you using forms or is this a link folks are redirecting to?
 
maybe you want such a script? He writes post and get requests to files and post.txt get.txt


Result: get.txt (or post.txt) record:
param1: black
param2: green
PHP:
function fsave($content,$fileName) {
    $open=fopen($fileName,"a");
    fwrite($open,$content."\n");
    fclose($open);         
}

foreach ($_GET as $key => $value) {
    if ($key != null) {
        fsave($key.':'.$value,'get.txt');
    }
}

foreach ($_POST as $key => $value) {
    if ($key != null) {
        fsave($key.':'.$value,'post.txt');
    }
}
 
maybe you want such a script? He writes post and get requests to files and post.txt get.txt


Result: get.txt (or post.txt) record:
param1: black
param2: green
PHP:
function fsave($content,$fileName) {
    $open=fopen($fileName,"a");
    fwrite($open,$content."\n");
    fclose($open);         
}

foreach ($_GET as $key => $value) {
    if ($key != null) {
        fsave($key.':'.$value,'get.txt');
    }
}

foreach ($_POST as $key => $value) {
    if ($key != null) {
        fsave($key.':'.$value,'post.txt');
    }
}

OP, I was about to write it for you, but this is exactly what you needed.
Thanks ocheretko.
 
I belive u want something to GET from your form and write a text? maybe if posible to send data to your email?
 
ob_start();
var_dump($_POST);
var_dump($_GET);
var_dump($_SERVER);
$data = ob_get_contents();
ob_end_clean();
file_put_contents("filename.txt",$data);
 
Status
Not open for further replies.
This thread has been auto closed due to the forum's thread age policy. Read more.
Back
Top