[PHP-DB] Notice: Undefined index: op

2005-02-22 Thread J. Connolly
I get the error message: *Notice*: Undefined index: op When trying to set up a form. I have looked everywhere for the solution. I don't understnadn how to define that index. The come it comes from is: if ($_POST['op'] != 'ds') { $display_block = " Your E-mail Address: subscribe

Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Matt M.
> if ($_POST['op'] != 'ds') { > $display_block = " > > Your E-mail Address: > >subscribe >unsubscribe > > > "; > } try: if (isset($_POST['op']) && $_POST['op'] != 'ds') -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.

Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Matt M.
On Tue, 22 Feb 2005 10:47:43 -0600, Matt M. <[EMAIL PROTECTED]> wrote: > > if ($_POST['op'] != 'ds') { > > $display_block = " > > > > Your E-mail Address: > > > >subscribe > >unsubscribe > > > > > > "; > > } > > try: > > if (isset($_POST['op']) && $_POST['o

[PHP-DB] Re: Notice: Undefined index: op

2005-02-22 Thread Gareth Heyes
Notices have been turned on your PHP installation. This means you will need to declare all of your variables otherwise you will receive a notice. To fix your problem simply declare your POST variable before use. if(isset($_POST['op'])) { $op = $_POST['op']; } else { $op = ""; }

Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Martin Norland
J. Connolly wrote: I get the error message: *Notice*: Undefined index: op When trying to set up a form. I have looked everywhere for the solution. I don't understnadn how to define that index. The come it comes from is: if ($_POST['op'] != 'ds') { $display_block = " Your E-mail Address:

Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Bret Hughes
On Tue, 2005-02-22 at 10:49, Matt M. wrote: > On Tue, 22 Feb 2005 10:47:43 -0600, Matt M. <[EMAIL PROTECTED]> wrote: > > > if ($_POST['op'] != 'ds') { > > > $display_block = " > > > > > > Your E-mail Address: > > > > > >subscribe > > >unsubscribe > > > > > > > >

Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Martin Norland
Bret Hughes wrote: On Tue, 2005-02-22 at 10:49, Matt M. wrote: On Tue, 22 Feb 2005 10:47:43 -0600, Matt M. <[EMAIL PROTECTED]> wrote: [snip] try: if (isset($_POST['op']) && $_POST['op'] != 'ds') sorry for 2 emails, looks like you would want if (!isset($_POST['op']) || $_POST['op'] != 'ds') I vote f

Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread J. Connolly
Thank you everyone for your help. None of the solutions helped though. It is a long story, I have to use the undefined 'op' in a few places and all f the solution end up causing other error. But I appreciate the help and I understand when the problem is alot clearer.. I just turned off the erro

Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Bret Hughes
On Tue, 2005-02-22 at 11:31, Martin Norland wrote: > Bret Hughes wrote: > > On Tue, 2005-02-22 at 10:49, Matt M. wrote: > > > >>On Tue, 22 Feb 2005 10:47:43 -0600, Matt M. <[EMAIL PROTECTED]> wrote: > [snip] > >>>try: > >>> > >>>if (isset($_POST['op']) && $_POST['op'] != 'ds') > >>> > >> > >>sorry

Re: [PHP-DB] Notice: Undefined index: op

2005-02-22 Thread Jochem Maas
Martin Norland wrote: J. Connolly wrote: ... You may want to use a different quoting style - I can't recall the name, but it's taken from perl HEREDOC. (i believe its custom to write it in capitals,) echo << ... the rest of your stuff, then on its own line right at the beginning of the line