Re: Undefined offset
| From: | Jough P | Date: | Mon, 01 Mar 2004 16:04:23 +0000 |
| Subject: | Re: Undefined offset | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-179173@lists.php.net to get a copy of this message | ||
Oops, in my previous email I meant to say "Here's the WHOLE function". sorry about the typo, hope I didn't confuse...
On Mar 1, 2004, at 9:58 AM, Jough P wrote:
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";
}
-- PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php