用复选框数组填写表单

I want to create a PHP script which can fill up a form from a text file. The form is on a password-protected page. There are 4 fields where i need to put text (name, village, etc.)

I need to select checkboxes but they are in an array and I only know their label name. At max I can look up id's and use it as static values, but I don't know them how to use them either.

<form method="POST" action="...">
   <input type="checkbox" name="tag_id[]" id="tag_id_192" value="192"><label for="tag_id_192">House</label>

I saw lots of tutorials which shows how to do it with checkboxes but they used the check box name and without the login part. I never used PHP before so I don't know even where to start. If someone could guide i would be very grateful.

Example: The .txt file each row represents a form fill up the fields are separated with a *: Name * village .... * the check boxes label names which i need to set active

If you're using cURL, you can post multiple fields with the same name, if it has [] after the name, php will automatically concatenate them all into an array..

So its valid to do tag_id[]=192&tag_id[]=175&tag_id=[285]..

In PHP it will know to make it array(192,175,285)

As a side note, fields that do not have [] get overwritten each time they appear...