Reply to Re: using this IF to forward to page?

Your name:

Reply:


Posted by Rik Wasmus on 11/21/07 17:11

On Wed, 21 Nov 2007 17:26:29 +0100, <paul814@excite.com> wrote:

> On Nov 20, 7:21 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>> On Tue, 20 Nov 2007 22:32:45 +0100, <paul...@excite.com> wrote:
>> > OK well the page write-editorial.php opens now but it opens if radi=
o
>> > selected =3D 0 or 1. it should only do it if =3D=3D 0. Am I missi=
ng
>> > something?
>>
>> > <?PHP
>> > if($selected_radio =3D=3D 0){
>> > header('Location:
>> >http://localhost/production/write-editorial.php');
>> > exit;
>> > }
>> > ?>
>>
>> > do I first have to tell it what radio button is called, ex:
>> > radReadWrite ?
>>
>> Well, how do you get this magic '$selected_radio' variable? (Hint:
>> register_globals is probably off, so $selected_radio is not set. Loos=
e
>> comparison of 0 against NULL equals true)
>
> OK I see what I was doing wrong again, I was not assigning a value to
> the variable first.
> ........
> Right now I have a simple IF to take me to a page based on selected
> radio button:
>
> Code:
> <?PHP
> $selected_radio =3D $_POST['radReadWrite'];
> if($selected_radio =3D=3D 0){
> header('Location: =

> http://localhost/production/write-editorial.php');
> exit;
> }
> ?>
>
> How would I make this multi-dimensional, meaning I also have a option
> group pull down, like a pull down you would see on the web for
> selecting your State.
>
> I want to do something like this:
> If $selected_radio =3D=3D0 and lstdepartment =3D=3D lsteditorial then =
goto
> page write-editorial.php

if($selected_radio =3D=3D 0 && $lstdepartment=3D=3D'lsteditorial'){
header(......../write-editorial.php);
exit;
}
> or if $selected_radio =3D=3D0 and lstdepartment =3D=3D lstpress then g=
oto page
> write-press.php

if($selected_radio =3D=3D 0 && $lstdepartment=3D=3D'lstpress'){
header(......../write-press.php);
exit;
}

> something like that?
> How do I get the value of my lstbox? like I did for radio...
> $selected_radio =3D $_POST['radReadWrite'];

Indeed, just use the right name from your form ($_POST['lstdepartment'])=

-- =

Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация