How to insert text or variable into a form using php?

How to insert text or variable into a form using php? Explain who knows…


Answer 1, authority 100%

PHP is a server-side language. Forms are created by the browser, and they cannot interact.

To add an input field – type in

<input type="text" name="var_name" value="var_value" />

, in php the value will be available from $_GET[‘var_name’]. Or if the form has method=”post” specified, then from $_POST[‘var_name’].


Answer 2, authority 50%

If you thoroughly understand your question, then you need to do this:

<?php
$vn1 = '213123123';
echo '<input type="text" name="ololo" value="'.$vn1.'"/>';
?>