How would i go about creating an "input field" that allows you to input a four digit integer number or a four letter string and store it in a variable "$x". A user will then put the numbers/letters in a box and click on a button labelled "submit" in order to enter the number/letter into the variable?

I know how to create the input field, just insure on how to store it in a variable. Any suggestions?