Hi, i'm trying to get a random radio button checked and submit on a page i don't own.
Part of the html of the page the radio buttons are on:
HTML Code:
<td><input name="bust" value="5163402" type="radio" onclick="document.jail.ver.focus();"></td>
<td><a href="jail.php?buyout=5163402"><font color='#000000'> ($7,500)</font></a></td>
</tr>
<tr bgcolor="">
<td><font color='#000000'><a href="user.php?nick=Lordluke"><font color='#000000'>Lordluke</font></a></font></td>
<td><font color='#000000'><a href=family.php?fam=125><font color='#000000'>Andronova</font></a></font></td>
<td><font color='#000000'>Attempted jail break</font></td>
<td><font color='#000000'><span id="counter_jail8_minutes" style="display: inline;"><span id="counter_jail8_minutes_value">04</span> </span> <span id="counter_jail8_seconds" style="display: inline;"><span id="counter_jail8_seconds_value">43</span> </span><script language="javascript" type="text/javascript">
var oTimer = new Timer("jail8");
oTimer.setTime(283);
oTimer.setRefresh(false);
oTimer.setFinal("");
aTimers["jail8"] = oTimer;
</script>
</font></td>
Now the value for the different radio buttons vary everytime this html page is visited.
I've tried different approaches but don't seem to get it right.
Parts of php code i had:
PHP Code:
$jailArray = array($res->find('center' , 0)->find('table', 0)->find('input(value[])'));
foreach ($jailArray as $key => $value); {
output ($key . " " . $value );
}
$random = array_rand($jailArray,1);
$jailChoice = ($res->find('center' , 0)->find('table', 0)->find('input(value[$jailArray[$random]])'));
unset ($jailArray);
Which is totally wrong i think :x
PHP Code:
$jailRadio = ($jRadio -1);
$jChoice = rand(0, ("$jailRadio"));
debug ("Random radiobutton chosen: " . ($jChoice));
$jailChoice = ($res->find('center', 0)->find('table', 0)->find('input[type=radio]', ($jChoice)));
debug ("Check the " . $jChoice . " th radiobutton in jail.");
This only divines a number thus can't be used with SubmitForm
PHP Code:
$radio = ($res->find('center' , 0)->find('table', 0)->find('input[type=radio]', 1));
$res->value();
Yet another attemp going no where.
Is there anyone who can help me a little bit further with this?
The idea is to get this html page Submit with a random radio button checked.
Thanks in advance.
