我有一個這樣的形式:鏈接不保存
<form id="candida-form" action="index.php?gender=<? echo $sex; ?>?step=<? echo $step; ?>" method="get">
<? if ($step == -1): ?>
<div style="padding-left: 95px;padding-top: 40px;">
<div class="radio-option"><input type="radio" id="male" name="form_sex" value="0" checked /> <label for="male" style="cursor:pointer;"><img src="images/icon_man.png" /> Male</label></div>
<div class="radio-option"><input type="radio" id="female" name="form_sex" value="1" /> <label for="female" style="cursor:pointer;"><img src="images/icon_woman.png" /> Female</label></div>
<div class="radio-option" style="padding-top:9px;"><input type="radio" id="child" name="form_sex" value="2" /> <label for="child" style="cursor:pointer;"><img src="images/icon_child.png" /> Child</label></div></div>
<div class="clear"></div>
<div class="submit-wrapper"><input type="submit" id="nextstep" value="Next Step" /></div>
<? elseif ($step == 0): ?>
<div class="form-inner">
<? if ($sex == 0): ?>
<h2>MALE</h2>
<div class="yesno">
<div class="section-description">
<p>text</p>
</div>
<? elseif ($sex == 1): ?>
<h2>FEMALE</h2>
<div class="yesno">
<div class="section-description">
<p>text</p>
</div>
<? else: ?>
<h2>CHILDREN</h2>
<div class="yesno">
<div class="section-description">
<p>text</p>
</div>
<? endif; ?>
和變量是那些:
$step = intval($_POST[ 'form_post' ]); // Gather completed step
$sex = intval($_POST[ 'form_sex' ]); // Gather gender
的想法是,當我點擊該輸入爲「下一步」,在瀏覽器的URL被改變喜歡:http://xyz.com/survey/index.php?gender=0?step=1
,但如果我想提出確切的鏈接http://xyz.com/survey/index.php?gender=0?step=1
在一個新的瀏覽器,所以我可以去步驟1在男性性別的,它不會,它會去索引no的步驟,請解決任何問題?你能幫助任何想法嗎?
通過'http://xyz.com/survey/index.php性別= 0&步= 1' – Peon 2012-08-07 12:03:38
表單使用 '得到' 這樣$ _POST ['form_sex']從來沒有設置,使用$ _GET ['form_sex'] PS $步驟仍然不是$ step + 1的下一頁 – Waygood 2012-08-07 12:06:42
@Waygood最後更新是'