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.

Problem getting session variables into php function

November 18, 2008 3:01am

Subscribe [1]
  • #1 / Nov 18, 2008 3:01am

    jeffc

    30 posts

    Hi, I’ve searched for answers for hours but stil cannot figure out what’s going on.

    I have a custom function that i created that pulls in database results using the EE database class, based on what the user selects in a form with three select boxes. When the user hits enter, they are taken to the page that is the action of that form. That page is a template with a call to include that function as well as create session variables from the three $_POST variables form the form. This works fine. The problem I’m having is with the pagination of the results. When the user selects the next page or any other page of results, the variables are no longer there and I’m getting php errors stating that I have undefined indexes for each of the three $_POST variables that should be session variables. I know the pagination works fine because if I hardcode some values, it works. I also am passing the variables to my function as $_SESSION variables to being with and it’s working there too. Only when I select the next page of results is it braking. Is there any reason this is happening? I’ve tried the session variables plugin to set the variables using {exp:session_variables:set name="date" value="POSTED_VARIABLE"}  but get “POSTED_VARIABLE” as my value.

    I’m probably just missing something obvious but i’e been at it all day with no luck so I’d really appreciate anyone’s help.

    Thanks!

  • #2 / Nov 18, 2008 1:18pm

    jeffc

    30 posts

    Nobody?

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

ExpressionEngine News!

#eecms, #events, #releases