Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 15th Feb 2011, 05:41 PM   #1
HyperActive Warrior
 
Join Date: 2010
Posts: 111
Thanks: 5
Thanked 4 Times in 4 Posts
Default
print session variable
Share on: 
fb share twitter share gplus share more share

I need a little help with how to print this session variable to screen

the password field is the one im trying to echo out.

Array (
Object (
[path] =>
Array (
[0] =>
Array (
[post] =>
Array (
[password] => 123456
)
)
)
)
)
layouts4you is offline  
Unread 15th Feb 2011, 06:48 PM   #2
Warrior Member
War Room Member
 
Join Date: 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: print session variable
Share on: 
fb share twitter share gplus share more share

Is there a particular piece of software you are using or is it custom coded?

From the code you posted, the password is in an object. You'll need to look through the code to see where the object was instantiated... something like:


PHP Code:
$ myObject = new ObjectName(); 

Then to view the variables (object properties) you can use syntax like:

PHP Code:
echo $ myObject->password; 
Depending on the way it's coded, it may not be that simple. But that's the basic paradigm for printing out object properties for troubleshooting. Personally, I use PHPed. It's usually easier to track down bugs that way.

HTH
ProfitableWebsites is offline  
Unread 15th Feb 2011, 10:59 PM   #3
Active Warrior
 
Join Date: 2011
Posts: 31
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: print session variable
Share on: 
fb share twitter share gplus share more share

I think this syntax will work
echo $ myObject->password;
If it is wrong let me know
tirupati is offline  
Unread 16th Feb 2011, 02:19 AM   #4
HyperActive Warrior
War Room Member
 
Tim Brownlaw's Avatar
 
Join Date: 2009
Location: Berwick, Melbourne, Australia
Posts: 156
Thanks: 5
Thanked 47 Times in 28 Posts
Default
Re: print session variable
Share on: 
fb share twitter share gplus share more share

It's an array of a multidimensional array object...(try typing that out quickly)

Once you get the object out of the array...
PHP Code:
echo $ myObject->path[0]['post']['password']; 
I have to ask... what is generating this?

Great Success is built from many little successes!

http://www.timbrownlaw.com - My Wee Part of the World.

http://www.LookingOverMyShoulder.com
Tim Brownlaw is offline  
Unread 16th Feb 2011, 08:05 AM   #5
Active Warrior
 
Join Date: 2011
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: print session variable
Share on: 
fb share twitter share gplus share more share

clean output in the screen:

<pre>
<?php print_r($myobject->password); ?>
</pre>
nxtgencreative is offline  
Unread 18th Mar 2011, 09:51 PM   #6
Warrior Member
 
Join Date: 2011
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: print session variable
Share on: 
fb share twitter share gplus share more share

or you can use var_dump($myobject->password) as well
voitenkos is offline  
Closed Thread


Bookmarks

Tags
print, session, variable


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 12:36 AM.