You are here: Re: session value and radio button « PHP Programming Language « IT news, forums, messages
Re: session value and radio button

Posted by shimmyshack on 03/31/07 22:56

On 31 Mar, 23:36, "Thad" <tsob...@cox.net> wrote:
> On one page I have radio buttons below pictures, here is one picture...
>
> <img src="images/web-aroundworld458c.jpg" width="100" height="51"
> border="0"
> onclick="this.src='./images/web-aroundworld458c.jpg';this.height=102;this.width=200"
> ondblclick="this.src='./images/web-aroundworld458c.jpg';this.height=51;this.width=100"
> alt="" /><br />
> <input type="radio" name="image_choice" value="lp15-web-aroundworld458c"
> style="width: 35px;"/>LP-15<br />
>
> ...then I have a link to a page in which if a radio button is chosen, a
> value will be passed to the new page.
>
> <?php
> $_SESSION['image_choice']=image_choice;
> ?>
>
> The theory works but what is passed is the wording "image_choice" and not
> what I expected...."lp15-web-aroundworld458c".
>
> If the value of image_choice is "lp15-web-aroundworld458c", then why would
> it return the literal "image_choice"?
> How can I get the value of the button to go to the new page?
>
> Also, does session_start(); need to be on each php page when passing the
> values between pages?
>
> Thanks,
> Thad

Advice: be clearer about what your code is, don't say "I've got this
and that code", just show us

Firstly yes session_start needs to be whereever you wish to use the
session - see http://uk.php.net/session_start
and secondly
what is this expected to do?

<?php
$_SESSION['image_choice']=image_choice;
?>

don't you mean
<?php
$_SESSION['image_choice']=$image_choice;
?>

where $image_choice is what you sent, either $_GET['image_choice'] or
$_POST['image_choice']
but you havent actually given enough code to help us help you.

 

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

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