session value and radio button

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
On one page I have radio buttons below pictures, here is one picture...

  <img src="images/web-aroundworld458c.jpg" width="100" height="51"  
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.


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?


Re: session value and radio button

Quoted text here. Click to load it

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
and secondly
what is this expected to do?


don't you mean

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

Re: session value and radio button

I will try this worded different...

HTML page 1: I have two radio buttons...
<?php session_start(); ?>
<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 />

HTML page 2: Problem...on html page 2, how would I show which button was  

Would it be....
<?php session_start();
echo $_SESSION['image_choice'];

What I am looking to get as a result is  lp13-web-wild165c or  
lp14-web-wild289c to be printed to the screen.  

Re: session value and radio button

Quoted text here. Click to load it

If your form method is POST  
Quoted text here. Click to load it

If your form method is GET
Quoted text here. Click to load it

Sessions aren't really relevant to your problem.


Site Timeline