davidcook Posted July 23, 2012 Share Posted July 23, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/266135-display-listbox-selected-item-on-another-webpage/ Share on other sites More sharing options...
xyph Posted July 23, 2012 Share Posted July 23, 2012 You'll have to expand on exactly what you want. I want to say it's not reliably possible, but I'm not entirely sure what you want to do. Quote Link to comment https://forums.phpfreaks.com/topic/266135-display-listbox-selected-item-on-another-webpage/#findComment-1363805 Share on other sites More sharing options...
davidcook Posted July 23, 2012 Author Share Posted July 23, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/266135-display-listbox-selected-item-on-another-webpage/#findComment-1363812 Share on other sites More sharing options...
xyph Posted July 23, 2012 Share Posted July 23, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/266135-display-listbox-selected-item-on-another-webpage/#findComment-1363816 Share on other sites More sharing options...
davidcook Posted July 23, 2012 Author Share Posted July 23, 2012 thank you, i'll try it. Quote Link to comment https://forums.phpfreaks.com/topic/266135-display-listbox-selected-item-on-another-webpage/#findComment-1363835 Share on other sites More sharing options...
davidcook Posted July 30, 2012 Author Share Posted July 30, 2012 hello, i had no luck. why don't you contact me off list at dave at copycall dot com , and we can arrange something. Quote Link to comment https://forums.phpfreaks.com/topic/266135-display-listbox-selected-item-on-another-webpage/#findComment-1365441 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.