Re: [PHP] Sessions in object oriented code

2008-10-31 Thread Yeti
> I can't really understand that. Not sure if you understand my problem > properly (if I've not explained properly). Anyone can give me some solutions > please? Well as long as you don not provide any code it's all just wild guesses. What I tried was to show you a way of simply preventing the HTML

[PHP] Re: DOCTYPE, javascript and Firefox

2008-10-31 Thread Ross McKay
On Thu, 30 Oct 2008 15:45:55 +0200, Arno Kuhl wrote: >[...] >This code works fine in IE, Opera and Chrome, but gives a javascript error >in FF when I click the radio button: "autostartlabel is not defined". >However if I comment out the DOCTYPE line in the header it works fine in all >browsers inc

Re: [PHP] Mailing lists

2008-10-31 Thread Richard Heyes
> It depends on what english your are using, isn't it ? Well I suppose there's real English, and then American English. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated October 25th) -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] Mailing lists

2008-10-31 Thread Richard Heyes
> Hmmpff.. I'll try and remember... there's a large divide between my desk > and the rest of reality. You could say about a lot of peoples desks... :-) -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated October 25th) -- PHP General Mailing List (h

RE: [PHP] DOCTYPE, javascript and Firefox

2008-10-31 Thread Arno Kuhl
-Original Message- From: Andrew Ballard [mailto:[EMAIL PROTECTED] Sent: 30 October 2008 05:15 PM To: [EMAIL PROTECTED] Cc: PHP - General Subject: Re: [PHP] DOCTYPE, javascript and Firefox The pragmatic approach says that you've already fixed it: just leave the DOCTYPE out. :-) I'm not su

Re: [PHP] VAT number validation

2008-10-31 Thread Stut
On 31 Oct 2008, at 10:47, Koenraad Vanden Daele wrote: Ther is a VAT number validation API. http://isvat.appspot.com/ How to use this; integrate it in PHP to validate VAT-numbers without the user experiencing anything? Did you even have a go? Did you look at the PHP manual for clues as to

Re: [PHP] Invalid byte sequence for encoding UTF-8

2008-10-31 Thread paragasu
i do not use any function other that addslashes on the $_POST On 10/30/08, Lester Caine <[EMAIL PROTECTED]> wrote: > paragasu wrote: >> i am using php with postgresql. when i submit post query to the >> server. i have the pg_exec error >> >> Warning: pg_query() [function.pg-query]: Query failed:

Re: [PHP] Mailing lists

2008-10-31 Thread Richard Heyes
> we wouldn't have had to improve > it! ;-P Improuve? Thaut's nout whaut Iu'd caull iut... -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated October 25th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.ne

[PHP] VAT number validation

2008-10-31 Thread Koenraad Vanden Daele
Ther is a VAT number validation API. http://isvat.appspot.com/ How to use this; integrate it in PHP to validate VAT-numbers without the user experiencing anything? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Reg Ex

2008-10-31 Thread Kyle Terry
I'm horrible with regular expression. I need to match the text before a file extension. So if the file is called US.123.kyle.20081029.zip, I would then need to match US.123.kyle.20081029. Thanks! -- Kyle Terry | www.kyleterry.com

Re: [PHP] Reg Ex

2008-10-31 Thread Stut
On 31 Oct 2008, at 12:27, Kyle Terry wrote: I'm horrible with regular expression. I need to match the text before a file extension. So if the file is called US.123.kyle.20081029.zip, I would then need to match US.123.kyle.20081029. No regex required. Why do people think everything like this

Re: [PHP] Reg Ex

2008-10-31 Thread Kyle Terry
I thought of a couple other ways anyway... basename($file, '.zip') substr($file, 0, -4) On Fri, Oct 31, 2008 at 5:33 AM, Stut <[EMAIL PROTECTED]> wrote: > On 31 Oct 2008, at 12:27, Kyle Terry wrote: > >> I'm horrible with regular expression. I need to match the text before a >> file >> extension

Re: [PHP] Reg Ex

2008-10-31 Thread Eric Butera
On Fri, Oct 31, 2008 at 8:41 AM, Kyle Terry <[EMAIL PROTECTED]> wrote: > I thought of a couple other ways anyway... > > basename($file, '.zip') > substr($file, 0, -4) > > On Fri, Oct 31, 2008 at 5:33 AM, Stut <[EMAIL PROTECTED]> wrote: > >> On 31 Oct 2008, at 12:27, Kyle Terry wrote: >> >>> I'm hor

Re: [PHP] Reg Ex

2008-10-31 Thread Warren Windvogel
Eric Butera wrote: Who says every file will have an extension? Who says they're all .+3 chars? When I first started php I tried that and it failed in a lot of places. I've also run into that problem in the past. The way that I could work around all these issues was to document naming convent

Re: [PHP] Reg Ex

2008-10-31 Thread Eric Butera
On Fri, Oct 31, 2008 at 9:09 AM, Warren Windvogel <[EMAIL PROTECTED]> wrote: > Eric Butera wrote: >> >> Who says every file will have an extension? Who says they're all .+3 >> chars? When I first started php I tried that and it failed in a lot >> of places. > > I've also run into that problem in

Re: [PHP] Reg Ex

2008-10-31 Thread Daniel P. Brown
On Fri, Oct 31, 2008 at 7:44 AM, Eric Butera <[EMAIL PROTECTED]> wrote: > > Who says every file will have an extension? Who says they're all .+3 > chars? When I first started php I tried that and it failed in a lot > of places. .htaccess is a prime example of this. -- http://www.parasane.

Re: [PHP] Mailing lists

2008-10-31 Thread Daniel P. Brown
On Fri, Oct 31, 2008 at 4:06 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > Improuve? Thaut's nout whaut Iu'd caull iut... And while we're on the subject, who gave that Canadian the right to say anything about OUR English down here? We drop the 'U', but they replace it with another 'O' in s

Re: [PHP] Reg Ex

2008-10-31 Thread Jochem Maas
Eric Butera schreef: > On Fri, Oct 31, 2008 at 9:09 AM, Warren Windvogel > <[EMAIL PROTECTED]> wrote: >> Eric Butera wrote: >>> Who says every file will have an extension? Who says they're all .+3 >>> chars? When I first started php I tried that and it failed in a lot >>> of places. >> I've also

Re: [PHP] Mailing lists

2008-10-31 Thread Dan Joseph
On Fri, Oct 31, 2008 at 10:02 AM, Daniel P. Brown <[EMAIL PROTECTED] > wrote: > On Fri, Oct 31, 2008 at 4:06 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > > > Improuve? Thaut's nout whaut Iu'd caull iut... > > And while we're on the subject, who gave that Canadian the right > to say anythin

Re: [PHP] Reg Ex

2008-10-31 Thread Eric Butera
On Fri, Oct 31, 2008 at 10:03 AM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Eric Butera schreef: >> On Fri, Oct 31, 2008 at 9:09 AM, Warren Windvogel >> <[EMAIL PROTECTED]> wrote: >>> Eric Butera wrote: Who says every file will have an extension? Who says they're all .+3 chars? When I fi

RE: [PHP] Reg Ex

2008-10-31 Thread Boyd, Todd M.
> -Original Message- > From: Kyle Terry [mailto:[EMAIL PROTECTED] > Sent: Friday, October 31, 2008 7:28 AM > To: PHP General Mailing List > Subject: [PHP] Reg Ex > > I'm horrible with regular expression. I need to match the text before a > file > extension. So if the file is called US.123.

Re: [PHP] Reg Ex

2008-10-31 Thread Kyle Terry
Thanks for the reply. For now I used substr($filename,0,-4) and that worked perfectly. I need to learn reg ex badly :(. On Fri, Oct 31, 2008 at 7:51 AM, Boyd, Todd M. <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: Kyle Terry [mailto:[EMAIL PROTECTED] > > Sent: Friday, October

Re: [PHP] Reg Ex

2008-10-31 Thread Daniel P. Brown
On Fri, Oct 31, 2008 at 9:53 AM, Kyle Terry <[EMAIL PROTECTED]> wrote: > Thanks for the reply. For now I used substr($filename,0,-4) and that worked > perfectly. I need to learn reg ex badly :(. Before you do that, learn to read and follow along in an email thread that you start. We gave you

[PHP] Yahoo/Gmail/Hotmail Contacts API

2008-10-31 Thread Feris
Hi All, I noticed that social networking sites can retrieve our contacts using an authenticated session. Is there any open source PHP API to achieve the same thing ? Thanks, Feris

[PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Alice Wei
Hi, I have a code snippet here as follows: $message="1|2|3|4|5"; $stringChunks = explode("|", $message); Is it possible to find out the number of elements in this string? It seems that I could do things like print_r and find out what is the last element of $stringChunks is, but is th

Fwd: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Kyle Terry
-- Forwarded message -- From: Kyle Terry <[EMAIL PROTECTED]> Date: Fri, Oct 31, 2008 at 9:31 AM Subject: Re: [PHP] Count the Number of Elements Using Explode To: Alice Wei <[EMAIL PROTECTED]> I would use http://us2.php.net/manual/en/function.array-count-values.php On Fri, Oct 31

Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Daniel Brown
On Fri, Oct 31, 2008 at 11:29 AM, Alice Wei <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a code snippet here as follows: > > $message="1|2|3|4|5"; > $stringChunks = explode("|", $message); > > Is it possible to find out the number of elements in this string? It seems > that I could do things

Re: [PHP] Mailing lists

2008-10-31 Thread Robert Cummings
On Fri, 2008-10-31 at 09:02 -0500, Daniel P. Brown wrote: > On Fri, Oct 31, 2008 at 4:06 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > > > Improuve? Thaut's nout whaut Iu'd caull iut... > > And while we're on the subject, who gave that Canadian the right > to say anything about OUR English

Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Diogo Neves
Hi Alice, U can simple do: $nr = ( strlen( $message ) / 2 ) + 1 ); $nr = count( explode( '|', $message ); On Fri, Oct 31, 2008 at 4:32 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Fri, Oct 31, 2008 at 11:29 AM, Alice Wei <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have a code snippet h

Re: [PHP] Yahoo/Gmail/Hotmail Contacts API

2008-10-31 Thread Nitsan Bin-Nun
I would suggest trying Manuel's website (phpclasses). HTH, Nitsan On Fri, Oct 31, 2008 at 6:25 PM, Feris <[EMAIL PROTECTED]> wrote: > Hi All, > I noticed that social networking sites can retrieve our contacts using an > authenticated session. Is there any open source PHP API to achieve the same

Re: [PHP] Reg Ex

2008-10-31 Thread Diogo Neves
Hi all, It depends on what he really want, but pathinfo really is a better option My test worked perfectly on files with no extension and without name... On Fri, Oct 31, 2008 at 2:57 PM, Daniel P. Brown <[EMAIL PROTECTED]>wrote: > On Fri, Oct 31, 2008 at 9:53 AM, Kyle Terry <[EMAIL PROTECTED]

RE: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Alice Wei
Hi, Thanks for all who responded, and the function is now working properly. It turned out that count function works for strings that contain the actual data inside, but when it is an empty string, a new if clause had to be set to create the count. Alice Alice Wei Indiana University,

Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Matthew Powell
Diogo Neves wrote: Hi Alice, U can simple do: $nr = ( strlen( $message ) / 2 ) + 1 ); $nr = count( explode( '|', $message ); Or... $num = (substr_count($message, "|") + 1); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sessions in object oriented code

2008-10-31 Thread Diogo Neves
Well, without code is dificult to say, but session_start() don't send headers, then possible u have a space after a "?>" or @ least this is the common error... On Thu, Oct 30, 2008 at 11:47 PM, Ben Stones <[EMAIL PROTECTED]>wrote: > Hi, > > Hope I can explain this as easily as possible, basically

Re: Fwd: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Maciek Sokolewicz
Kyle Terry wrote: -- Forwarded message -- From: Kyle Terry <[EMAIL PROTECTED]> Date: Fri, Oct 31, 2008 at 9:31 AM Subject: Re: [PHP] Count the Number of Elements Using Explode To: Alice Wei <[EMAIL PROTECTED]> I would use http://us2.php.net/manual/en/function.array-count-values.

Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Stut
On 31 Oct 2008, at 17:32, Maciek Sokolewicz wrote: Kyle Terry wrote: -- Forwarded message -- From: Kyle Terry <[EMAIL PROTECTED]> Date: Fri, Oct 31, 2008 at 9:31 AM Subject: Re: [PHP] Count the Number of Elements Using Explode To: Alice Wei <[EMAIL PROTECTED]> I would use http://

Re: [PHP] Re: PreReq Index

2008-10-31 Thread Jochem Maas
Craige Leeder schreef: > I forgot to mention, the calls to setPreReq() would occur in each file > in place of an include() to get prerequisite components. IE: try autoload()ing. what your trying to do is reinvent a wheel ... and chances are yours will be less round. > > html.php : > Ember::setPr

Re: [PHP] Recursive Directory Listing

2008-10-31 Thread Joe Schaeffer
Thanks, all, for pointing me to the SPL iterators. i've been hunting around and i've managed to come up with a working script. I know it could be better, though. I know this is terribly inefficient -- a lot of manual repetition and no recursion. Here's what I've got, commenting my concerns: '; fore

[PHP] Change tracking

2008-10-31 Thread Mike Smith
I'm about to try this, but I'd like some suggestions. I have a inventory table that an employee can update specific fields if they are incorrect, e.g. [INVENTORY_TABLE] fieldsexample data part 1027P serial543221-K qty 120 location G-5 I'd like to record what changed. Let's say

Re: [PHP] Change tracking

2008-10-31 Thread Stephen
-- On Fri, 10/31/08, Mike Smith <[EMAIL PROTECTED]> wrote: > [INVENTORY_TABLE] > fieldsexample data > part 1027P > serial543221-K > qty 120 > location G-5 > > I'd like to record what changed. Let's say they > change the serial. One way > would be a "static" changes table: Ano

Re: [PHP] Change tracking

2008-10-31 Thread Sam Stelfox
I've always used a version field (just an incrementing id) rather than an effective date field. I can see the benefits of being able to look back and see when the changes were made and if done correctly make it so things don't change until a certain date. Hmmm nifty. Stephen wrote: > -- On Fri, 10

Re: [PHP] Change tracking

2008-10-31 Thread Mike Smith
Thanks Steven/Tony for your replies. I'll consider this a bit more before I jump in. I appreciate different perspectives. And I'll have to digest Tony's solution. Thanks, Mike Smith

[PHP] Re: Change tracking

2008-10-31 Thread Tony Marston
Your proposed solution is far too inflexible. Take a look at http://www.tonymarston.net/php-mysql/auditlog.html which describes a design with incorporates a fixed set of audit tables which can deal with logging changes to any number of application tables with any structure. -- Tony Marston htt

Re: [PHP] Re: PreReq Index

2008-10-31 Thread Craige Leeder
No can do. The files are stored in separate directories based on their usage/type. They're not all just in one directory. Regards, - Craige Jochem Maas wrote: try autoload()ing. what your trying to do is reinvent a wheel ... and chances are yours will be less round. -- PHP General Maili

Re: [PHP] Reg Ex

2008-10-31 Thread Warren Windvogel
Eric Butera wrote: ...or you could just use pathinfo and be done with it. I work for clients. Clients shouldn't have to read a faq to upload a file. I agree. I assumed that pathinfo simply returned the relative or absolute path of the file. After further inspection I have to stand corrected

Re: [PHP] Mailing lists

2008-10-31 Thread Shawn McKenzie
Robert Cummings wrote: > On Fri, 2008-10-31 at 09:02 -0500, Daniel P. Brown wrote: >> On Fri, Oct 31, 2008 at 4:06 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: >>> Improuve? Thaut's nout whaut Iu'd caull iut... >> And while we're on the subject, who gave that Canadian the right >> to say anythi

Re: [PHP] Recursive Directory Listing

2008-10-31 Thread Jim Lucas
Joe Schaeffer wrote: > Thanks, all, for pointing me to the SPL iterators. i've been hunting > around and i've managed to come up with a working script. I know it > could be better, though. I know this is terribly inefficient -- a lot > of manual repetition and no recursion. Here's what I've got, >

Fwd: [PHP] Bitwise operation giving wrong results

2008-10-31 Thread sean greenslade
-- Forwarded message -- From: sean greenslade <[EMAIL PROTECTED]> Date: Fri, Oct 31, 2008 at 11:22 PM Subject: Re: [PHP] Bitwise operation giving wrong results To: Yeti <[EMAIL PROTECTED]> Cool, thanks. It worked. I didn't know you typeset PHP like that. On Thu, Oct 30, 2008 at