GET标头从HTTP发送到PHP

时间:2018-08-31 12:17:40

标签: php get http-headers

我有一个打开contact-form.php页面的软件,当它打开时,我得到以下HTTP标头:

http://192.168.1.7:8091/syg/new/contact-form.php?lead_id=1601734&phone_number=6977060744&first_name=John

如何在PHP上将这些值呈现给表单?表单的典型格式为:

<input type="text" class="form-control" name="your_phone" placeholder="phone" required>

1 个答案:

答案 0 :(得分:0)

您可以像这样检查$_GET的值:-

<input type="text" class="form-control" name="your_phone" placeholder="phone"  value = "<?php echo (!empty($_GET['phone_number'])) ? $_GET['phone_number'] : '' ;?>" required>