-1

How to get the Name value using Post method in php like this :

<input type="checkbox" name="<?php echo $categoryTitle;?>">

How to Post the Name value..?

<?php $name=$_POST[''] ?>
Mickaël Leger
  • 3,426
  • 2
  • 17
  • 36

1 Answers1

0

So this is your input :

<input type="checkbox" name="<?php echo $categoryTitle;?>">

When you submit your form using POST method, you can access your input value using the name of each input like this : $value_of_field = $_POST['input_name'];

So if the name of your input is <?php echo $categoryTitle;?>, you can get the value of this input using : <?php $name = $_POST[$categoryTitle] ?>

If you want information about how to get checkbox value on submit, this other question / anwser may help you : Getting checkbox values on submit

Mickaël Leger
  • 3,426
  • 2
  • 17
  • 36