Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 27th, 2003, 02:21 PM
Authorized User
Join Date: Jun 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default checkboxes to export records

Okay not sure if im putting this in the correct form.

My question is, I have been developing an online telephone directory. When you type in your search criteria you are displayed your results in rows,if the count goes over 15 there is a next link to go to the next 15 results etc, you get the idea. To remember the post criteria I have used sessions.

Anyway my problem is that I want to put little check boxes at the start of each record so users can click them and then export them, when they are finished I want to be able to display all the checked items. Im not sure how to do this, I was thinking of perhaps putting all the checked resord id's into a array and storing it in a session, but Im not sure if its possible. Anyone any ideas of how to do it or seen some tutorials around? I dont want anyone to write code for me just point me in a direction to start or some tips? I dont really want my users to have to click a submit buttton every time they select a couple records on a page.

Thanks in advance
Old June 28th, 2003, 01:46 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts

Trick your users -- have all your page links (next, prev, "go to page..") submit the form instead of perform a simple redirect. All checked items should be stored into a session. That way, when a user goes BACK to a page that has previously checked items, they can choose to UNcheck them as well.

The only problem here is that you have to be a little clever to figure out if a user has unchecked an item. You need to know all of the items that were displayed on that page, which of those items are already checked in the session, and which items are checked in the submitted form.

It shouldn't be terribly difficult. If you want next/prev to be hyperlinks, you'll need to generate the javascript which submits the form. Or, you can have the next/prev be submit buttons (or images), whatever.

Make sense?

Take care,


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export ALL records from GridView into Excel or CSV kevorkian ASP.NET 2.0 Basics 7 June 17th, 2008 01:28 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Delete records in MySQL using checkboxes in forms taslim Beginning PHP 2 August 10th, 2006 05:01 AM
Deleting several records on ASP using checkboxes luisbueno Oracle ASP 1 April 25th, 2005 08:47 PM
The use of checkboxes to delete records inoracle9i luisbueno Classic ASP Databases 0 December 24th, 2004 12:07 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.