Any help with the following coding issue will be greatly appreciated.
Current position: I have a page (mypage1.php) on which is a form where there are a number of text areas for the viewer to complete. For this example we will say just two – for age (name=age) and premium (name=premium). There is a ‘submit’ button which takes the viewer to the next page by calling the form action function. This new page is mypage2.php.
However, in the future I now have to pass this information to an insurance company and they can only accept the data by including it in their URL.
Here’s the problem I am unable to solve due to my limited knowledge of PHP.
If I put the URL of the insurer in place of the original form action ‘mypage2.php’ it is too early to include the answers to the two questions.
I have spent a lot of time trying to find various sequences to get a solution and failed.
As I understand it I first need to concatenate the answers to $age and $premium with the insurer’s URL. But what order do I use to get the viewer to press the submit button only once? Where do I place the concatenation (within the form or after, before the submit button or after etc)?
Then I need to redirect the page to this concenated URL – but only on the action of the submit button – not when the viewer accesses ‘mypage1.php’.
Do I concatenate the insurer URL which then goes to an intermediate page which is redirected to the extended URL. If so, where do I place the concatenation (within the form or after)?
Or do I create an intermediate page which accepts the answers to $age and $premium, then concatenates the URL and then redirects to this extended URL?
As I say, any help would be much appreciated (particularly some sample coding).