You are here: Re: passing radio button value « All PHP « IT news, forums, messages
Re: passing radio button value

Posted by Thad on 04/01/07 16:04

"J.O. Aho" <user@example.net> wrote in message
news:5794pqF2c096oU1@mid.individual.net...
> Thad wrote:
>> PHP page 1: I have two radio buttons...
>> ---snip---
>> <input type="radio" name="image_choice" value="lp13-web-wild165c"
>> style="width: 35px;"/>LP-13<br />
>> <input type="radio" name="image_choice" value="lp14-web-wild289c"
>> style="width: 35px;"/>LP-14<br />
>> ---snip---
>>
>> PHP page 2: Problem...on page 2, how would I show which button was
>> pressed?
>>
>> Would it be....
>> ---snip---
>> <?php echo $_SESSION['image_choice'];
>> ?>
>> ---snip---
>
> $_SESSION is used for values you have stored in the "session cookie",
> while
> things from a form is usually seant and then stored in $_POST (or $_GET,
> and
> both $_GET and $_POST can be accessed from $_REQUEST).
>
>
>> What I am looking to get as a result is lp13-web-wild165c or
>> lp14-web-wild289c to be printed to the screen.
>
> <?php echo $_REQUEST['image_choice']; ?>

There just has to be a way to store the value of the radio button selected
in a variable. I've stored a word "foo" in the variable $imaged and have
that been passed to the next page just fine. Is there not something like
javascript in PHP to pull the value of the selected button like
$answer=image_choice.value.this ?

If it just cannot be done in a session, I will resign to $_request. I have
looked at a lot of documentation about $_GET, $_POST and $_REQUEST and just
cannot get it working. If I have to post first, my server will not allow
this. Can you help me along this way?

 

Navigation:

[Reply to this 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

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