Re: Re: Set variable outside of scope (redo)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >         if ($row[range] != "")
This should be $row['range'], not $row[range], although it doesn't
make a difference unless you define a constant named range.


Your problem isn't actually scope, it's that your PHP script is being
called twice.  Once to show the form, once to submit it.  The second
time, your script doesn't have any of the things you set the first
time.

<input type=\"hidden\" name=\"id\" value=\"$row[id]\" />

If you put that in your delete form, you could use $_POST['id'] to get
the proper id.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux