hansg
hansg

Reputation: 11

Populating html form with URL

I am trying to populate a form using variables defined in the URL. the URL I am generating looks like this.

http://serverip/Forms/webform.php?customer_phone_c=--A--phone_number--B--&newtitle_c=--A--title--B--&newfirstname_c=--A--first_name--B--&newsurname_c=--A--last_name--B--&address_1_c=--A--address1--B--&address_2_c=--A--address2--B--&address_3_c=--A--address3--B--&postcode_c=--A--postal_code--B--&agent_name_c=--A--fullname--B--

Can anyone give me a hand and explain why this is not working for me. I am new to this and would love to get it working.

In my webform.php file I have tried using the following segment. the form itself works but does not populate the field Customer Phone with "--A--phone_number--B--"

<td style="text-align: left; font-size: 12px; font-weight: normal;" width="15%"><span>Customer Phone: </span></td>
<td style="font-size: 12px; font-weight: normal;" width="35%"><span><input id="customer_phone_c" type="text" value="<?php echo $_GET['--A--phone_number--B--'];?>" name="customer_phone_c" /></span></td>

Upvotes: 1

Views: 50

Answers (1)

Sheldonbrax
Sheldonbrax

Reputation: 320

You are referencing the variable value and therefore nothing will return. You have to use the variable name.

Use <?php echo $_GET['customer_phone_c']; ?> to get the value of that variable (i.e. --A--phone_number--B--)

Upvotes: 1

Related Questions