Hi there, I have a custom module that's a multi-page form. When the user clicks 'submit' on the third page they get taken to another page called 'modulename/recommendations'. This page shows all their recommendations from the database that match their selections in the multi-page form.

Before I send the users to this final recommendations page I save all the variables from the form in individual $_SESSION variables, like so (here's one example):

$_SESSION['role'] = $form_state['storage']['role'];

That allows me to reference the value on the recommendations page even if the user navigates away and comes back to the recommendations page. That's a nice thing.

But another thing I'd like to do, and the reason I'm writing you guys today is, I'd like to pass the variables by URL once the user gets to the recommendations page.

What I'm trying to do:
I want to create a link on the recommendations page that makes uses of URL-based parameters and I'd like to pass those user-created variables (from the multi-page form) to the link in question.

So a user would click the link and it would go something like this:

sitename/modulename/link-in-question.html?role=whatever-the-user-selected-for-role

Is this possible, and if so how is it to be accomplished?

Comments

junestag’s picture

Ok, so it turns out this was just a simple PHP issue, solved like so:

<span class="download-rec"><a href="/reports/Recommendations.csv?level=' . $level . '&role=' . $role . '&topic=' . $topic . '">Download File</a></span></div>