php-general Digest 16 Oct 2006 12:41:42 -0000 Issue 4404

2006-10-16 Thread php-general-digest-help
php-general Digest 16 Oct 2006 12:41:42 - Issue 4404 Topics (messages 243167 through 243181): Re: A no brainer... 243167 by: Tony Di Croce 243169 by: Ed Lazor Month in a numeric form 243168 by: Ron Piggott (PHP) 243170 by: Travis Doherty 243171 by: J

Re: [PHP] Re: Setting PHP to use SMTP

2006-10-16 Thread Dave M G
David, Thank you for your response. If you are on *nix and want to send mail via SMTP, you need something like http://phpmailer.sourceforge.net/ I have looked at phpmailer, but it's way over featured for what I want to accomplish. The tutorial they link to on their site, 11 pages long and

Re: [PHP] Re: Setting PHP to use SMTP

2006-10-16 Thread Chris
Dave M G wrote: David, Thank you for your response. If you are on *nix and want to send mail via SMTP, you need something like http://phpmailer.sourceforge.net/ I have looked at phpmailer, but it's way over featured for what I want to accomplish. The tutorial they link to on their site, 11

[PHP] connecting host.

2006-10-16 Thread Jo�o C�ndido de Souza Neto
I want to know if only i have connection problem with the server. I cant count how many timnes a dey i get the message cannot connect to host news.php.net. It happens to everyone ou just for me? Thanks. -- João Cândido de Souza Neto Curitiba Online [EMAIL PROTECTED] (41) 3324-2294 (41)

[PHP] mail() encoded subject line

2006-10-16 Thread Emil Edeholt
Hi, I hope this is not too off topic but I have a problem when I use mail(). When I add the header Content-Type: text/plain; charset=UTF-8 the body of the mail is encoded fine but the subject is not encoded. I've tried to utf8_encode() and utf8_decode() the subject text but neither helps.

Re: [PHP] Windows ENV['_'] equivalent

2006-10-16 Thread Jochem Maas
Richard Lynch wrote: So, I have this automated testing script I wrote, and I want to make it work on more than just my computer. In cygwin, and in Linux, EVN['_'] has the nice path to the binary CLI which is running -- which I call again in a backticks for each test script in turn, to

[PHP] Re: mail() encoded subject line

2006-10-16 Thread Colin Guthrie
Emil Edeholt wrote: Hi, I hope this is not too off topic but I have a problem when I use mail(). When I add the header Content-Type: text/plain; charset=UTF-8 the body of the mail is encoded fine but the subject is not encoded. I've tried to utf8_encode() and utf8_decode() the subject text

[PHP] Re: mail() encoded subject line

2006-10-16 Thread Manuel Lemos
Hello, on 10/16/2006 02:32 PM Emil Edeholt said the following: I hope this is not too off topic but I have a problem when I use mail(). When I add the header Content-Type: text/plain; charset=UTF-8 the body of the mail is encoded fine but the subject is not encoded. I've tried to

[PHP] Text from Excel csv file loaded into MySQL table

2006-10-16 Thread Alan Milnes
Can anyone point me to a really good end to end tutorial on extracting text from an Excel csv file and uploading it into MySQL via a PHP script? There are lots of bits and pieces on the Web and in the PHP manual but I haven't found a really comprehensive article yet. I have Welling and

RE: [PHP] Text from Excel csv file loaded into MySQL table

2006-10-16 Thread Chris Boget
Can anyone point me to a really good end to end tutorial on extracting text from an Excel csv file and uploading it into MySQL via a PHP script? Actually, depending on the integrity of the data and the consistency of the format in the CSV file, you can do this simply and easily using

RE: [PHP] Text from Excel csv file loaded into MySQL table

2006-10-16 Thread KermodeBear
Hello, Can anyone point me to a really good end to end tutorial on extracting text from an Excel csv file and uploading it into MySQL via a PHP script? Actually, depending on the integrity of the data and the consistency of the format in the CSV file, you can do this simply and

[PHP] mktime()'s is_dst deprecated, but needed?

2006-10-16 Thread Zora
Hi all, (first time I send an email here, so please be forgiving if something doesn't follow expected rules.) My web application allows users to enter time stamps (date and time) given as local times. The time stamp is to be stored as UTC into the data base. Since we have summer and

Re: [PHP] Text from Excel csv file loaded into MySQL table

2006-10-16 Thread Richard Lynch
On Mon, October 16, 2006 10:40 am, Alan Milnes wrote: Can anyone point me to a really good end to end tutorial on extracting text from an Excel csv file and uploading it into MySQL via a PHP script? There are lots of bits and pieces on the Web and in the PHP If the files are NOT clean enough

Re: [PHP] Solution: [PHP] OOP slow -- am I an idiot?

2006-10-16 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-15 13:59:39 -0700: As I cannot think of a class-based way to build my report, I think I'll use a customer class everywhere BUT in the report. Inside the report I'll just use one SQL statement instead of dozens of instances and hundreds of queries. I'll make a

Re: [PHP] Setting PHP to use SMTP

2006-10-16 Thread Richard Lynch
On Sun, October 15, 2006 10:25 pm, Dave M G wrote: In an effort to make emails that I send through PHP scripts not be mistaken for spam, it seems that one thing I need to do is make sure that the emails are sent via SMTP. I doubt that this is going to matter much... The emails ALL end up

Re: [PHP] Re: LAMP || Apache Cache PHP Source File...

2006-10-16 Thread Richard Lynch
Put it all in subversion and checkout on a regular basis? On Sun, October 15, 2006 11:14 am, sit1way wrote: Hey All. Like many intermediate (and higher) level programmers, I've written a LAMP based CMS application to develop sites for my clients. Until recently I had major version

Re: [PHP] Regular expressions

2006-10-16 Thread Richard Lynch
On Sat, October 14, 2006 4:19 pm, Morten Twellmann wrote: I'm trying to understand these regular expressions, but I can't make them work... All I want to do, is to find the first occurrence of some text inside the HTML tags h1 and /h1. Example string: pOctober 14, 2006/ph1Welcome to my

Re: [PHP] Retrieving values from array on a class

2006-10-16 Thread Richard Lynch
On Sat, October 14, 2006 5:18 pm, Kevin Waterson wrote: class returnConfigParams { var $a; function getMySQLParams() { include($_SERVER['DOCUMENT_ROOT']./properties.php); $values = array(0 = $a, 1 = $b, 2 = $c, 3 = $d); You probably want $this-a instead of $a And that also

Re: [PHP] Crossing over to the Darkside?

2006-10-16 Thread Richard Lynch
On Sat, October 14, 2006 7:52 am, Ross wrote: I am very suprised how easy things like user auhtentication and form validation is. Literally in minutes. Even though I have written a similar script many times for php there is always some tweeking or modifying required before it fits the

Re: [PHP] Class returning more than one value

2006-10-16 Thread Richard Lynch
On Sat, October 14, 2006 5:06 am, Deckard wrote: How can i code a class with a function that returns more than one value ? Classes do not return values. Functions return values. Class methods (which are very much like functions) return values. In PHP, functions/methods do not return more

[PHP] Help, please! UTF-8 encoding problem

2006-10-16 Thread dimon
Hi, I would like some help with an encoding problem, please. I would like to encode some text (a news entry entered via a form, to be exact) into UTF-8 and then save it in an XML file for persistent storage. My problem is, some of the users are Japanese and would like to enter Japanese multi-byte

Re: [PHP] PHP Denial of service

2006-10-16 Thread Richard Lynch
On Fri, October 13, 2006 4:16 pm, Ryan Barclay wrote: A simple question I imagine, but I am wondering how I would combat DoS attacks by users holding the REFRESH key on their browsers? I have reproduced this error on a PHP-MYSQL website and when I hold the REFRESH key on for a while, page

Re: [PHP] Re: Windows ENV['_'] equivalent

2006-10-16 Thread Richard Lynch
On Fri, October 13, 2006 5:47 pm, M.Sokolewicz wrote: you've considered the fact that you might be running php as a module via ie. apache, thus not using a php.exe at all? (you'd be using a php4ts.lib/php5ts.lib instead) It's a command line script having nothing to do with any other API. CLI

Re: [PHP] Windows ENV['_'] equivalent

2006-10-16 Thread Richard Lynch
On Fri, October 13, 2006 7:44 pm, Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-10-13 13:53:56 -0500: So, I have this automated testing script I wrote, and I want to make it work on more than just my computer. In cygwin, and in Linux, EVN['_'] has the nice path to the binary CLI which

Re: [PHP] Text from Excel csv file loaded into MySQL table

2006-10-16 Thread Alan Milnes
Chris Boget wrote: Can anyone point me to a really good end to end tutorial on extracting text from an Excel csv file and uploading it into MySQL via a PHP script? Actually, depending on the integrity of the data and the consistency of the format in the CSV file, you can do this

Re: [PHP] Windows ENV['_'] equivalent

2006-10-16 Thread Richard Lynch
On Fri, October 13, 2006 8:14 pm, Ed Lazor wrote: Not a solution, but an idea... the dos chdir comand. Maybe you can run it from within your script. It tells you the current working directory and you end up indirectly knowing the location of the php.exe that you're using. The test scripts

Re: [PHP] mail() encoded subject line

2006-10-16 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-16 14:32:12 +0200: I hope this is not too off topic but I have a problem when I use mail(). When I add the header Content-Type: text/plain; charset=UTF-8 the body of the mail is encoded fine but the subject is not encoded. I've tried to utf8_encode() and

Re: [PHP] Windows ENV['_'] equivalent

2006-10-16 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-16 14:28:41 -0500: On Fri, October 13, 2006 7:44 pm, Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2006-10-13 13:53:56 -0500: So, I have this automated testing script I wrote, and I want to make it work on more than just my computer. In cygwin, and in Linux,

Re: [PHP] A no brainer...

2006-10-16 Thread Ed Lazor
Almost ALL of this is moot for any but the hardest-hit sites -- So choosing your session store based solely on performance for a boutique store is just plain silly. You don't have to be one of the hardest-hit sites to benefit. I won't go so far as to say that all sites benefit, but even the

Re: [PHP] PHP Denial of service

2006-10-16 Thread Curt Zirzow
On 10/14/06, Ryan Barclay [EMAIL PROTECTED] wrote: It hasn't actually been attempted. However, if a couple of a users were to hold the refresh, the page generation times would go up ridiculously and clients would be waiting over 20sec for pages. As mentioned, it's a very heavy php-mysql script

Re: [PHP] Windows ENV['_'] equivalent

2006-10-16 Thread Richard Lynch
On Mon, October 16, 2006 9:04 am, Jochem Maas wrote: 2. try making use of the $_ENV['PHP_PEAR_PHP_BIN'] value which should be configured if pear is installed properly. (it's there in my local setup C:\Documents and Settings\rlynchC:\php5.1.1\php.exe -a Interactive mode enabled ?php echo

[PHP] Regular expressions

2006-10-16 Thread Chrome
*edit* sorry I didn't think and just hit reply on this instead of reply all... sorry Richard */edit* [snip] .*? is kinda silly -- .* mean 0 or more characters, and ? means maybe but putting them together has no added value, so lose the ? [/snip] I could be wrong (and under the considerable

Re: [PHP] Text from Excel csv file loaded into MySQL table

2006-10-16 Thread Richard Lynch
On Mon, October 16, 2006 11:01 am, Alan Milnes wrote: Chris Boget wrote: Can anyone point me to a really good end to end tutorial on extracting text from an Excel csv file and uploading it into MySQL via a PHP script? Actually, depending on the integrity of the data and the consistency of

Re: [PHP] Windows ENV['_'] equivalent

2006-10-16 Thread Richard Lynch
On Sat, October 14, 2006 4:09 am, Stut wrote: Richard: AFAIK there is no way to know this under windows without writing an extension to tell you. Sounds like you actually know how to do this... :-) Would such an extension be cross-platform to all PHP installs, or Windows-only? And is this

Re: [PHP] PHP Denial of service

2006-10-16 Thread Curt Zirzow
On 10/16/06, Richard Lynch [EMAIL PROTECTED] wrote: On Fri, October 13, 2006 4:16 pm, Ryan Barclay wrote: A simple question I imagine, but I am wondering how I would combat DoS attacks by users holding the REFRESH key on their browsers? I have reproduced this error on a PHP-MYSQL website and

Re: [PHP] A no brainer...

2006-10-16 Thread Richard Lynch
On Mon, October 16, 2006 2:44 pm, Ed Lazor wrote: Almost ALL of this is moot for any but the hardest-hit sites -- So choosing your session store based solely on performance for a boutique store is just plain silly. You don't have to be one of the hardest-hit sites to benefit. I won't go so

Re: [PHP] Regular expressions

2006-10-16 Thread Curt Zirzow
On 10/16/06, Chrome [EMAIL PROTECTED] wrote: *edit* sorry I didn't think and just hit reply on this instead of reply all... sorry Richard */edit* [snip] .*? is kinda silly -- .* mean 0 or more characters, and ? means maybe but putting them together has no added value, so lose the ? [/snip] I

[PHP] Dansie / ZenCart authorizenet Help

2006-10-16 Thread Richard Lynch
Trying to wrap up a PHP project, and am stumped by some not very PHP issues... I need some help with the following scenario: Dansie shopping cart (Perl) is in use, and must remain active until other stores can be re-coded. ZenCart is installed, and ready to roll, except... Setting in

Re: [PHP] Regular expressions

2006-10-16 Thread Richard Lynch
On Mon, October 16, 2006 2:54 pm, Chrome wrote: *edit* sorry I didn't think and just hit reply on this instead of reply all... sorry Richard */edit* [snip] .*? is kinda silly -- .* mean 0 or more characters, and ? means maybe but putting them together has no added value, so lose the ?

Re: [PHP] Windows ENV['_'] equivalent

2006-10-16 Thread Richard Lynch
On Mon, October 16, 2006 4:41 pm, Roman Neuhauser wrote: Just a thought: var_dump(ini_get('register_argc_argv')) ? I should have been more clear If/when there are any $args, then $argc/$argv are set: $ /cygdrive/c/php5.1.1/php.exe -q argv.php array(1) { [0]= string(8) argv.php }

RE: [PHP] Regular expressions

2006-10-16 Thread Chrome
[snip] ? means maybe in some other place in PCRE. Or maybe that's POSIX. Never have figured that one out. [/snip] ? directly after an expression is equivalent to {0,1} (maybe) but after a quantifier (*, +, {}) means ungreedy I'm sure I'll be corrected if I'm wrong :) Dan --

Re: [PHP] Regular expressions

2006-10-16 Thread Morten Twellmann
Great! It works! Thank you very much. Also thanks to all the other guys who answered. I also think I finally started to understand these regular expressions a bit better. - Morten - Original Message - From: Richard Lynch [EMAIL PROTECTED] To: Morten Twellmann [EMAIL PROTECTED] Cc:

Re: [PHP] Regular expressions

2006-10-16 Thread Curt Zirzow
On 10/16/06, Richard Lynch [EMAIL PROTECTED] wrote: On Mon, October 16, 2006 2:54 pm, Chrome wrote: *edit* sorry I didn't think and just hit reply on this instead of reply all... sorry Richard */edit* [snip] .*? is kinda silly -- .* mean 0 or more characters, and ? means maybe but

Re: [PHP] Regular expressions

2006-10-16 Thread Curt Zirzow
On 10/16/06, Chrome [EMAIL PROTECTED] wrote: [snip] ? means maybe in some other place in PCRE. Or maybe that's POSIX. Never have figured that one out. [/snip] ? directly after an expression is equivalent to {0,1} (maybe) but after a quantifier (*, +, {}) means ungreedy I kind of talked about

Re: [PHP] Retrieving values from array on a class

2006-10-16 Thread Stut
Richard Lynch wrote: But I don't think you can even *DO* an include() inside a class definition, so that should be giving you an error... You can do an include/require anywhere. However, you cannot declare new functions inside an include and use it to add methods or variables to a class.

RE: [PHP] Regular expressions

2006-10-16 Thread Chrome
On 10/16/06, Chrome [EMAIL PROTECTED] wrote: [snip] ? means maybe in some other place in PCRE. Or maybe that's POSIX. Never have figured that one out. [/snip] ? directly after an expression is equivalent to {0,1} (maybe) but after a quantifier (*, +, {}) means ungreedy I kind of talked

Re: [PHP] Windows ENV['_'] equivalent

2006-10-16 Thread Stut
Richard Lynch wrote: On Sat, October 14, 2006 4:09 am, Stut wrote: Richard: AFAIK there is no way to know this under windows without writing an extension to tell you. Sounds like you actually know how to do this... :-) Would such an extension be cross-platform to all PHP installs, or

Re: [PHP] A no brainer...

2006-10-16 Thread Ed Lazor
On Oct 16, 2006, at 1:03 PM, Richard Lynch wrote: My thesis is that choosing SOLELY on raw performance without regard to security, scalability is silly, and it's particularly silly on sites that get so little traffic that raw performance tests and benchmarks are rendered meaningless. I that

Re: [PHP] A no brainer...

2006-10-16 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-15 16:54:29 -0700: On Oct 15, 2006, at 3:27 PM, Tony Di Croce wrote: Wow... well, I was certainly not speaking from direct experience, only from what seemed to make sense to me. This tells me that their is some serious room for improvement in PHP

Re: [PHP] A no brainer...

2006-10-16 Thread Ed Lazor
On Oct 16, 2006, at 6:20 PM, Roman Neuhauser wrote: Modern filesystems cope well with large directories (plus it's quite trivial to derive a directory hierarchy from the filenames). Looking at the numbers produced by timing various operations in a directory with exactly

Re: [PHP] A no brainer...

2006-10-16 Thread Larry Garfield
On Monday 16 October 2006 14:11, Richard Lynch wrote: I suspect that serialization overhead is trivial for scalar data, and only starts to kill you when one starts schlepping bloated OOP structures or arrays back and forth -- at which point you messed up your architecture, and the