Jump to content

Recommended Posts

hello, i need to display the listbox selected item on a different webpage(for paypal-google checkout transaction). how would i do that?

 

<div id="selection_wrapper" style="margin-top: px;">

        <div id="states">

      <?php render_states_list(); ?>

</div>

        <div id="npa">

        <div id="npas_wrapper">

                <ul class="list_box"></ul>

        </div>

        </div>

<div id="dids">

        <div id="dids_wrapper">

                <ul class="list_box"></ul>

        </div></div>

        </div>

        <br style="clear:both;" />

<div id="selected"><span id="selected_number_display">Selected number: none</span>

        </div>

 

thank you in advance.

dave

thank you for the reply,

i am using a listbox to select a telephone number from a mysql database and a telephoe carrier api which contains states, area codes and telephone numbers.

after the customer is finished selecting the number, it is display on the webpage. however, i need to display the selected telephone number on another webpage to complete the transaction with paypal or google checkout. currently, all this goes on one webpage, but i need to change the format of this whole process. here is what i have for the transaction to be completed on one page:

<div id="selection_wrapper" style="margin-top: px;">

<div id="states">

 

<?php render_states_list(); ?>

</div>

 

<div id="npa">

           

 

            <div id="npas_wrapper">

                <ul class="list_box"></ul>

                </div>

            </div>

<div id="dids">

           

<div id="dids_wrapper">

                <ul class="list_box"></ul>

                </div></div>

</div>

 

<br style="clear:both;" />

 

<div id="selected"><span id="selected_number_display">Selected number: none</span></div>

 

          <!-- End selection -->

 

then the payment plans, paypal and google checkout transactions begin. i want to break this process up onto two webpages.

thank you in advance.

dave

So you mean a multi-page form? That's very straight-forward.

 

Basically, how it works is you use a form on each page.:

page1.php

 

<form method="post" action="page2.php">
First Name:<input type="text" name="first_name" />
Last Name:<input type="text" name="last_name"  />
<input type="submit" name="submit" />
</form>

Then in page 2, you echo the variables from page 1 into hidden fields in the form for use on page 3:

page2.php

 

<?php
$fname=htmlspecialchars($_POST['first_name']);
$lname=htmlspecialchars($_POST['last_name']);
?>
<html>
<head></head>
<body>
<form method="post" action="page3.php">
<input type="hidden" name="first_name" value="<?php echo $fname;?>" />
<input type="hidden" name="last_name" value="<?php echo $lname;?>" />
Education:<input type="text" name="education" />
School:<input type="text" name="school" />
<input type="submit" name="submit" />
</form>
</body>
</html>

The same goes for page 3:

page3.php

<?php
$fname=htmlspecialchars($_POST['first_name']);
$lname=htmlspecialchars($_POST['last_name']);
$education=htmlspecialchars($_POST['education']);
$school=htmlspecialchars($_POST['school']);
?>
<html>
<head></head>
<body>
<form method="post" action="page4.php">
<input type="hidden" name="first_name" value="<?php echo $fname;?>" />
<input type="hidden" name="last_name" value="<?php echo $lname;?>" />
<input type="hidden" name="education" value="<?php echo $education;?>" />
<input type="hidden" name="school" value="<?php echo $school;?>" />
Experience:<input type="text" name="experience" />
<input type="submit" name="submit" />
</form>
</body>
</html>

Now, all the variables from all 3 pages are posted to page 4.

Hope this helps

 

 

- Copied, then modified, from daniweb.com by user buddylee17

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.