[PHP] Help with file downloads.

2009-07-19 Thread tony mount
Hi, My first post. Been writing php from scratch for about 12 months, mainly with what I learnt from the web. Have a problem trying to download multiple files. I'm using the following code: if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: applica

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Eddie Drapkin
On Sun, Jul 19, 2009 at 2:53 AM, Ashley Sheridan wrote: > On Sat, 2009-07-18 at 23:09 -0600, Govinda wrote: >> > i never used x-mapp-php5, but most of a forums say it is specific to >> > 1and1 hosting service. php recommends application/x-httpd-php >> > >> > http://us2.php.net/manual/en/install.uni

Re: [PHP] Help with file downloads.

2009-07-19 Thread Ashley Sheridan
On Sun, 2009-07-19 at 16:47 +0930, tony mount wrote: > Hi, > My first post. Been writing php from scratch for about 12 months, mainly > with what I learnt from the web. Have a problem trying to download > multiple files. I'm using the following code: > if (file_exists($file)) { > header('Conten

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
2009/7/19 MEM : >> Pagination is the generically applicable class - it should know >> nothing about what specifically it's paginating. > > Ok... but I need to grab values of my DAO classes, I mean, even if we > paginate images on a directory or records on a database table, the pagination > should

[PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
Hello, I have a Animals DAO class that I'd like to apply a pagination class to it. Between this two classes, there will be a composition relation (more precisely, an association one). My question is: Is a Pagination that "has a" Animal. OR Is a Animal that "has a" pagination? Should we create on

RE: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> Pagination is the generically applicable class - it should know > nothing about what specifically it's paginating. Ok... but I need to grab values of my DAO classes, I mean, even if we paginate images on a directory or records on a database table, the pagination should have a $limit, and a off

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
2009/7/19 MEM : > Hello, > > I have a Animals DAO class that I'd like to apply a pagination class to it. > > Between this two classes, there will be a composition relation (more > precisely, an association one). My question is: > > Is a Pagination that "has a" Animal. OR Is a Animal that "has a" pa

[PHP] PHP and FoxPro

2009-07-19 Thread Floyd Resler
We currently use the Easysoft ODBC Bridge to connect to a remote FoxPro database. The problem is that the bridge, after a while, starts consuming a ton of system resources and we have to reboot the machine. Afterwards, it can take upwards to two hours before everything is running quickly

RE: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> I don't know how your other classes are arranged, myPDO.class.php -> Singleton. Makes the connection to the database possible. generalDAO.class.php -> Abstract DAO Class, grabs the myPDO instance and could have other methods on the future that are shared for all the DAO classes. AnimalsDAO.c

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
2009/7/19 MEM : >> I don't know how your other classes are arranged, > > myPDO.class.php -> Singleton. Makes the connection to the database possible. > > generalDAO.class.php -> Abstract DAO Class, grabs the myPDO instance and > could have other methods on the future that are shared for all the DA

RE: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> I would say your pagination logic belongs in myPDO.class.php. Where I > have this functionality it's as simple as two arguments to the method > that gets data, $page and $perpage. Setting both to false would > retrieve all rows. Interesting but, still no clue, on this side, about how to accomp

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Govinda
Generally, if a file has a .html extenstion, then it should really just contain html. .php extensions are meant for php code containing html. File extension has absolutely no bearing at all on the contents of the file. There's valid reasons to not expose what's what under the hood, especiall

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
2009/7/19 MEM : > >> I would say your pagination logic belongs in myPDO.class.php. Where I >> have this functionality it's as simple as two arguments to the method >> that gets data, $page and $perpage. Setting both to false would >> retrieve all rows. > > Interesting but, still no clue, on this si

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Stuart
2009/7/19 Govinda : >>> Generally, if a file has a .html extenstion, then it should really just >>> contain html. .php extensions are meant for php code containing html. >>> >> >> File extension has absolutely no bearing at all on the contents of the >> file.  There's valid reasons to not expose wh

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Adam Shannon
On Sun, Jul 19, 2009 at 3:39 AM, Eddie Drapkin wrote: > On Sun, Jul 19, 2009 at 2:53 AM, Ashley > Sheridan wrote: > > On Sat, 2009-07-18 at 23:09 -0600, Govinda wrote: > >> > i never used x-mapp-php5, but most of a forums say it is specific to > >> > 1and1 hosting service. php recommends applicat

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Jason Pruim
On Jul 19, 2009, at 10:43 AM, Govinda wrote: Generally, if a file has a .html extenstion, then it should really just contain html. .php extensions are meant for php code containing html. File extension has absolutely no bearing at all on the contents of the file. There's valid reasons

[PHP] Re: Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Tony Marston
Two things strike me as wrong with your thinking: (1) The idea that you have a separate DAO for each entity instead of a single generic DAO which can act for any entity in the system. (2) The idea that pagination requires its own class, and therefore needs this "is-a" and "has-a" nonsense. As f

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Govinda
Most security issues have nothing to do with the programming language and everything to do with the code. Just because "facebook uses the .php extension" certainly does not mean their code has no security holes and even if it's clean it certainly doesn't mean your code will be secure. Stuart I h

RE: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> I don't know much about PDO, but in raw MySQL SQL you'd have something > similar to this... > > function Select($table, $where, $page = false, $perpage = 20) > { > $sql = 'select * from '.$table.' where '.$where; > if ($page !== false) > { > $sql .= ' limit '.(($page-1)*$perpage).', '.

RE: [PHP] Re: Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> As for (1) even in my pre-OO days I was used to using a single generic > DAO > for all database access. The only time that more than one DAO existed > was > for a different DBMS engine. This is why I have one DAO class for MySQL, > one > for PostgreSQL and another for Oracle. If you are incapable

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Adam Shannon
On Sun, Jul 19, 2009 at 10:00 AM, Govinda wrote: > Most security issues have nothing to do with the programming language >> and everything to do with the code. Just because "facebook uses the >> .php extension" certainly does not mean their code has no security >> holes and even if it's clean it

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Lenin
> > On Sun, Jul 19, 2009 at 10:00 AM, Govinda >wrote: > > > > > * You turn expose_php off in your php.ini > >> > > > > what does this one ^^^ do exactly ? > expose_php boolean Decides whether PHP may expose the fact that it is installed on the server (e.g. by adding its signature to the Web ser

RE: [PHP] Re: Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> > As for (1) even in my pre-OO days I was used to using a single > generic > > DAO > > for all database access. The only time that more than one DAO existed > > was > > for a different DBMS engine. This is why I have one DAO class for > MySQL, > > one > > for PostgreSQL and another for Oracle. If

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Paul M Foster
On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote: > > > You do realize that PHP does not parse HTML files, right? The web server > > does that. In fact, the web server also parses PHP files, using a > > different library. > > Kindly elaborate If you are saying that PHP cant parse files wit

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Ashley Sheridan
On Sun, 2009-07-19 at 14:07 -0400, Paul M Foster wrote: > On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote: > > > > > > You do realize that PHP does not parse HTML files, right? The web server > > > does that. In fact, the web server also parses PHP files, using a > > > different library.

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Stuart
2009/7/19 Paul M Foster : > On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote: > >> >> > You do realize that PHP does not parse HTML files, right? The web server >> > does that. In fact, the web server also parses PHP files, using a >> > different library. >> >> Kindly elaborate If you are sa

Re: [PHP] Re: Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Tony Marston
""MEM"" wrote in message news:002001ca0898$5d183840$1748a8...@com... > > As for (1) even in my pre-OO days I was used to using a single > > generic DAO for all database access. The only time that more > > than one DAO existed was for a different DBMS engine. This > > is why I have one DAO class

RE: [PHP] Re: Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> Why not? Why can't you replace a call to a mysqli function with a call > to a > PDO function? It's not just a simple replacement - I need to add bindparam, prepare, execute, placeholders and fetchObject. But I will give it a try... > > Also, I also intend to use fetchObject method instead of f

Re: [PHP] PHP and FoxPro

2009-07-19 Thread Paul M Foster
On Sun, Jul 19, 2009 at 09:00:49AM -0400, Floyd Resler wrote: > We currently use the Easysoft ODBC Bridge to connect to a remote > FoxPro database. The problem is that the bridge, after a while, > starts consuming a ton of system resources and we have to reboot the > machine. Afterwards, it can

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Paul M Foster
On Sun, Jul 19, 2009 at 07:18:34PM +0100, Stuart wrote: > 2009/7/19 Paul M Foster : > > On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote: > > > >> > >> > You do realize that PHP does not parse HTML files, right? The web server > >> > does that. In fact, the web server also parses PHP files,

Re: [PHP] Re: Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Paul M Foster
On Sun, Jul 19, 2009 at 03:56:43PM +0100, Tony Marston wrote: > Two things strike me as wrong with your thinking: > > (1) The idea that you have a separate DAO for each entity instead of a > single generic DAO which can act for any entity in the system. > (2) The idea that pagination requires its

Re: [PHP] Re: Newbie: Composition by Association - PaginationClass general question.

2009-07-19 Thread Tony Marston
"Paul M Foster" wrote in message news:20090719220923.gv14...@quillandmouse.com... > On Sun, Jul 19, 2009 at 03:56:43PM +0100, Tony Marston wrote: > >> Two things strike me as wrong with your thinking: >> >> (1) The idea that you have a separate DAO for each entity instead of a >> single generic

Re: [PHP] Dual PHP installation and session sharing

2009-07-19 Thread Zareef Ahmed
On Sat, Jul 18, 2009 at 1:34 AM, Bruno Fajardo wrote: > Hi all, > > I'm using Apache/2.2.3 (Linux/SUSE), running PHP 4.4.7 in CGI mode, in a > dual installation with PHP 5.1.2 running as an Apache module. > Scripts with .php5 extension are executed by PHP 5, and those with .php are > executed by

[PHP] file_set_contents() do several times?

2009-07-19 Thread Martin Zvarík
Makes sense? or is it enough to do it just once? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] file_set_contents() do several times?

2009-07-19 Thread Jim Lucas
Martin Zvarík wrote: Makes sense? or is it enough to do it just once? You call file_put_contents() once. it writes an entire file when called. use fopen/fwrite/fclose to do it line by line. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have grea