CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Multiple files in array

Print topic Send  topic

Author Message
Markie


Posts: 251
Posted: 11/27/2008, 6:47 AM

At the moment I'm building a page which can make a zip archive of files in a folder. I want to show all the records of the database on this page and add a checkbox to each record. Visitors can check several boxes and the chosen files are added to the zip file.

The system to make zip files works smoothly, but at the moment I can only add one file to the zip.

I would like to know how I can add multiple files to an array, just by checking the checkboxes.

Markie
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL
View profile  Send private message
jjrjr1


Posts: 942
Posted: 11/27/2008, 7:06 AM

Markie

You have to make the checkbox a multiple item checkbox. The values will be added to the url as an array.

I have a post somewhere that sort of descibes this.

http://forums.yessoftware.com/posts.php?post_id=98742

Let me know if this helps


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
Gena

Posts: 591
Posted: 11/27/2008, 9:27 AM

To have a possibility to have one CheckBox for each row I use Editable grid.

So create a normal Editable grid and put some Checkbox. Then in AfterSubmit event you can get all checked checkboxes and process it as you need:

  
for($RowNumber = 1; $RowNumber <= $Container->TotalRows; $RowNumber++)  
{  
 if ($Container->FormParameters["CheckBox1"][$RowNumber]==1 ) {  
 //here you have a CURRENT row with CheckBox1 checked  
 // you can get  value you need like this, ProductPriceID is  control name	  
 $id = $Container->FormParameters["ProductPriceID"][$RowNumber]	;  
 }  
}  
  

_________________
Gena
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.