Store input from a text field in a PHP variable [closed]
Store the users input from a text field in a variable. Any ways to do this?
HTML:
<input type="text" name="firstname" />
PHP-onsubmit (untested)
<?php
$firstname = $_POST["firstname"];
?>
if you have a form with that textarea and you submit that form, you'll have the value in your global $_GET
or $_POST
-array (depending on whats the methot of your form).
you can access this value by typing $_GET['nameofyourtextarea']
(or the same with $_POST
)
精彩评论