Gnahzllib Gnahzllib - 1 year ago 68
HTML Question

How to create 'add quantity' input box and embed it inside PHP scripts?

How can I create a input field like the one in the image? And I want to embed it inside $_POST. Thanks for your time :)

add quantity input box

Answer Source

This is an HTML5 input of type number. You use it this way:

<form method="POST" action="yourPHPfile.php">
  <input type="number" name="number_input">
  <input type="submit">

When this form is submitted, it will send the selected number to yourPHPfile.php and you can retrieve the number from $_POST['number_input']

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download