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

2009-05-23 Thread oorza2k5
short hack, assuming your eval echo's out to the browser (which I can't see how else you'd expect something to 'return' from an eval'd statement ob_start(); eval($foo); $result = ob_get_clean(); On May 23, 2009 1:46am, Afan Pasalic a...@afan.net wrote: hi, I have on one website boxes with

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

2009-05-23 Thread Afan Pasalic
short hack works like a charm! :-) thanks! afan oorza...@gmail.com wrote: short hack, assuming your eval echo's out to the browser (which I can't see how else you'd expect something to 'return' from an eval'd statement ob_start(); eval($foo); $result = ob_get_clean(); On May 23, 2009

[PHP] fgets function for very large files

2009-05-23 Thread shahrzad khorrami
hi all, I have a csv file with more than 100,000 lines. I want to insert each line as a record in a database. but for the reason of very number of lines, I put a button with caption Next, when we click on it, 1000 line will insert into db and then again click next button and insert next 1000

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 csv file must

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,ext,tel,date

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 a...@ashleysheridan.co.ukwrote: 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

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

[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

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

2009-05-23 Thread Stuart
2009/5/23 Afan Pasalic a...@afan.net: 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...

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

2009-05-23 Thread Stuart
Oops, didn't mean to hit send... 2009/5/23 Stuart stut...@gmail.com: 2009/5/23 Afan Pasalic a...@afan.net: 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

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

Re: [PHP] Re: table-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 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 a...@afan.net: 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

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

2009-05-23 Thread Stuart
2009/5/23 Robert Cummings rob...@interjinn.com: On Sat, 2009-05-23 at 14:43 +0100, Stuart wrote: 2009/5/23 Afan Pasalic a...@afan.net: 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

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 rob...@interjinn.com: On Sat, 2009-05-23 at 14:43 +0100, Stuart wrote: 2009/5/23 Afan Pasalic a...@afan.net: short hack works like a charm! :-) It may work but output buffers are relatively expensive. The

Re: [PHP] Legal $_SESSION names

2009-05-23 Thread tedd
At 2:25 PM +0100 5/23/09, Stuart wrote: 2009/5/22 tedd t...@sperling.com: 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

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

2009-05-23 Thread Stuart
2009/5/23 Robert Cummings rob...@interjinn.com: On Sat, 2009-05-23 at 15:11 +0100, Stuart wrote: 2009/5/23 Robert Cummings rob...@interjinn.com: On Sat, 2009-05-23 at 14:43 +0100, Stuart wrote: 2009/5/23 Afan Pasalic a...@afan.net: short hack works like a charm! :-) It may work but

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 tedd.sperl...@gmail.com 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

Re: [PHP] Re: table-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: table type=layout Then everyone layout table out there would have been valid by the simple

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 rob...@interjinn.com: 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...

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 --

[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=nekajprice=fddfid=deid=ta ... into id=deid=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

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] Re: Forms validation and creation- easier solution?

2009-05-23 Thread Tony Marston
Daniele Grillenzoni dani...@b2informatica.it 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

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

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

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

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

2009-05-23 Thread LinuxManMikeC
On Fri, May 22, 2009 at 2:50 PM, Nathan Rixham nrix...@gmail.com 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 Nathan Rixham
LinuxManMikeC wrote: On Fri, May 22, 2009 at 2:50 PM, Nathan Rixham nrix...@gmail.com 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

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 af.gour...@videotron.ca wrote: Benjamin Hawkes-Lewis wrote: On 22/5/09 20:31, PJ

[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

Re: [PHP] templating engine options

2009-05-23 Thread LinuxManMikeC
On Sat, May 23, 2009 at 4:21 PM, Nathan Rixham nrix...@gmail.com 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 then I'd

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

Re: [PHP] Re: table-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