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 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; 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. Link to comment https://forums.phpfreaks.com/topic/88495-php5-logging-post-data/#findComment-453035 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.