Re: passing variable arguments from <select>
| From: | Haddad Said | Date: | Thu, 27 Jun 2002 16:09:06 +0000 |
| Subject: | Re: passing variable arguments from <select> | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104178@lists.php.net to get a copy of this message | ||
I just found out the $_POST['language'] is always assigned the value Array.
Since a user must choose either of the options and not both, I would rather
do this without arrays, is there another way?
"Haddad Said" <haddad.said@gmx.net> wrote in message
news:20020627155224.17350.qmail@pb1.pair.com...
> Yes I changed that, but now it always echoes EngP=0
>
> "Mark Heintz Php Mailing Lists" <heintzphp@mail.groupm7.com> wrote in
> message
> news:Pine.LNX.4.44.0206271042060.12776-100000@mail.groupm7.com...
> > On Thu, 27 Jun 2002, Haddad Said wrote:
> >
> > > in query.php i have this piece of code;
> > >
> > > echo "<form action='test2.php' action='post'>
> > > <select name='language'>
> > > <option value='0'selected='yes'>one</option>
> > > <option value='1'>two</option>
> > > </select>
> > > <input type=text name=query>
> > > <input type=submit name=submit>
> > > </form>";
> > >
> > > and in test2.php i have this;
> > >
> > > if ($_POST['language'] = 1)
> > > {$lang = "EngP=1";}
> > > else {$lang = "EngP=0";}
> > > echo $lang ;
> > >
> > > But it always echoes EngP=1 no matter what I choose, what is wrong
> here??
> >
> >
> > if ($_POST['language'] == 1)
> >
> >
> > You have an assignment operator instead of a comparison in your if
> > statement.
> >
> > mh.
> >
>
>