如何在不使用会话的情况下将表单的值从结帐页面保留到上一个表单页面 [英] how to retain values of the form from the checkout page to previous form page without using session

查看:46
本文介绍了如何在不使用会话的情况下将表单的值从结帐页面保留到上一个表单页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在主页上有两个表单,主页表单应该将表单值传递给预订表单,值通过POST传递并转发到结帐页面

但是结帐页面我有一个编辑表单按钮,当点击编辑按钮时,值不会再次在预订页面上恢复 index.php 表单的代码是

 <   div     class   = 必需 >  
< p < span class =code-keyword>> 价格:
< div class = price-input style = width:297px; >
< span 样式 = background-color :#FFFFFF;颜色:#2B2B2B; float:left; font-family:Arial,Helvetica,sans-serif; font-size:13px; font-weight:bold; line-height:20px; text-align:right; width :115px; > & pound;& nbsp; < / span >
< span id = priceload < span class =code-keyword>> 0 < / span >
< / div >
< / p >
< div id = bottom-both-button >
< 输入 t ype = 提交 class = book-button3 value = style = margin-left:120px; margin-top:10px; / >
< div class = 跳过 - 重复 - 检查 >
< p > 价格:< / p >
< 标签 > £<? php if($ amount == < span class =code-string>' '){ echo $ calculatedprice ; } else { echo $ amount ; } ?> < / label >
< / div >
< / div >



预订页的代码为

 <   div     class   =  skips-repeat >  
< p > 价格:< / p >
< div class = price-input >
< p style = background:none; > £b $ b < span id = priceload > <? php echo $ _POST [' calculatedprice']; ?> < / span < span class =code-keyword>>
< / p >
<? php $ calculatedprice = $ _POST [' calculatedprice']; ?>
<! - input type =hiddenname =calculatedpricevalue =<?php echo $ calculatedprice;?> / - >
< / div >
< < span class =code-leadattribute> span > < / span >
< / div >





结帐页面的代码是

 $ _ SESSION ['calculatedprice'] = $ _POST ['calculatedprice']; 
< div < span class =code-attribute> class = skips-repeat-check >
< p > 价格:< / p >
< label > £<? php if($ amount == ' '){ echo $ calculatedprice ; } else { echo $ amount ; } ?> < / label >
< / div >



我怎样才能将这些值恢复到预订表格?

解决方案

amount == ' '){ echo


calculatedprice ; } else { echo


; } ?> < / label >
< / div >
< / div >



预订页的代码为

 <   div     class   =  skips-repeat >  
< p > 价格:< / p >
< div class = price-input >
< p style = background:none; > £b $ b < span id = priceload > <? php 回波

I have two forms one on the home page, the home page form is supposed to pass the form values to the booking form and values are passed through POST and forwarded to checkout page
but on the checkout page i have an edit form button,when edit button is clicked the values are not restored on the booking page again the code for the index.php form is

<div class="Required">
    <p>Price:
        <div class="price-input" style="width:297px;">
            <span style=" background-color:#FFFFFF;color: #2B2B2B;float: left;font-family: Arial,Helvetica,sans-serif;font-size: 13px;font-weight: bold;line-height: 20px;text-align: right;width: 115px;">&pound;&nbsp;</span>
            <span id="priceload">0</span>
        </div>
    </p>
    <div id="bottom-both-button">
        <input type="submit" class="book-button3" value="" style="margin-left:120px; margin-top:10px;" />
        <div class="skips-repeat-check">
            <p>Price:</p>
            <label>£ <?php if($amount=='') { echo $calculatedprice; } else { echo $amount; } ?></label>
        </div>
    </div>


the code for the booking page is

<div class="skips-repeat">
    <p>Price:</p>
    <div class="price-input">
        <p style="background:none;">£ 
            <span id="priceload"> <?php echo $_POST['calculatedprice']; ?></span>
        </p>
        <?php $calculatedprice = $_POST['calculatedprice'];?>
        <!--input type="hidden" name="calculatedprice" value="<?php echo $calculatedprice; ?>" /-->
    </div>
   <span></span>
</div>



the code for the checkout page is

$_SESSION['calculatedprice'] = $_POST['calculatedprice'];
<div class="skips-repeat-check">
    <p>Price:</p>
    <label>£ <?php if($amount=='') { echo $calculatedprice; } else { echo $amount; } ?></label>
</div>


how would i be able to reatin the values back to the booking form?

解决方案

amount=='') { echo


calculatedprice; } else { echo


amount; } ?></label> </div> </div>


the code for the booking page is

<div class="skips-repeat">
    <p>Price:</p>
    <div class="price-input">
        <p style="background:none;">£ 
            <span id="priceload"> <?php echo


这篇关于如何在不使用会话的情况下将表单的值从结帐页面保留到上一个表单页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆