Checking variables
hey guys, i am working with sessions and i need to check which variables exist within the session and print the ones that do exist to the users page. how can i do this?
hey guys, i am working with sessions and i need to check which variables exist within the session and print the ones that do exist to the users page. how can i do this?
detox posted this at 13:31 — 17th February 2002.
They have: 571 posts
Joined: Feb 2001
I assume this is ASP?
Just go through the session variables with an if then else loop... When you have a match, send it to the screen.
to speed it up you could make a custom dictionary object and then roll through that checking which variables are filled. When you have the results simply response.write them to the page.
a little more info would be nice....
Mark Hensler posted this at 19:39 — 17th February 2002.
He has: 4,048 posts
Joined: Aug 2000
For some reason, ASP popped into my mind as well.
If you need PHP code:
<?php
foreach ($HTTP_SESSION_VARS as $key=>$value) {
echo \"$key = $value\n\";
}
?>
Mark Hensler
If there is no answer on Google, then there is no question.
a_gajic posted this at 20:18 — 17th February 2002.
They have: 71 posts
Joined: Aug 2001
oops sorry, PHP. Mark's code worked okay I just adjusted it a tiny bit thanks guys
detox posted this at 01:34 — 18th February 2002.
They have: 571 posts
Joined: Feb 2001
Just to let everyone know I am beginning to feel like a dinosaur being more proficient in ASP and ASP.Net than PHP!!!!!!
sob sob, sympathy please!
Mark Hensler posted this at 04:07 — 18th February 2002.
He has: 4,048 posts
Joined: Aug 2000
I can program ASP... But the last time I programmed ASP for an employer was over a year ago. I haven't had access to a server, so I haven't used it since. Possitive and negative effect: I've strengthened my PHP skills, but my knowledge of ASP is wearing thin.
Vive le Open Source!
Mark Hensler
If there is no answer on Google, then there is no question.
Peter J. Boettcher posted this at 13:31 — 18th February 2002.
They have: 812 posts
Joined: Feb 2000
detox, I feel your pain
I'm also in the ASP camp, I just don't have the time right know to start messing with PHP in depth
detox posted this at 04:14 — 19th February 2002.
They have: 571 posts
Joined: Feb 2001
Exactly,
I am busy getting lost in .Net right now, so I only have a little bit of time to get the rudimentaries of PHP.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.