[PHP] _SERVER["HTTP_ACCEPT_LANGUAGE"] en-us

2006-10-16 Thread John Taylor-Johnston
This is what http_accept_language gives me depending on which browser. Depending on the visitor in my region, it will either be French or English. _SERVER["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.8,fr;q=0.5,fr-ca;q=0.3 _SERVER["HTTP_ACCEPT_LANGUAGE"] fr-ca,en-us;q=0.5 Is this a reasonable approa

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 serializ

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 100,000

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 d

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

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 >

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

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"

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

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 -- http://chrome.m

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" } C:\

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

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

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]

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

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 websit

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 so

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

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

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\rlynch>C:\php5.1.1\php.exe -a Interactive mode enabled Notice:

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 scrip

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

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 utf

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 script

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 simply

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

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

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

Re: [PHP] A no brainer...

2006-10-16 Thread Richard Lynch
On Sat, October 14, 2006 5:57 pm, Ed Lazor wrote: > > On Oct 14, 2006, at 10:00 AM, Tony Di Croce wrote: > >> I think that the cost of de-serializing a session stored in files >> should be significantly LESS than the cost of doing so through a >> database, for the following reasons: >> >> 1) The db

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

2006-10-16 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-16 12:47:47 -0500: > On Sat, October 14, 2006 5:18 pm, Kevin Waterson wrote: > >>>class returnConfigParams > >>> { > >>> > >>> var $a; > > >>> function getMySQLParams() > >>> { > >>>include($_SERVER['DOCUMENT_ROOT']."/properties.php"); > >>> > >>>$values =

[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] 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 th

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 pr

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

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

2006-10-16 Thread Richard Lynch
On Sat, October 14, 2006 9:55 am, AR wrote: > $params_file = New returnConfigParams; > $params_file->getMySQLParams(); > print($params_file[0]); > > but doesn't work :( > > Help me please. > > I'm stuck on this for two hours and didn't find nothing on Google that > could help me. There's nothing w

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 and . > > Example string: "October 14, 2006Welcome to my > h

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

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 ma

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 enoug

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

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

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

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

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

[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

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] 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. An

[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) 9985

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

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 fu