ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Getting session data from php page

October 14, 2008 5:46pm

Subscribe [4]
  • #1 / Oct 14, 2008 5:46pm

    curtschultz

    20 posts

    Hello, I have a php page that is handling a donation form and sending the credit card information to the processor and receiving the response back.  I would like to pass information from that php script to a thank you page using sessions.  Then I would be able to display a receipt to the user. 

    How can I from the thank you template, grab session data?

    Thanks.

  • #2 / Oct 14, 2008 5:50pm

    Ingmar

    29245 posts

    You would probably want to use some PHP. The Session or the Input Class should be useful.

  • #3 / Oct 14, 2008 5:59pm

    curtschultz

    20 posts

    Im not sure how the session class works.  If I set the session in the php page such as $_SESSION[‘data’] = ‘value’;  how would I use that in the template?

  • #4 / Oct 14, 2008 6:32pm

    Ingmar

    29245 posts

    curt, this is rapidly evolving beyond what regular tech support can offer, so I’ll move this over to Howto. What you have in mind definitely requires some custom coding. ExpressionEngine uses the Input class for fetching all of the incoming data from the superglobal arrays $_GET, $_POST, $_COOKIE, and $_SERVER. The docs on development in general can be found here.

  • #5 / Oct 21, 2008 1:41pm

    curtschultz

    20 posts

    anyone got any ideas?  I tried setting a cookie in the php script then trying to access that cookie with the input class but it did not work.

  • #6 / Oct 21, 2008 1:49pm

    Greg Aker

    6022 posts

    Curt:

    Check out the Functions class and set your cookie with $FNS->set_cookie()  Then you can grab the cookie data with the input class.

    To do it this way, your php script would need to “live” within ExpressionEngine.  Or, perhaps you could create a module to deal with this too.

    Kind of a non-answer, but something to think about.  😊

    -greg

  • #7 / Oct 21, 2008 2:01pm

    Mark Bowen

    12637 posts

    Not sure if using the Session Variables plugin would work in this case if you are setting the value elsewhere other than with the plugin but it might give you a good start to seeing how plugins are created.

    You could also as Greg has mentioned set a cookie. There is already a cookie plugin for ExpressionEngine and perhaps you can see how this one works too.

    Best wishes,

    Mark

  • #8 / Oct 21, 2008 2:12pm

    curtschultz

    20 posts

    THANKS!  The sessions variable plugin works great.  I can set the session in php like normal and the plugin can access the value.

    Thanks a lot.

  • #9 / Oct 21, 2008 2:20pm

    Mark Bowen

    12637 posts

    THANKS!  The sessions variable plugin works great.  I can set the session in php like normal and the plugin can access the value.

    Thanks a lot.

    No problem. Glad it worked for you 😉

    Hope everything else goes well for you.

    Best wishes,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases