rakibtg
rakibtg

Reputation: 5921

How to customize "value" field in a php contact form

please tell me how i can configure my contact form field so that i can specify texts for a field. Suppose my contact form is located here: www.example.com/con.php so, if i want to give a specific title for my contact form subject field...... it should be like this:

www.example.com/con.php?subject=this text should automatically write in the field value

.. here i upload an image about this..here > https://i.sstatic.net/hmkwl.png so please tell me how to do it in a php contact form script.. can i make it clear to you? Thankyou.

Upvotes: 0

Views: 90

Answers (2)

Aurelio De Rosa
Aurelio De Rosa

Reputation: 22162

Put this line in your form:

<input name="subject" type="text" value="<?php echo htmlentities($_GET['subject']); ?>"/>

Upvotes: 4

Jared Farrish
Jared Farrish

Reputation: 49208

<input name="subject"
       value="<?php echo htmlentities($_GET['subject']); ?>"/>

Upvotes: 2

Related Questions