vbcoach Posted March 16, 2010 Share Posted March 16, 2010 Hello. Relative noobie to PHP. Want to find out what variables are being passed to output page, and what the variable name is. Can anyone help please? Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/ Share on other sites More sharing options...
trq Posted March 16, 2010 Share Posted March 16, 2010 Maybe.... print_r($_REQUEST); is what your looking for? Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/#findComment-1026807 Share on other sites More sharing options...
vbcoach Posted March 16, 2010 Author Share Posted March 16, 2010 Strange, can't see the "reply" buttons on here in IE8 on Windows 7. yes let me try this. Where in the code would I put this? Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/#findComment-1026811 Share on other sites More sharing options...
vbcoach Posted March 16, 2010 Author Share Posted March 16, 2010 That did not work like I expected. All I got returned was "Array ([phpSESSIONID]=>..." and a bunch of numbers. What I am looking for is a way to see what variables have been passed to this page, what the variable name is and it's resulting value. is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/#findComment-1026816 Share on other sites More sharing options...
vbcoach Posted March 16, 2010 Author Share Posted March 16, 2010 Someone please delete this post. No one is helping. Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/#findComment-1026831 Share on other sites More sharing options...
trq Posted March 16, 2010 Share Posted March 16, 2010 Someone please delete this post. No one is helping. Get real. The code I posted previously will show you all variables passed to the page in the request. What more do you want? Maybe your not getting any results because your not passing any data across in the request OR maybe you still haven't described your issue well enough to get a decent response. Either way, the ball is in your court. Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/#findComment-1026835 Share on other sites More sharing options...
SpankMarvin Posted March 16, 2010 Share Posted March 16, 2010 As the above post says, $_REQUEST is what you need to print to obtain variables passed through POST, GET and COOKIE methods. It's a superglobal and the print function will give you what you're looking for, unless what you have described is in error. However, the session id output IS what you're after, as I believe that refers to cookie information. Which is what you wanted, right? Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/#findComment-1026851 Share on other sites More sharing options...
vbcoach Posted March 16, 2010 Author Share Posted March 16, 2010 Nope. And sorry for the attitude. It was nearly 4am here and I was brain-fried. I was looking for a statement that would print ALL the variables, their names and values. I finally found a code that worked via a google search. Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/#findComment-1026972 Share on other sites More sharing options...
trq Posted March 16, 2010 Share Posted March 16, 2010 Nope. And sorry for the attitude. It was nearly 4am here and I was brain-fried. I was looking for a statement that would print ALL the variables, their names and values. I finally found a code that worked via a google search. Mind sharing then? So we can at least get a hint of what you where wanting. Quote Link to comment https://forums.phpfreaks.com/topic/195399-help-with-finding-what-variables-have-been-passed/#findComment-1027245 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.