2017-03-06 82 views
1

我想使用URL中定义的变量填充表单。我正在生成的URL如下所示。使用URL填充html表格

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-- 

任何人都可以给我一个手,并解释为什么这不适合我。我对此很陌生,很想让它工作。

在我webform.php文件我已经使用以下段尝试。本身工作,但形式不填充字段客户电话“--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> 
+2

您的意思是'$ _GET [ 'customer_phone_c']'? –

回答

1

你引用变量的值,因此不会有任何回报。你必须使用变量名称。

使用<?php echo $_GET['customer_phone_c']; ?>来获取变量(即--a - PHONE_NUMBER - B--)的值