Drezard Posted January 30, 2008 Share Posted January 30, 2008 I'm writing a web proxy but, I want to log all of the POST data that gets posted through it. So, here is my script so far: <?php if (isset($_POST['site'])) { $site = addslashes($_POST['site']); } else { $site = 'http://www.google.com'; } ?> <html> <head> <title> Proxy </title> </head> <body> <form action='proxy.php' method='post'> <input type='text' name='site' value='http://' /> <input type='submit' name='submit' value='GO!' /> </form> <br /> <br /> <iframe src='<?php echo $site; ?>' width='1024' height='512'> </iframe> </body> </html> So, theres my code so far. How would I load all of the POST data that goes through into a variable. I just now want a variable like: $post = $_POST['all-post-data]; What could I do? Dan Quote Link to comment https://forums.phpfreaks.com/topic/88495-php5-logging-post-data/ Share on other sites More sharing options...
laffin Posted January 30, 2008 Share Posted January 30, 2008 $_POST is an array of variables already. if yer outputting to a file. u wud want a recursive function to differentiate between arrays and strings. so yer question is kinda lacking. $post=$_POST; Quote Link to comment https://forums.phpfreaks.com/topic/88495-php5-logging-post-data/#findComment-453008 Share on other sites More sharing options...
trq Posted January 30, 2008 Share Posted January 30, 2008 The easiest thing to do would be to serialize the $_POST array, store it, then unserialize it back again when you need it. Quote Link to comment https://forums.phpfreaks.com/topic/88495-php5-logging-post-data/#findComment-453035 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.