Jump to content

Display all visitor request variables


StevenOliver

Recommended Posts

For debug purposes, I want to see all (each and every possible) variables from a website visitor, e.g.
• their user agent (e.g. cURL)
• the reqest string they used (e.g. "https://example.com/product.php?sku=12345")
• their IP address
• and everything else I haven't thought of

I know how to save the info in a database, I might even have the info emailed to myself, I just can't remember the "one-liner" I used to use to capture this info.

Thank you in advance!

 

Link to comment
Share on other sites

Thank you both gw1500se and Requinix! The answer from gw1500se was the one I was looking for.... but it ended up not working -- didn't display anything but a blank screen, so maybe some configuration on my server is interfering... The answer from Requinix is important, too -- however, when I tried "print_r($_SERVER)" and just got a blank screen, I gave up..... until (several hours later) it dawned on me that I had to loop through nested arrays. This works for me here:

foreach($_SERVER as $a => $b) {
echo $a;
echo "\n";
echo $b;
echo "\n";
foreach ($b as $c=>$d) {
echo "$c";
echo "\n";
echo "$d";
}
}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.