<p>Depending on how your redirect works, you can redirect and get the param in the template where the form is via:</p>

<pre><code>{% set param_name = craft.request.param('param_name') %}
</code></pre>

<p>You can then set this param in your form template and post it to your action controller.</p>

<pre><code>&lt;input type='hidden' name='param_name' value='{{ param_name }}' /&gt;
</code></pre>

<p>In your action controller you can retrieve it by getting it from the post.</p>

<pre><code>$param_name = craft()-&gt;request-&gt;getPost('param_name');
</code></pre>

<p>Is this anything you can use? Or need? Good luck!</p>

CC BY-SA 3.0
2015-07-31T12:27:42.900Z
Doesn’t solve my problem from the looks of it.

Here’s an example:
I have a job listing at www.example.com/designer and the user hits "apply" on that page. The user is then taken to a form. How can I know that the user came from www.example.com/designer and not www.example.com/developer?
Clint Tabone
CC BY-SA 3.0
2015-07-31T12:32:27.057Z
Can you edit your question with this new information, i will update my answer then.
Pim Kaptein
CC BY-SA 3.0
2015-07-31T13:03:26.227Z
@ClintTabone you would just append the param to the "apply" link like so: `<a href="apply?param_name={{ craft.request.firstSegment }}">Apply</a>`
carlcs
CC BY-SA 3.0
2015-07-31T11:42:04.633Z
2015-07-31T11:42:04.633Z
Pim Kaptein
<p>Here’s an example: I have a job listing at www.example.com/designer and the user hits "apply" on that page. The user is then taken to a form. How can I know that the user came from www.example.com/designer and not www.example.com/developer?</p>

CC BY-SA 3.0
2015-07-30T16:30:43.563Z
Unless I'm misunderstanding, why wouldn't you just include that data as part of the form submission?
Brad Bell
CC BY-SA 3.0
2015-07-31T09:35:18.953Z
I think I didn’t explain clearly enough.

Basically what I need is that when a user submits the form, I know which job post they wanted to apply for.
Clint Tabone
<form><php>
How do I create a page with a dynamic id?
# How do I create a page with a dynamic id?

(Asked by: username_0 on 2015-07-30)

Here’s an example: I have a job listing at www.example.com/designer and the user hits "apply" on that page. The user is then taken to a form. How can I know that the user came from www.example.com/designer and not www.example.com/developer?

**Tags:** form, php

> **Comments:**
> **username_1**: Unless I'm misunderstanding, why wouldn't you just include that data as part of the form submission?  
> **username_0**: I think I didn’t explain clearly enough.  Basically what I need is that when a user submits the form, I know which job post they wanted to apply for.  

---

## 1 answers

### Answer by username_2 on 2015-07-31. Score: 3 | Accepted answer

Depending on how your redirect works, you can redirect and get the param in the template where the form is via:
{% set param_name = craft.request.param('param_name') %}

You can then set this param in your form template and post it to your action controller.


In your action controller you can retrieve it by getting it from the post.
$param_name = craft()->request->getPost('param_name');

Is this anything you can use? Or need? Good luck!

> **Comments:**
> **username_0**: Doesn’t solve my problem from the looks of it.  Here’s an example: I have a job listing at www.example.com/designer and the user hits "apply" on that page. The user is then taken to a form. How can I know that the user came from www.example.com/designer and not www.example.com/developer?  
> **username_2**: Can you edit your question with this new information, i will update my answer then.  
> **username_3**: @ClintTabone you would just append the param to the "apply" link like so: `<a href="apply?param_name={{ craft.request.firstSegment }}">Apply</a>`  

---

