-1

I read $_POST is empty after form submission topic and I wondered how to get the data from input without attribute name?

    <input type="text" >


var_dump($_REQUEST)//empty
var_dump(file_get_contents('php://input')) //empty
Community
  • 1
  • 1
Michael Phelps
  • 3,451
  • 7
  • 36
  • 64

1 Answers1

1

Basically, the form should be specified its name. If not, you cannot get it from the server-side.

However, the form without name is also valid in HTML5. The reason is that you might sometimes want to use for form submission via AJAX or Javascript app. In many cases

lvarayut
  • 13,963
  • 17
  • 63
  • 87