Field Data to Query String

U Can Drive 04 Feb, 2016
I am wanting to use the data already entered into a database to create a URL with a Query String

<a href="www.example.com.au/index.php?query1={data1}&query2={data2}">Click Here</a>

Obviously I would need a DBRead to get the load the user file into the form.
I'm guessing it would then use a "Display Message" event using some PHP code or html.

Would there be some simple code I could use to create this link (I'm really not so good with the PHP or HTML)?

Thanks in advance

Rick
GreyHead 04 Feb, 2016
Hi Rick,

The HTML you have here may well work if the names of the variables you are loading are data1 and data2

Bob
U Can Drive 05 Feb, 2016
Wonderful, managed to get that working, except how do I deal with a space in the data (I'm using a name field)?
U Can Drive 05 Feb, 2016
Don't worry, I made it work using the "Redirect" On submit.

This works much better as it allows the user to make changes first.
GreyHead 05 Feb, 2016
Hi Rick,

Using ReDirect is a better solution if it does what you need.

To handle spaces or other special characters in a custom url you can urlencode the data in a Custom Code action
<?php
$form->data['data1'] = urlencode($form->data['data1']);
?>

Bob
This topic is locked and no more replies can be posted.