Undefined offset
| From: | Jough P | Date: | Mon, 01 Mar 2004 15:58:31 +0000 |
| Subject: | Undefined offset | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-179170@lists.php.net to get a copy of this message | ||
Greetings all, I'm getting "Notice: Undefined offset" regarding this line of code while inside a for loop:
if($this->inputs[$i] == "user")
I assume the 'offset' that is undefined is $i. But $i is defined is the for statement above it.
Here's the while function:
function draw()
{
echo "<FORM METHOD=\"$this->method\" ACTION=\"$this->action\">\n";
if (count($this->inputs) > 0)
{
for($i=0; $i <= count($this->inputs); $i++)
{
if($this->inputs[$i] == "user")
NexForm::drawUserInputs();
if($this->inputs[$i] == "ctc")
NexForm::drawCtcInputs();
}
}
?><INPUT TYPE=SUBMIT NAME="<? echo $this->btnsubmit ?>" VALUE="<? echo $this->btnsubmitval ?>"><?
echo "</FORM>\n";
}