Undefined Offset
Posted: Fri Jan 15, 2010 12:07 pm
have this script (below) that works great, but it generates a notice when it runs.... Notice: Undefined offset: 3 in C:\wamp\www\test.php on line 14 (line 14 refers to line 13 in the below code)
Here is the form code:
How could I modify it so that it doesn't come up?
Code: Select all
if ($_SERVER['REQUEST_METHOD'] != "POST")
{
include 'test.html.php';
}
else
{
$a=0;
$check = $_POST['check'];
$number = count($check);
while ($a <= $number)
{
print_r ($check[$a]);
++$a;
}
}
Code: Select all
<form action="" method="POST">
<input type="checkbox" name="check[]" value="1" />
<input type="checkbox" name="check[]" value="2" />
<input type="checkbox" name="check[]" value="3" />
<input type="submit" name="export" value="Export to CSV"/>
</form>