Form and $_POST

Permalink 1 user found helpful
Hi

I'm trying to pass a variable by FORM, from one page to another in c5.
So i used "PHP Simple Block" and I wrote:

<FORM action="my_page/concrete/index.php/wybierz-produkt/dodaj-produkt" method="post" >
<select name="combobox">
<option name="classic"  value="<?php if(isset($_POST['classic'])){ echo $_POST['classic'];} ?> ">Gitara klasyczna</option>
<option name="acoustic" value="<?php if(isset($_POST['acoustic'])){ echo $_POST['acoustic'];} ?> ">Gitara akustyczna</option>
</select>
<input type="submit" value="Next" />
</form>


Then when i'm redirected to page "dodaj-produkt" and i just try to see if there is any value in POST (echo $_POST) i have empty 'Array'.
Can someone help me with this ? Maybe i'm doing something wrong in code, or is there some special way to post values from one page to another ?

 
bober replied on at Permalink Reply
I solved problem.
I did everything wrong :) There's working part of code:

<FORM action="your_adress/index.php/wybierz-produkt/dodaj-produkt" method="post" >
<select name="wybor">
<option value="classic">Gitara klasyczna</option>
<option value="acoustic" >Gitara akustyczna</option>
</select>
<input type="submit" value="Dalej" />
</form>


and at next page you just have to use by example
$smth = $_POST["wybor"];