veedub Posted April 26, 2007 Share Posted April 26, 2007 Hello! I have a PHP 'script1.php' that is basically a listener for another system that has a command writing to script1.php. Going on the basis I can't see the command that is posting to script1.php. I was wondering if there is a way in PHP to see the names and values of all things posted to it? cheers. Quote Link to comment Share on other sites More sharing options...
taith Posted April 26, 2007 Share Posted April 26, 2007 you'd need to store that information into a database, when they're using that file... Quote Link to comment Share on other sites More sharing options...
veedub Posted April 26, 2007 Author Share Posted April 26, 2007 thanks for the reply. That isn't possible on the side that is posting the data. I thought there might be a trick in PHP to do this? I can count the number of values being posted to the script by doing the following: for($x=0;$x<count($_POST);$x++{ $field = $_POST[$x]; // do some action } Quote Link to comment Share on other sites More sharing options...
trq Posted April 26, 2007 Share Posted April 26, 2007 <?php foreach($_REQUEST as $k => $v) { echo "The key '$k' has a value of '$v'\n"; } ?> Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 26, 2007 Share Posted April 26, 2007 If you have a script running on your server that is accepting data from offsite AND it's acting on the information, then clearly your script is able to 'see' the information otherwise it wouldn't do anything. Unless Thorpe's code meets your needs, you'll need to be a bit more descriptive about what you really want. Quote Link to comment Share on other sites More sharing options...
veedub Posted April 26, 2007 Author Share Posted April 26, 2007 Nice on Thorpe that's exactly what i wanted! cheers Quote Link to comment 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.