如何通过此输入字段传递值?

How do I get the value of what the user inputs into the text field for quantity?

echo"<label>Qty:</label><input type=\"text\" name\"qty\" size=\"3\" maxlength=\"3\" value=\"1\"/>";

in the submitted form for php, it'll look like this:

$_REQUEST['qty']

in javascript, it'll look like (assuming your form's id is "form1")

document.getElementById('form1').qty.value

or if the name is form1

document.form1.qty.value

If you're using a framework like jQuery:

$('#form1 input[name=qty]').val();

If you are using a form with method="post" you will get the value of the field with $_POST['qty'] (or $_GET['qty'] for method="get" or none) in full:

echo "<label>Qty:</label><input type=\"text\" name=\"qty\" size=\"3\" maxlength=\"3\" value=\"".$_POST['qty']."\"/>";

but remember to escape any data from site users.

You are missing an equal sign before you name attribute, and as this is the one you need to get the value with PHP that might be the issue. And you should use single quotes to avoid escaping of every double quote:

echo '<label>Qty:</label><input type="text" name="qty" size="3" maxlength="3" value="1" />';

On the PHP side you can than get the value through the $_GET, $_POST or $_REQUEST superglobal:

$qty = $_REQUEST['qty'];

I hope that was the answer you needed.