Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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
HTML
<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
HTML
<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
HTML
$_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?
Posted
Updated 18-Apr-13 4:32am
v4
Comments
Prasad Khandekar 18-Apr-13 10:35am    
From index page how are you passing value (calculatedprice) to booking page. Label won't help you in passing the value. You will have to have a hidden filed named calculatedprice.
Richard C Bishop 18-Apr-13 10:35am    
How about passing it via a query string, unless it is secure information of course.
patrick_green 19-Apr-13 3:33am    
i am passing it via label name and accesing it through post
the main requirement is to retain back the values from the checkout page and i don't know how to do that

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900