Php debugging POST vars

It can be a lot, but I'm looking for a way to detect attributes in some of the form input fields.

For instance:

<input type="text" name="fieldone" id="fieldone" value="me@me.com" />

I can simply use the php foreach loop to get the key information => value.

<?php
$querystring = "";
if ($_POST){  $kv = array();  
  foreach ($_POST as $key => $value){ $querystring .= "$key=$value<br>"; } 
}
?>

And it helps with mediocre debugging reasons.

However, this only defines the name and value of the form field. How to define the id attribute or any custom attributes that I can add.

Is there a way to detect / display the attributes of POST variables? Or does php stop at name / value?

+3
source share
3 answers

Nothing but a name and value is sent via HTTP.

To do this, you need JavaScript preprocessing.

, submit JavaScript , .

+2

. ID ( ).

BTW: print_r($_POST); var_dump($_POST); .

+4

When submitting a form, only the name and value fields are used. Other fields are used only on the client side (inside the browser) and do not return to the server.

0
source

Source: https://habr.com/ru/post/1791618/


All Articles