-1

I would like to know how to get the value of name in input tag using php?

<input type="text name="x" value="myFunction(this.name)">

it should return the value of the name tag x im not sure about the syntax "this" if it will get the value of name tag which is x.

Mharveen Biu
  • 215
  • 1
  • 3
  • 12

1 Answers1

0

For getting the value in PHP you have to make form, example

<form action="" method="post">
<input type="text" name="field">
<input type="submit" name="submit" value="Submit">
</form>

then by post method of php you can get value . Example:

 <?php 
 echo $_POST['field'];
 ?>
Waleed Ahmed Haris
  • 1,229
  • 11
  • 17