I have the following form.
<form name="cookieform" id="login" method="POST">
<input type="text" NAME="username" id="username" class="text" maxlength="30" />
</form>
What I would like to do is to grab the value from the text field and place it into a PHP variable. I have the following code.
<?php
$get_username = $_POST['username'];
print($get_username);
?>
thanks
Every time you hit the submit button, it will post the value of the input. This will set your PHP variable every time.
Update:
Patrioticcow said his variable isn’t returning anything. Something that should have been included in the question, but now we have that information.
Instead of print. This will work.