CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 TIP: Enumerate Session Parameters/Values

Print topic Send  topic

Author Message
maxhugen

Posts: 272
Posted: 04/09/2008, 4:24 PM

Could anyone suggest how to code a simple page that would loop through all the Session parameters and their values, and display them on the page, so that I can see what I actually have in the session?
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
DonP
Posted: 04/10/2008, 8:59 AM

You can add a label where you want the list to appear, then add this to
a Before Show event. It lists cookies and session values and several
other handy items useful in troubleshooting:

$s = "<h4>Server Values</h4>";
foreach($_SERVER as $key=>$value)
$s = $s . "<strong>" . $key . "</strong> = " . $value . "<br>";

$s = $s . "<p><h4>Session Values</h4>";
foreach($_SESSION as $key=>$value)
$s = $s . "<strong>" . $key . "</strong> = " . $value . "<br>";

$s = $s . "<p><h4>Cookie Values</h4>";
foreach($_COOKIE as $key=>$value)
$s = $s . "<strong>" . $key . "</strong> = " . $value . "<br>";

$s = $s . "<p><h4>GD Support</h4>";
foreach(gd_info() as $key=>$value)
$s = $s . "<strong>" . $key . "</strong> = " . $value . "<br>";

//$s = $s . "<p><h4>PHP Details</h4>";
//foreach(phpinfo() as $key=>$value)
//$s = $s . "<b>" . $key . "</b> = " . $value . "<br>";

$GridName->Label->SetValue($s);

Don (DonP)

maxhugen wrote:
> Could anyone suggest how to code a simple page that would loop through all the
> Session parameters and their values, and display them on the page, so that I can
> see what I actually have in the session?
> _________________
> Max
> (99.9% CCS Newbie)
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
maxhugen

Posts: 272
Posted: 04/10/2008, 3:41 PM

Thanks Don, just what I needed.

Just one question, the label actually displays the html markup, instead of applying it, eg:
<p><h4>Session Values</h4><strong>Session_PersonID</strong> = 0  
<br><strong>Session_UserLogin</strong> = guest<br><strong>Session_GroupID  
</strong> = 3<br><strong>FName</strong> = Guest<br>
As I simply added a label to a new page, the last line of my code is:

$Component->SetValue($s);

Any idea on what I've done wrong pls?
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
DonP
Posted: 04/10/2008, 3:48 PM

You have to set the label to HTML. Otherwise CCS encodes all the
characters and displays them as you saw. I don't have CCS on this system
to tell you were to look for the setting but from memory, you open a
view of the page where you added the Label, select the label, and look
at the Properties panel for it. One of the properties has the choice for
HTML while the default is Text, I believe.

Don (DonP)

maxhugen wrote:
> Could anyone suggest how to code a simple page that would loop through all the
> Session parameters and their values, and display them on the page, so that I can
> see what I actually have in the session?
> _________________
> Max
> (99.9% CCS Newbie)
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
maxhugen

Posts: 272
Posted: 04/10/2008, 4:04 PM

That was it! Perfect, thanks again Don.
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
wkempees


Posts: 1679
Posted: 04/11/2008, 1:54 AM

@maxhugen

As this is a good informative debugging post:
I would suggest:
A: you change the topic to have TIP: in front of it
or B: repost a compacted version in tips and solutions, something like Debugging tip.

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
DonP
Posted: 04/12/2008, 10:31 AM

I was about to post this as Walter suggested in the tips and tricks
forum but I see that someone already has!

To answer a couple questions, the GD library lists info for the PHP GD
library, which is used in creating and modifying images and supports
truetype fonts. If it gives no values for you, then the GD library is
not enabled or installed on your version of PHP. I use it all the time
so this was a helpful area for me when getting it set up:

Optionally the code will tell you anything you want to know about the
PHP configuration but note that it could be a very long list! I leave it
remarked out unless I really need it, which is rarely. I have not tested
it with newer versions of PHP but it did work some years ago when I
first wrote it.

Don (DonP)

maxhugen wrote:
> Could anyone suggest how to code a simple page that would loop through all the
> Session parameters and their values, and display them on the page, so that I can
> see what I actually have in the session?
> _________________
> Max
> (99.9% CCS Newbie)
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
maxhugen

Posts: 272
Posted: 04/12/2008, 3:33 PM

Hi Don, I added the Tip as Walter suggested, and have now appended your info re GD and Php info.

Cheers, Max
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.