[PHP] Re: Advice on maintaining public and private files

2010-02-19 Thread clancy_1
On Fri, 19 Feb 2010 13:19:50 -0500, st...@astroh.org (Michael Stroh) wrote: >I have a site I'm working on with some data that I want to be readable by >anyone, but some files that I want to keep hidden from outside users. Here is >an example of my file structure. > >/products/data1/item_1/data.t

RE: [PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Daevid Vincent
> >> -Original Message- > >> From: Ian Robertson [mailto:irobert...@americantextile.com] > >> Sent: Friday, February 19, 2010 1:28 PM > >> To: php-general@lists.php.net > >> Subject: [PHP] Excel Spreadsheets and PHP > >> > >> Hello, everyone. > >> > >> Just a quick question. > >> > >> What

Re: [PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Bastien Koert
You can also create an htnl table and excel will happily handle that as well. The real trick is to get IE to accept the stream as a file download. I find that I need to save the file first and the push the file down. On 2/19/10, Hansen, Mike wrote: >> -Original Message- >> From: Ian Ro

RE: [PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Hansen, Mike
> -Original Message- > From: Ian Robertson [mailto:irobert...@americantextile.com] > Sent: Friday, February 19, 2010 1:28 PM > To: php-general@lists.php.net > Subject: [PHP] Excel Spreadsheets and PHP > > Hello, everyone. > > Just a quick question. > > What are you using, if anything, t

Re: [PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Andrew Ballard
On Fri, Feb 19, 2010 at 3:36 PM, Bob McConnell wrote: > From: Ian Robertson > >> What are you using, if anything, to create Excel spreadsheets with > PHP? >> > > Output CSV files with the correct MIME type. MS-Windows will open them > in Excel by default in both IE and Firefox. > > Unfortunately,

RE: [PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Ashley Sheridan
On Fri, 2010-02-19 at 15:36 -0500, Bob McConnell wrote: > From: Ian Robertson > > > What are you using, if anything, to create Excel spreadsheets with > PHP? > > > > Output CSV files with the correct MIME type. MS-Windows will open them > in Excel by default in both IE and Firefox. > > Unfortu

RE: [PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Bob McConnell
From: Ian Robertson > What are you using, if anything, to create Excel spreadsheets with PHP? > Output CSV files with the correct MIME type. MS-Windows will open them in Excel by default in both IE and Firefox. Unfortunately, this happens even if you have Open Office installed and would prefer

[PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Ian Robertson
Hello, everyone. Just a quick question. What are you using, if anything, to create Excel spreadsheets with PHP? Thank you in advance.

RE: [PHP] Advice on maintaining public and private files

2010-02-19 Thread Bob McConnell
From: Rene Veerman > the "proper way" i know of is not the easiest to implement..; > > 1) create a php script that accepts enough parameters to get at your data. > eg: /products/view.php?dataNr=1&itemNr=1 > 2) let that script compare the current user (visitor who's logged in) > to authentication

Re: [PHP] Re: Login Script: mysql_num_rows(): supplied argument isnot a valid MySQL result resource

2010-02-19 Thread Mark Cilissen
Ashley Sheridan schreef: On Fri, 2010-02-19 at 18:30 +0100, Mark Cilissen wrote: David Hutto schreef: --- On Fri, 2/19/10, David Hutto wrote: From: David Hutto Subject: Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource To: php-general@lists.php.net Date

Re: [PHP] Max file size in fopen()

2010-02-19 Thread Ashley Sheridan
On Fri, 2010-02-19 at 17:42 -0200, Darvin Denmian wrote: > Hello, > > I need to open a file with more than 2GB but the following error occurs: > > failed to open stream: Value too large for defined data type in > /srv/www/sandboxes/dev02/test.php on line 2 > > I'm running this php in a 32 bits

[PHP] Max file size in fopen()

2010-02-19 Thread Darvin Denmian
Hello, I need to open a file with more than 2GB but the following error occurs: failed to open stream: Value too large for defined data type in /srv/www/sandboxes/dev02/test.php on line 2 I'm running this php in a 32 bits system. Googling I found that with the option "CFLAGS="-D_FILE_OFFSET_BIT

Re: [PHP] Advice on maintaining public and private files

2010-02-19 Thread Rene Veerman
1 more thing: doing this right isn't easy. at all. it took me more than a year to "do it properly". you may wanna look around on sf.net for any package that can do this for you. On Fri, Feb 19, 2010 at 7:19 PM, Michael Stroh wrote: > I have a site I'm working on with some data that I want to be

Re: [PHP] Advice on maintaining public and private files

2010-02-19 Thread Rene Veerman
As far as storing the files, use a seperate subdirectory called "rawData" or something, and place all your files in there, aim for 10 - 5000 files per directory, and keep it logical. But since you want to stop guessers from accessing it, use a randomID() function that you create to generate a rando

Re: [PHP] Advice on maintaining public and private files

2010-02-19 Thread Rene Veerman
the "proper way" i know of is not the easiest to implement..; 1) create a php script that accepts enough parameters to get at your data. eg: /products/view.php?dataNr=1&itemNr=1 2) let that script compare the current user (visitor who's logged in) to authentication data that tells which it if the

[PHP] Re: Magnetic Stripe Reader or Barcode to PHP

2010-02-19 Thread Shawn McKenzie
Daevid Vincent wrote: > I'll confess that I've done almost zero research on this topic as of right > now aside from pricing readers and blank cards. > > So we're opening a new super-club here in Seattle. One of the ideas we'd > like to pursue is that people are assigned a card. This can be a magst

Re: [PHP] Advice on maintaining public and private files

2010-02-19 Thread Bastien Koert
On Fri, Feb 19, 2010 at 1:19 PM, Michael Stroh wrote: > I have a site I'm working on with some data that I want to be readable by > anyone, but some files that I want to keep hidden from outside users. Here is > an example of my file structure. > > /products/data1/item_1/data.txt > /products/dat

[PHP] Advice on maintaining public and private files

2010-02-19 Thread Michael Stroh
I have a site I'm working on with some data that I want to be readable by anyone, but some files that I want to keep hidden from outside users. Here is an example of my file structure. /products/data1/item_1/data.txt /products/data2/item_2/data.txt I would like everything in data1 to be availab

Re: [PHP] Re: Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource

2010-02-19 Thread Ashley Sheridan
On Fri, 2010-02-19 at 18:30 +0100, Mark Cilissen wrote: > David Hutto schreef: > > > > --- On Fri, 2/19/10, David Hutto wrote: > > > > From: David Hutto > > Subject: Login Script: mysql_num_rows(): supplied argument is not a valid > > MySQL result resource > > To: php-general@lists.php.net >

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Dotan Cohen
> What about eBook ($23.99)? > > http://oreilly.com/catalog/9780596006563 > > If you can get this, you can get that. > That may be a good idea. Certainly better than the pirate bay. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il Please CC me if you want to be sure that I read yo

[PHP] Re: Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource

2010-02-19 Thread Mark Cilissen
David Hutto schreef: --- On Fri, 2/19/10, David Hutto wrote: From: David Hutto Subject: Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource To: php-general@lists.php.net Date: Friday, February 19, 2010, 3:30 AM The following script is supposed to validate

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread tedd
At 5:43 PM +0200 2/19/10, Dotan Cohen wrote: On 19 February 2010 16:27, tedd wrote: > An excellent book on this (and much more) is Chris Shiflett's Essential PHP Security. You can pick it up on Amazon for less than $20 -- well worth the cost. They don't ship to Israel! I have looked for i

Re: [PHP] array conversion

2010-02-19 Thread Richard Quadling
On 19 February 2010 15:52, tedd wrote: > At 10:48 AM + 2/19/10, Richard Quadling wrote: >> >> On 19 February 2010 07:26, Adam Richardson wrote: >>  Or, > > Code fight!!! > > http://www.webbytedd.com/ccc/array/ > > After reviewing the entries, mine does not provide any significant > difference

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Teus Benschop
On Fri, 2010-02-19 at 11:45 -0500, Paul M Foster wrote: > On Fri, Feb 19, 2010 at 05:43:15PM +0200, Dotan Cohen wrote: > > They don't ship to Israel! I have looked for it locally, but not found > > it. I'm sure that I could "acquire" a copy on some p2p service but I > > really don't like doing that

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Paul M Foster
On Fri, Feb 19, 2010 at 05:43:15PM +0200, Dotan Cohen wrote: > > They don't ship to Israel! I have looked for it locally, but not found > it. I'm sure that I could "acquire" a copy on some p2p service but I > really don't like doing that. Maybe I could Paypal $20 to Chris > himself if that rem

Re: [PHP] array conversion

2010-02-19 Thread tedd
At 10:48 AM + 2/19/10, Richard Quadling wrote: On 19 February 2010 07:26, Adam Richardson wrote: Or, Code fight!!! http://www.webbytedd.com/ccc/array/ After reviewing the entries, mine does not provide any significant difference. I did it as a mental exercise after looking at several

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Dotan Cohen
> One would be storage space, as base64 requires more space to store the > same data. For a single data element that might not be much, but when > multiplied over all the values stored in your table it makes a > difference. > That is a good point, thanks. > Also, don't forget to validate/filter

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Dotan Cohen
On 19 February 2010 16:27, tedd wrote: > At 3:18 PM +0200 2/19/10, Dotan Cohen wrote: >> >> In order to prevent SQL injection, can one simply base64 encode the >> data and store that? Then it can be decoded when I need to display it >> on a website. I understand that this means that the data will

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Andrew Ballard
On Fri, Feb 19, 2010 at 8:18 AM, Dotan Cohen wrote: > In order to prevent SQL injection, can one simply base64 encode the > data and store that? Then it can be decoded when I need to display it > on a website. I understand that this means that the data will not be > searchable, and that I still mu

Re: [PHP] Export/Write rows from DBF to CSV

2010-02-19 Thread Andrew Ballard
On Thu, Feb 18, 2010 at 5:31 PM, OBXer wrote: > > I'm trying to adopt this piece of code for my use.  I fixed the csv_data .= > trim error.  Does anyone know how I can fix empty fields?  Everything is > dumping to a csv file but information is not matching up.  I don't know if I > can insert a spa

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread tedd
At 3:18 PM +0200 2/19/10, Dotan Cohen wrote: In order to prevent SQL injection, can one simply base64 encode the data and store that? Then it can be decoded when I need to display it on a website. I understand that this means that the data will not be searchable, and that I still must sanitize it

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Ashley Sheridan
On Fri, 2010-02-19 at 15:18 +0200, Dotan Cohen wrote: > In order to prevent SQL injection, can one simply base64 encode the > data and store that? Then it can be decoded when I need to display it > on a website. I understand that this means that the data will not be > searchable, and that I still

[PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Dotan Cohen
In order to prevent SQL injection, can one simply base64 encode the data and store that? Then it can be decoded when I need to display it on a website. I understand that this means that the data will not be searchable, and that I still must sanitize it before printing it on the site. Are there any

Re: [PHP] Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource

2010-02-19 Thread David Hutto
--- On Fri, 2/19/10, Ashley Sheridan wrote: From: Ashley Sheridan Subject: Re: [PHP] Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource To: "David Hutto" Cc: php-general@lists.php.net Date: Friday, February 19, 2010, 5:34 AM On Fri, 2010-02-19 at

Re: [PHP] array conversion

2010-02-19 Thread Richard Quadling
On 19 February 2010 07:26, Adam Richardson wrote: > Or, > > function new_arr(array $arr) > { >    $count = count($arr); >    if ($count % 2 != 0) throw new Exception('The new_arr() function > requires an even number of elements.'); >    for ($i = 0; $i < $count; $i += 2) >    { >        $new_arr[$

Re: [PHP] Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource

2010-02-19 Thread Ashley Sheridan
On Fri, 2010-02-19 at 00:30 -0800, David Hutto wrote: > The following script is supposed to validate a username and password in a > mysql db. When entering the username and password of a preregistered user, I > get the following errors: > > Warning: mysql_num_rows(): supplied argument is not

Re: [PHP] Magnetic Stripe Reader or Barcode to PHP

2010-02-19 Thread Richard Quadling
On 18 February 2010 22:42, Daevid Vincent wrote: > I'll confess that I've done almost zero research on this topic as of right > now aside from pricing readers and blank cards. > > So we're opening a new super-club here in Seattle. One of the ideas we'd > like to pursue is that people are assigned

[PHP] Re: Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource

2010-02-19 Thread David Hutto
--- On Fri, 2/19/10, David Hutto wrote: From: David Hutto Subject: Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource To: php-general@lists.php.net Date: Friday, February 19, 2010, 3:30 AM The following script is supposed to validate a username and passwor

[PHP] Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource

2010-02-19 Thread David Hutto
The following script is supposed to validate a username and password in a mysql db.  When entering the username and password of a preregistered user, I get the following errors: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/login.php on line 24