Re: [PHP] conditional classes

2009-05-23 Thread LinuxManMikeC
As long as you design it with a consistent interface I don't see a problem. The whole point of creating abstractions like this is so when you're writing the rest of your code you don't have to think about the gritty details behind the scenes (like PDO or non-PDO). If you design the class so that

[PHP] conditional classes

2009-05-23 Thread kranthi
is this a bad practice? i want to create a database class, with a particular definition when server supports PDO and a different definition if the server does not comments please. Kranthi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] change server time

2009-05-23 Thread Sumit Sharma
Hi, Whenever I am using date('r') function It shows time in GMT instead of local time set on my machine. Do I need to configure the time separately. I am using WAMP server locally. Thanks, Sumit

Re: [PHP] Re: -less layouts; Ideas welcome

2009-05-23 Thread Michael A. Peters
Paul M Foster wrote: I wish someone had thought of a similar thing for databases. From the beginning, there should have been a spreadsheet-like interface for databases. This could have saved endless trouble, since for lack of this, people store database information in spreadsheets. And then won

Re: [PHP] templating engine options

2009-05-23 Thread Eddie Drapkin
I've had a lot of success with Savant3: www.phpsavant.com becuase it's pretty featureful yet fast(er than the alternatives I tested). On Sat, May 23, 2009 at 7:01 PM, Nathan Rixham wrote: > LinuxManMikeC wrote: > >> On Sat, May 23, 2009 at 4:21 PM, Nathan Rixham wrote: >> >>> Hi All, >>> >>> Ju

Re: [PHP] Re: -less layouts; Ideas welcome

2009-05-23 Thread Paul M Foster
On Sat, May 23, 2009 at 10:52:56AM -0400, tedd wrote: > At 9:08 AM -0400 5/23/09, Robert Cummings wrote: >> Ya know... the people over at HTML standards design cold have saved the >> world a large number of headaches by just adding a new attribute to >> tables: >> >> >> >> Then everyone layou

Re: [PHP] Re: Rogue 'if - elseif' code

2009-05-23 Thread LinuxManMikeC
On Sat, May 23, 2009 at 4:36 PM, Andre Dubuc wrote: > On May 23, 2009, you wrote: >> On Fri, May 22, 2009 at 2:50 PM, Nathan Rixham wrote: >> > Andre Dubuc wrote: >> >> Hi, >> >> >> >> I'm having problems with a chunk of 'rogue' code that does not perform >> >> as expected (it does not pass the e

Re: [PHP] templating engine options

2009-05-23 Thread Nathan Rixham
LinuxManMikeC wrote: On Sat, May 23, 2009 at 4:21 PM, Nathan Rixham wrote: Hi All, Just a quick one, can anybody recommend any decent templating engines other than smarty. I've got no problem with smarty and it does the job - but if there is something newer and lighter out there that I'm miss

Re: [PHP] templating engine options

2009-05-23 Thread Nathan Rixham
Kevin Waterson wrote: On Sat, 2009-05-23 at 23:21 +0100, Nathan Rixham wrote: Hi All, Just a quick one, can anybody recommend any decent templating engines other than smarty. I've got no problem with smarty and it does the job - but if there is something newer and lighter out there that I'm

Re: [PHP] templating engine options

2009-05-23 Thread Kevin Waterson
On Sat, 2009-05-23 at 23:21 +0100, Nathan Rixham wrote: > Hi All, > > Just a quick one, can anybody recommend any decent templating engines > other than smarty. > > I've got no problem with smarty and it does the job - but if there is > something newer and lighter out there that I'm missing the

Re: [PHP] templating engine options

2009-05-23 Thread LinuxManMikeC
On Sat, May 23, 2009 at 4:21 PM, Nathan Rixham wrote: > Hi All, > > Just a quick one, can anybody recommend any decent templating engines other > than smarty. > > I've got no problem with smarty and it does the job - but if there is > something newer and lighter out there that I'm missing then I'd

[PHP] templating engine options

2009-05-23 Thread Nathan Rixham
Hi All, Just a quick one, can anybody recommend any decent templating engines other than smarty. I've got no problem with smarty and it does the job - but if there is something newer and lighter out there that I'm missing then I'd be a fool not to at least consider it! can't be part of a f

Re: [PHP] urgent CSS question

2009-05-23 Thread LinuxManMikeC
Maybe there is another CSS rule that also matches the same context and overrides parts of the #frame1 rule, but didn't match when using the old #frame rule. Just my two cents. On Fri, May 22, 2009 at 7:15 PM, PJ wrote: > Benjamin Hawkes-Lewis wrote: >> On 22/5/09 20:31, PJ wrote: >>> They may ha

Re: [PHP] Re: Rogue 'if - elseif' code

2009-05-23 Thread Nathan Rixham
LinuxManMikeC wrote: On Fri, May 22, 2009 at 2:50 PM, Nathan Rixham wrote: Andre Dubuc wrote: Hi, I'm having problems with a chunk of 'rogue' code that does not perform as expected (it does not pass the expected date, but an empty value). Most of the time, it works - so I'm wondering whether

Re: [PHP] Re: Rogue 'if - elseif' code

2009-05-23 Thread LinuxManMikeC
On Fri, May 22, 2009 at 2:50 PM, Nathan Rixham wrote: > Andre Dubuc wrote: >> >> Hi, >> >> I'm having problems with a chunk of 'rogue' code that does not perform as >> expected (it does not pass the expected date, but an empty value). Most of >> the time, it works - so I'm wondering whether it mig

Re: [PHP] how to delete part of string

2009-05-23 Thread LinuxManMikeC
What are you trying to do that $_POST can't do? With those duplicate 'id' fields, change the input name to 'id[]' in the HTML form and PHP will generate an array for you accessible by $_POST['id'][$index]. If you still have a good reason for working with the raw POST data, just apply the preg_rep

Re: [PHP] Re: Forms validation and creation- easier solution?

2009-05-23 Thread Stephen
Tony Marston wrote: Your ideas are similar to mine, but I have a much more advanced implementation which involves the use of a Data Dictionary. After building a database table I import the structure into my data dictionary, then export it to create a database table class and a table structure f

Re: [PHP] how to delete part of string

2009-05-23 Thread Grega Leskovsek
No, I used POST and manage the data through a stream: if ($fp = fopen("php://input", 'r')) { $content = ''; // keep reading until there's nothing left while ($line = fgets($fp)) { $content .= $line; } } Please advice on the matter. All the Love, Grega from Slovenia 2009/5/23

[PHP] Re: Forms validation and creation- easier solution?

2009-05-23 Thread Tony Marston
"Daniele Grillenzoni" wrote in message news:16.1e.28112.84ca5...@pb1.pair.com... > On 20/05/2009 9.03, Angelo Zanetti wrote: >> Hi all. >> >> >> >> We have done quite a few projects and we are looking to find better ways >> to >> implementing forms. >> >> >> >> Forms seem to be quite time consu

Re: [PHP] how to delete part of string

2009-05-23 Thread Marc Steinert
I guess you mean GET parameters instead of POST. $string = preg_replace('/^(.*?)&id=/', '&id=', $_SERVER['QUERY_STRING']); Don't know, if that's exactly what you wanted. Greetings from Germany Marc Grega Leskovsek wrote: I have a POST string field and I want to skip some & fields before &id

[PHP] how to delete part of string

2009-05-23 Thread Grega Leskovsek
I have a POST string field and I want to skip some & fields before &id= How do I simply delete operation=nekaj&price=fddf&id=de&id=ta ... into &id=de&id=ta ... Thanks in advance, -- When the sun rises I receive and when it sets I forgive -> http://users.skavt.net/~gleskovs/ All the Love, Grega Le

Re: [PHP] How to create an intermediary page between two pages

2009-05-23 Thread tedd
At 4:34 PM +0200 5/23/09, Moses wrote: Dear Folks, Thanks Tedd for the reply. Do you have a simple example to ilustrate your great idea. Thanks. Moses: It's not a great idea, just a simple solution to a common problem -- see here: http://www.webbytedd.com/b3/step-example/ Cheers, tedd --

Re: [PHP] How to assign eval() to variable?

2009-05-23 Thread tedd
At 3:34 PM +0100 5/23/09, Stuart wrote: 2009/5/23 Robert Cummings : > You should have connected your phrasing to context then. Your wording suggested a generalization. "Relatively expensive" did not relate to any other information you provided in the same sentence... relatively expensive to

Re: [PHP] Re: -less layouts; Ideas welcome

2009-05-23 Thread tedd
At 9:08 AM -0400 5/23/09, Robert Cummings wrote: Ya know... the people over at HTML standards design cold have saved the world a large number of headaches by just adding a new attribute to tables: Then everyone layout table out there would have been valid by the simple addition of this att

Re: [PHP] How to create an intermediary page between two pages

2009-05-23 Thread Moses
Dear Folks, Thanks Tedd for the reply. Do you have a simple example to ilustrate your great idea. Thanks. On Sat, May 23, 2009 at 3:47 PM, tedd wrote: > At 2:20 PM +0200 5/23/09, Moses wrote: > >> Hi Folks, >> >> I would like to know whether you can connect two pages via >> an intermediary pag

Re: [PHP] How to assign eval() to variable?

2009-05-23 Thread Stuart
2009/5/23 Robert Cummings : > On Sat, 2009-05-23 at 15:11 +0100, Stuart wrote: >> 2009/5/23 Robert Cummings : >> > On Sat, 2009-05-23 at 14:43 +0100, Stuart wrote: >> >> 2009/5/23 Afan Pasalic : >> >> > short hack works like a charm! >> >> > :-) >> >> >> >> It may work but output buffers are relati

Re: [PHP] Legal $_SESSION names

2009-05-23 Thread tedd
At 2:25 PM +0100 5/23/09, Stuart wrote: 2009/5/22 tedd : > Regardless of what anyone may say to the contrary, it doesn't work everywhere. I found that out the hard way. The fix is simply to use a different name for the variable, such as: $my_var = $_SESSION['myvar']; I'm just guessing but

Re: [PHP] How to assign eval() to variable?

2009-05-23 Thread Robert Cummings
On Sat, 2009-05-23 at 15:11 +0100, Stuart wrote: > 2009/5/23 Robert Cummings : > > On Sat, 2009-05-23 at 14:43 +0100, Stuart wrote: > >> 2009/5/23 Afan Pasalic : > >> > short hack works like a charm! > >> > :-) > >> > >> It may work but output buffers are relatively expensive. The eval > >> functio

Re: [PHP] How to assign eval() to variable?

2009-05-23 Thread Stuart
2009/5/23 Robert Cummings : > On Sat, 2009-05-23 at 14:43 +0100, Stuart wrote: >> 2009/5/23 Afan Pasalic : >> > short hack works like a charm! >> > :-) >> >> It may work but output buffers are relatively expensive. The eval >> function will return the value the eval'd code returns, so just stick >>

Re: [PHP] How to assign eval() to variable?

2009-05-23 Thread Robert Cummings
On Sat, 2009-05-23 at 14:43 +0100, Stuart wrote: > 2009/5/23 Afan Pasalic : > > short hack works like a charm! > > :-) > > It may work but output buffers are relatively expensive. The eval > function will return the value the eval'd code returns, so just stick > a return statement at the end of th

Re: [PHP] Re: -less layouts; Ideas welcome

2009-05-23 Thread Lenin
Have anyone of you checked the table to div converter class from www.phpclasses.org ?

Re: [PHP] How to create an intermediary page between two pages

2009-05-23 Thread tedd
At 2:20 PM +0200 5/23/09, Moses wrote: Hi Folks, I would like to know whether you can connect two pages via an intermediary page. For example if you have main.php, which is a form whose action is directed to function.php. Function.php process the information from main.php then displays the resul

Re: [PHP] How to assign eval() to variable?

2009-05-23 Thread Stuart
Oops, didn't mean to hit send... 2009/5/23 Stuart : > 2009/5/23 Afan Pasalic : >> short hack works like a charm! >> :-) > > It may work but output buffers are relatively expensive. The eval > function will return the value the eval'd code returns, so just stick > a return statement at the end of t

Re: [PHP] How to assign eval() to variable?

2009-05-23 Thread Stuart
2009/5/23 Afan Pasalic : > short hack works like a charm! > :-) It may work but output buffers are relatively expensive. The eval function will return the value the eval'd code returns, so just stick a return statement at the end of the string you're eval'ing. Suggestions... > oorza...@gmail.c

Re: [PHP] Legal $_SESSION names

2009-05-23 Thread Ashley Sheridan
On Sat, 2009-05-23 at 14:25 +0100, Stuart wrote: > 2009/5/22 tedd : > > Hi gang: > > > > While we're discussing what's legal in css, here's a couple of things I've > > found about sessions. > > > > I found that starting a session with a number doesn't work. > > > > $myvar = $_SESSION['1myvar']; >

Re: [PHP] Legal $_SESSION names

2009-05-23 Thread Stuart
2009/5/22 tedd : > Hi gang: > > While we're discussing what's legal in css, here's a couple of things I've > found about sessions. > > I found that starting a session with a number doesn't work. > > $myvar = $_SESSION['1myvar']; This won't work because $1myvar is not a valid variable. I believe th

Re: [PHP] Re: -less layouts; Ideas welcome

2009-05-23 Thread Robert Cummings
On Thu, 2009-05-21 at 05:06 -0400, O. Lavell wrote: > Jim Lucas wrote: > > > Since this has been a topic of dicussion, I figured I would add my > > thoughts. > > > > I have been toying with the idea of doing a -less layouts > > involving tabular data, calendars, etc... > > Why? > > > Recent thr

[PHP] How to create an intermediary page between two pages

2009-05-23 Thread Moses
Hi Folks, I would like to know whether you can connect two pages via an intermediary page. For example if you have main.php, which is a form whose action is directed to function.php. Function.php process the information from main.php then displays the result. This can take roughly 6 seconds or mor

[PHP] Example PHP shared memory code

2009-05-23 Thread Richard W
Hi I was wondering if anyone has some sample code whereby the PHP script connects to and reads data from some shared memory in Linux, where the shared memory was originally created by a* linux thread (as opposed to some PHP script)*? The example code needs to use shmop_open(...). Thanks in advanc

Re: [PHP] fgets function for very large files

2009-05-23 Thread kranthi
i accept the fact that PMA is full of security holes, and it should not be used on production server. but it does not mean that we can never use it on a development server probably you may have a bit of trouble while moving from development server to production server. but u can always export y

Re: [PHP] fgets function for very large files

2009-05-23 Thread Ashley Sheridan
On Sat, 2009-05-23 at 02:59 -0400, Eddie Drapkin wrote: > On Sat, May 23, 2009 at 2:58 AM, Ashley Sheridan > wrote: > > > > > If it's a CSV, I'd recommend using phpMyAdmin directly to import it into > > the database, assuming you are using a MySQL database that is. It's > > using tried and tested

Re: [PHP] fgets function for very large files

2009-05-23 Thread Michael A. Peters
shahrzad khorrami wrote: one thing! I need four fields of 7 fields in each line, in my code from original csv file first four of fields choose(mappping these fields with columns of table in db) for example: a line in csv file: "a","b","c","d","e","f","g" in table of database 4 column : name,ex

Re: [PHP] fgets function for very large files

2009-05-23 Thread shahrzad khorrami
one thing! I need four fields of 7 fields in each line, in my code from original csv file first four of fields choose(mappping these fields with columns of table in db) for example: a line in csv file: "a","b","c","d","e","f","g" in table of database 4 column : name,ext,tel,date that 4 field of

Re: [PHP] fgets function for very large files

2009-05-23 Thread shahrzad khorrami
Thanks for repply :) It must be automatically, it means that there is a form that an operator browse a csv with large size(more than 2-3 GB) and in next step(page) first 1000 line insert into db then by clicking on next button, next 1000 line operator don't know any thing about phpmyadmin and

Re: [PHP] fgets function for very large files

2009-05-23 Thread Eddie Drapkin
On Sat, May 23, 2009 at 2:58 AM, Ashley Sheridan wrote: > > If it's a CSV, I'd recommend using phpMyAdmin directly to import it into > the database, assuming you are using a MySQL database that is. It's > using tried and tested code for large files like that. > > Tried and true to be what, exactly