Hi, I want to know how I can append a submitted webform's variables to the confirmation page URL. For example, I want the URL to be www.example.com/thank-you?firstname=Steve

This way, I can read the variable and display a personalised message on the confirmation page (e.g. "Thanks Steve for submitting the form).

Thanks

Comments

quicksketch’s picture

blogjunkie’s picture

I tried but my code is really poor. Can you post some sample code please? I'd be willing to pay (PM me). Thanks

quicksketch’s picture

Status: Active » Closed (fixed)

Pruning the issue queue. Sorry I haven't been able to invest time into this project.

enarchy’s picture

A late reply - but hope it helps anyone who is new like me to find the answer :)

Lets say you have the users name in $name -
after submit you are redirecting the user to page thank-you

$name = store the users name here;
$form_state['redirect'] = array("URL of the page thank-you","&var1=$name");

In the receiving function - you will have to include

$name = $_GET['var1']; -- this will give you the required value.

You can pass more than 1 variable

$form_state['redirect'] = array("URL of the page thank-you","&var1=$firstname","&var2=$middlename","&var3=$lastname");

In the calling function or the page to be directed - to access these values you need to do

$firstname = $_GET['var1'];
$middlename = $_GET['var2'];
$lastname = $_GET['var3'];