I'm using curl to retrieve some data on a post request, I'm having a little trouble with the fields as it doesn't seem to be correctly posting to the correct fields. The form consists of just a text area and a submit button.
<form action="other.php" name="form1" id="formID" method="post">
<textarea rows="1" cols="1" id="txtareaID" name="txtAreaName"></textarea>
<input type="submit" id="btnID" name="btnName" value="btnValue" title="btnTitle">
This is the fields variable:
$this->fields = "txtAreaName=". $this->num . "&btnName=btnID";
I am not entirely sure how to identify the submit button in this case..
and here is the curl array:
array(
CURLOPT_URL => $this->address,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $this->fields
);
btnName=btnValueinstead ofbtnName=btnID?urlencode()if the field value can contain any special characters.