Re: [PHP] proper method to do the following...

2004-10-06 Thread Dennis Gearon
Hugh Beaumont <[EMAIL PROTECTED]> wrote: I've been working with error_reporting(E_ALL) set lately trying to write code that does not give notices or errors. What is the proper way to set a variable so that it's non-existance will not generate a notice? Thanks all for the replies. I

RE: [PHP] proper method to do the following...

2004-10-06 Thread Michael Sims
Hugh Beaumont wrote: > the following code outputs : > > Notice: Undefined index: exact in search.php on line 10 > > code : > > if (!isset($_POST['exact'])) { <- line 10 > $_POST['exact'] == false; > } You have a typo in line 11. I'm assuming you want to use the assignment operator "="

Re: [PHP] proper method to do the following...

2004-10-06 Thread Hugh Beaumont
> I've been working with > > error_reporting(E_ALL) > > set lately trying to write code that does not give notices or errors. > > > What is the proper way to set a variable so that it's non-existance will not generate > a notice? > Thanks all for the replies. I also noticed a small typo i

Re: [PHP] proper method to do the following...

2004-10-06 Thread Greg Donald
On Wed, 6 Oct 2004 06:53:34 -0700 (PDT), Hugh Beaumont <[EMAIL PROTECTED]> wrote: > Notice: Undefined index: exact in search.php on line 10 > > code : > > if (!isset($_POST['exact'])) { <- line 10 > $_POST['exact'] == false; > } Reverse the logic of isset(). if (isset($_POST['exac

Re: [PHP] proper method to do the following...

2004-10-06 Thread John Nichel
Hugh Beaumont wrote: I've been working with error_reporting(E_ALL) set lately trying to write code that does not give notices or errors. I have not been able to solve the following: given a form with a checkbox that may or may not be set, we'll call it "exact" as in the following code output