I am not a expert in this field so please help me out and spare my ignorance if any.
I am trying to curl through a page and want to get value of the hidden <input>
field. I am not familiar with regexp. my code is as below:
$page = curl_exec($ch);
}
curl_close($ch);
function parse_form_fields($page, $username, $password){
preg_match("/<input id=\"signuptoken\" type=\"hidden\" value=\"(.+?)\" name=\"signuptoken\"/", $page, $m);
$captchatoken = $m[1];
$parameters[] = "newaccounttoken=" . urlencode($captchatoken);
}
the form field is as below:
<input id="signuptoken" type="hidden" value="03AHJ_Vuv2ts6ev2LltAkZB91vjD6k-BsW3286bTC9QZYZLSHQUMNDQJFUaNmAQMAYb9FDhIkOFzAisafasfsTZuv_pl5KvkYNfsGUPcOAEX5YPlMaMOi7MZJq4ky0v_GyM60SmMgjPrtfZSJYE0hqw--GsfsafasmER0Sksr6OAvnLnBVAMsKcCi7uM" name="signuptoken">
I want to get the value out for this input field.