[PHP] trigger_error() when using php cli

2009-01-07 Thread Tom Worster
php is delivering error messages to STDERR when i call trigger_error() in the script. i'm using the command: php -c /usr/local/etc/php.ini -f script.php and the config file has log_errors and error_log set correctly afaict (it works for scripts run via apache). is this to be expected (and hence

[PHP] utf-8-safe replacement for strtr()?

2009-03-23 Thread Tom Worster
i havea general replacement or workaround for every php function in my code that i know to be utf-8-unsafe. except one: strtr(). the only ideas i have to implement strtr in php with known utf-8-safe php functions would be rather inefficient. any ideas, suggestions, pointers? or maybe you're bette

Re: [PHP] utf-8-safe replacement for strtr()?

2009-03-24 Thread Tom Worster
On 3/23/09 2:02 PM, "Tom Worster" wrote: > i havea general replacement or workaround for every php function in my code > that i know to be utf-8-unsafe. except one: strtr(). strtr() with three parameters is certainly unsafe. but my tests are showing that it may be ok with two p

Re: [PHP] Problems with implode

2009-03-24 Thread Tom Worster
On 3/24/09 7:14 AM, "Toke Herkild" wrote: > I've an array() with approx 1200 items (list of id-mappings) that part > works fine. > > Now I want to add this list to a query: > $where = "id in (".$idList.")"; > > To accomplish that i do an implode: > $idList = implode(',', $TidList); > > My prob

Re: [PHP] Problems with implode

2009-03-24 Thread Tom Worster
On 3/24/09 8:58 AM, "Per Jessen" wrote: > I can't reproduce that behaviour - I tried with ascii ('klop') and utf8 > ('Köhler') text. neither can i. if the mail systems don't screw it up, here's my test strings: $strs = array( 'Iñtërnâtiônàlizætiøn', 'החמאס: רוצים להשלים את

Re: [PHP] Problems with implode

2009-03-24 Thread Tom Worster
On 3/24/09 9:15 AM, "Per Jessen" wrote: > TG wrote: > >> I don't think that would be a problem, the size of the array. I've >> used implode at least once or twice on fairly large arrays. More >> likely is something weird with your data. > > Yeah, like the odd backspace or carriage return perh

Re: [PHP] Problems with implode

2009-03-25 Thread Tom Worster
On 3/24/09 9:25 AM, "Andrea Giammarchi" wrote: > > Dunno why you guys started talk about utf-8 problems, he has a list of ids > which should contain only unsigned integers, otherwise I do not get how that > query could work with an implode(',', $whatever) rather than 'id in > ("'.implode('","',

Re: [PHP] utf-8-safe replacement for strtr()?

2009-03-25 Thread Tom Worster
wiki somewhere? On 3/25/09 6:32 AM, "Nisse Engström" wrote: > On Tue, 24 Mar 2009 08:15:35 -0400, Tom Worster wrote: > >> On 3/23/09 2:02 PM, "Tom Worster" wrote: >> >>> i havea general replacement or workaround for every php function in my code &

Re: [PHP] utf-8-safe replacement for strtr()?

2009-03-27 Thread Tom Worster
On 3/26/09 11:36 AM, "Nisse Engström" wrote: > On Wed, 25 Mar 2009 11:32:42 +0100, Nisse Engström wrote: > >> On Tue, 24 Mar 2009 08:15:35 -0400, Tom Worster wrote: >> >>> strtr() with three parameters is certainly unsafe. but my tests are showing >>

[PHP] validating and sanitizing input string encoding

2009-03-27 Thread Tom Worster
the article at http://devlog.info/2008/08/24/php-and-unicode-utf-8, among other web pages, suggests checking for valid utf-8 string encoding using (strlen($str) && !preg_match('/^.{1}/us', $str)). however, another article, http://www.phpwact.org/php/i18n/charsets, says this cannot be trusted. i wor

Re: [PHP] SESSION values show up days later!

2009-03-27 Thread Tom Worster
On 3/27/09 5:39 PM, "Mary Anderson" wrote: > Hi all, > I use session variables to store values from one page to another on > my website. > Alas, sometimes, but not always, the values persist from one > invocation of the script to another! > Just how, exactly, do I make them go away wh

[PHP] use bundled pcre in php 5.2.9 w/ apache 2.2?

2009-04-13 Thread Tom Worster
upgrading to 5.2.9 on freebsd using the ports, the question was asked: Use BUNDLED_PCRE (Select if you use apache 2.0.x) - Y/N? i use apache 2.2.x so i'd guess the answer would be no. but i'm not sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n

Re: [PHP] $_GET verses $_POST

2009-04-13 Thread Tom Worster
On 4/12/09 10:23 AM, "Ron Piggott" wrote: > How do I know when to use $_GET verses $_POST? i use GET when i want the user to be able to email the link to someone, mention it on a blog or bookmark it and it will always yield the same page. i use POST if submitting the form causes any change in t

Re: [PHP] $_GET verses $_POST

2009-04-13 Thread Tom Worster
On 4/13/09 6:47 PM, "Michael A. Peters" wrote: > For me the biggest advantage of post is the URLs aren't ugly. > For cases where get with a variable in the URL is useful (IE > product=BluePhone) - I prefer to handle that via mod_rewrite. > > The requests get handled by generic.php and generic.ph

Re: [PHP] utf-8 ?

2009-04-27 Thread Tom Worster
On 4/27/09 9:55 AM, "PJ" wrote: > Since I have to use a number of Western languages that have those > annoying accents on many characters, I am already finding some > annoyances in my code results; like having to enter the á type of > stuff in inputs for searches & queries. the sooner you quit t

Re: [PHP] Re: utf-8 ?

2009-04-27 Thread Tom Worster
On 4/27/09 11:17 AM, "PJ" wrote: > phpMyAdmin: in the structure view of the db show Collation as > latin_swedish_ci ??? maybe a phpmyadmin feature? check it with the mysql client. when i did the conversion* it came out looking just right in phpmyadmin. *i followed instrunctions here: http://dev

Re: [PHP] utf-8 ?

2009-04-27 Thread Tom Worster
On 4/27/09 4:25 PM, "PJ" wrote: > Exactly what are the advantages of using utf-8? How will it solve my > problem? actually, i have no idea because i have no idea what problem you are trying to solve and i apologize for presumptuous. i presumed that you have a php app with a bunch of data in mysq

Re: [PHP] Re: utf-8 ?

2009-04-27 Thread Tom Worster
On 4/27/09 3:57 PM, "9el" wrote: > Hey Tom Also share your findings plz :) to deal with the formatting i put it on wordpress: http://thefsb.wordpress.com/2009/04/27/converting-phpmysqlapache-app-from-la tin-1-to-utf-8/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] utf-8 ?

2009-04-28 Thread Tom Worster
On 4/28/09 4:05 PM, "Reese" wrote: > Granted, this isn't a PHP question but I'm curious, how does UTF-8 solve > this display issue? if we're talking about web browsers, they are quite good at automatically choosing fonts that can display the unicode characters it finds in a page. -- PHP Gene

Re: [PHP] utf-8 ?

2009-04-30 Thread Tom Worster
On 4/29/09 6:52 PM, "Reese" wrote: > Tom Worster wrote: >> On 4/28/09 4:05 PM, "Reese" wrote: >> >>> Granted, this isn't a PHP question but I'm curious, how does UTF-8 solve >>> this display issue? >> >> if we'

[PHP] object literals

2009-04-30 Thread Tom Worster
is there a neat literal syntax for creating objects on the fly without defining a type? whenever i need to do it i do something like $x = (object) array('a'=>1, 'b'=>3, ...); which works but isn't very lovely. it's neater in, for example, javascript. -- PHP General Mailing List (http://w

Re: [PHP] utf-8 ?

2009-04-30 Thread Tom Worster
On 4/30/09 6:15 PM, "Reese" wrote: > Tom Worster wrote: > >> why use SGML character entity references in a utf-8 file or stream? can't >> you just put the character in the file? > > Because, I thought, HTML files were basically just text files with >

Re: [PHP] object literals

2009-05-01 Thread Tom Worster
On 5/1/09 4:54 AM, "Richard Heyes" wrote: > Hi, > >>    $x = (object) array('a'=>1, 'b'=>3, ...); >> >> which works but isn't very lovely. it's neater in, for example, javascript. > > Well, you could wrap it up in a function to make it a bit lovelier. Eg: > > $foo = createObject(array('key' =

Re: [PHP] object literals

2009-05-02 Thread Tom Worster
On 5/2/09 6:45 AM, "Robert Cummings" wrote: > It's not what I want, I'm not the original poster. as op, i think i'm going to stick with the cast. but it's been an interesting thread and i learned some useful things. > Regardless though, it > comes down to the preference of the developer. It ca

[PHP] compiling a test php from latest csv snapshot on os-x

2009-05-03 Thread Tom Worster
i've an outstanding verification to do for a php bug fix. can anyone point me at instructions for compiling the latest csv snapshot for testing on os-x without installing over my current installed php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/u

Re: [PHP] compiling a test php from latest csv snapshot on os-x

2009-05-04 Thread Tom Worster
On 5/4/09 2:52 AM, "Michael A. Peters" wrote: > Tom Worster wrote: >> i've an outstanding verification to do for a php bug fix. can anyone point >> me at instructions for compiling the latest csv snapshot for testing on os-x >> without installing over my curr

Re: [PHP] elseif statements

2009-05-05 Thread Tom Worster
On 5/5/09 9:49 AM, "tedd" wrote: > In my opinion, whenever your choices exceed two, use switch. ick! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] speaking of control structures...

2009-05-05 Thread Tom Worster
there's a control structure i wish php had: a simple block that you can break out of, e.g. block { if ( condition ) break; blah... blah... if ( another condition ) break; blah... blah... etc... } the block is just like a loop except that it is executed once only. this

Re: [PHP] Newbie - Setting Up Some Basic Sendmail Scripts

2009-05-05 Thread Tom Worster
On 5/5/09 1:41 PM, "Bastien Koert" wrote: > On Tue, May 5, 2009 at 1:20 PM, revDAVE wrote: > >> And got this code below going, but I'll bet I need a bit more - like adding >> authentication - smtp - port - sending user / pass etc. >> >> Any hints how to get this to the next level? >> > use p

Re: [PHP] Newbie - Setting Up Some Basic Sendmail Scripts

2009-05-05 Thread Tom Worster
On 5/5/09 2:07 PM, "revDAVE" wrote: > I'm working with php 5 so is the 1.2.0b1 (beta) safe to use or should I go > with the older stable 1.1.14? i don't know if the beta is safe but i always use the most recent stable release of whatever-it-may-be unless i have a compelling reason to use a beta

Re: [PHP] How to deal with identical fields in db

2009-05-05 Thread Tom Worster
On 5/5/09 4:42 PM, "Richard S. Crawford" wrote: > On Tue, May 5, 2009 at 1:34 PM, PJ wrote: >> I'm coming up with a bit of a quandry: how to enter and retrieve an >> identical book title with different authors. >> It is rather unbelievable what contortions one finds as authors :-( >> like editor

Re: [PHP] speaking of control structures...

2009-05-06 Thread Tom Worster
On 5/6/09 7:05 AM, "Robert Cummings" wrote: > That seems like an abuse of exceptions. But then we're already abusing > loops. I just don't think one could say it's the proper way to do it :) i don't have a lot of interest in "the proper way" to do things. i'm interested in how other programmers

Re: [PHP] speaking of control structures...

2009-05-06 Thread Tom Worster
On 5/6/09 6:56 AM, "Marcus Gnaß" wrote: > Tom Worster wrote: >> there's a control structure i wish php had: a simple block that you can >> break out of, e.g. > > As Maarten pointed out you could use a function. Another alternative is > to use Exceptions w

Re: [PHP] speaking of control structures...

2009-05-06 Thread Tom Worster
On 5/5/09 8:55 PM, "Clancy" wrote: > On Tue, 05 May 2009 14:13:23 -0400, rob...@interjinn.com (Robert Cummings) > wrote: > >> On Tue, 2009-05-05 at 13:56 -0400, Tom Worster wrote: >>> there's a control structure i wish php had: a simple block that yo

Re: [PHP] speaking of control structures...

2009-05-06 Thread Tom Worster
On 5/6/09 8:55 AM, "Per Jessen" wrote: > Shawn McKenzie already posted the right solution - did you miss it? no, per, i didn't. i like do {} while (0) very much. thanks, shawn! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] speaking of control structures...

2009-05-07 Thread Tom Worster
On 5/6/09 9:31 PM, "Clancy" wrote: > I can understand your reluctance to disregard your mother's advice, but > unfortunately she > had been brainwashed to accept the dogma of the day. actually, i don't believe so. she did numerical work so she continued using fortran and therefore gotos for the

Re: [PHP] Re: speaking of control structures...

2009-05-07 Thread Tom Worster
On 5/6/09 4:02 PM, "Al" wrote: > Here's the way I handle validating user form inputs. Each function validates > several things and throws an error with the message stating what's wrong. > > try > { > checkEmailAddr($userSubmitedDataArray[EMAIL_ADDR_FIELD]); >

Re: [PHP] Session data files

2009-05-08 Thread Tom Worster
On 5/8/09 11:09 AM, "phphelp -- kbk" wrote: > Just something I'm curious about: When I run PHP on my development > box (W2K), I just get one session file per connection which gets > deleted (usually) after the session expires. > > When I look at the session files on the client server (linux/apac

Re: [PHP] Mail subject encoding breaks

2009-05-12 Thread Tom Worster
On 5/11/09 11:58 AM, "Thodoris" wrote: > >> On 11 May 2009 at 18:25, Thodoris wrote: >> >> >>> Hi gang, >>> I am using phpmailer to send some mail notifications in an intranet >>> I've made. This is a sample code: >>> >> >> >>> $e->Subject = "This is δφκξγκδφη garbidge κηδφκξγσ"

Re: [PHP] Re: php & html integration

2009-05-14 Thread Tom Worster
On 5/14/09 2:52 PM, "Shawn McKenzie" wrote: > PJ wrote: >> I'm a bit fuzzy on the relationship between the and the HTML code. >> Where should the php code be placed in a page so that execution is >> carried out smoothly? So far, my coding has managed to avoid horrendous >> snags; but as I delve

Re: [PHP] CSS & tables

2009-05-15 Thread Tom Worster
On 5/15/09 1:25 PM, "PJ" wrote: > I know of no better place to ask. This may not be strictly a PHP issue, > but... > I am busting my hump trying to format rather large input pages with CSS > and trying to avoid tables; but it looks to me like I am wasting my time > as positioning with CSS seems a

Re: [PHP] textarea new line to mysql database

2009-05-15 Thread Tom Worster
On 5/15/09 10:12 AM, "Stuart" wrote: > What's your problem with using nl2br? it's not multibyte safe. if you're using mb strings, e.g. for utf8 pages and forms, then use preg_replace (with the u modifier) instead of ml2br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visi

[PHP] read the last line in a file?

2009-05-15 Thread Tom Worster
imagine writing a script to run as a daemon reading data off the bottom of a log file that gets updated every few minutes and processing each new log line as they arrive. i could exec("tail $logfile", $lines, $status) every now and then. or poll the file mtime and run exec("tail $logfile", $lines,

Re: [PHP] read the last line in a file?

2009-05-16 Thread Tom Worster
On 5/16/09 3:55 AM, "Per Jessen" wrote: > Tom Worster wrote: > >> imagine writing a script to run as a daemon reading data off the >> bottom of a log file that gets updated every few minutes and >> processing each new log line as they arrive. >> >>

Re: [PHP] CSS & tables

2009-05-17 Thread Tom Worster
On 5/15/09 6:28 PM, "Nathan Rixham" wrote: > so ultimately i guess it's a case of 3 cheers and a round of applause > for anybody who's thus far managed to create a website that works and > that the client likes! agreed. but lets hope some of the users like it too. i think of all the web sites t

Re: [PHP] CSS & tables

2009-05-17 Thread Tom Worster
On 5/16/09 2:25 AM, "Paul M Foster" wrote: > I liken this sort of discussion to the dichotomy between movie critics > and people who actually go and see movies. The critics inevitably have > all sorts of snobby things to say about the movies which are best > attended. I'm not sure why anyone list

Re: [PHP] Re: Parsing of forms

2009-05-20 Thread Tom Worster
On 5/20/09 6:50 AM, "Ford, Mike" wrote: > Humph! Yes, ok, I concede this point. I also bow to Daniele's need to > process forms designed by someone else with (not-PHP) in mind. Actually, > I can see the validity of both sides of the argument, and I teeter on > the fence as to whether the [] meth

Re: [PHP] product listing columns

2009-05-21 Thread Tom Worster
On 5/21/09 3:05 AM, "Ashley Sheridan" wrote: > I'm advocating tables on this one, as it is pretty much tabular data. i too would put a table of product data in an html table. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

2009-05-21 Thread Tom Worster
On 5/21/09 5:06 AM, "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? it's a zen practice. -- PHP

Re: [PHP] -less layouts; Ideas welcome

2009-05-21 Thread Tom Worster
this reminds me of the classic line in "Real Programmers Don't Use Pascal": "Besides, the determined Real Programmer can write Fortran programs in any language." On 5/21/09 4:02 AM, "Jim Lucas" wrote: > Since this has been a topic of dicussion, I figured I would add my thoughts. > > I have be

Re: [PHP] templating engine options

2009-05-25 Thread Tom Worster
On 5/23/09 6:21 PM, "Nathan Rixham" wrote: > Just a quick one, can anybody recommend any decent templating engines > other than smarty. i started using phplib template in 2002. since then i've never bothered to revisit that choice. it may not qualify as an engine (all it does is juggle files and

Re: [PHP] templating engine options

2009-05-25 Thread Tom Worster
On 5/25/09 10:04 AM, "Stuart" wrote: > Quick question, how would you implement the following using your > XML-based template syntax... > > ... > > It's worth noting that I'm simply suggesting a different way of > looking at the world. If you have a templating system you're happy > with then f

Re: [PHP] templating engine options

2009-05-26 Thread Tom Worster
On 5/25/09 8:48 PM, "Nathan Rixham" wrote: > Sancar Saran wrote: >> > $content = 'No Comments'; >> if(isset($comments) and is_array($comments) and count($comments) > 0 ) { >> $content = ''; >> foreach( $comments as $index => $comment ) : $content. = "".$comment->title.""; endforeach; >> } >> ?> >

Re: [PHP] templating engine options

2009-05-26 Thread Tom Worster
thanks for taking the trouble to write your requirements. it made interesting reading. i've questions on three points below... On 5/25/09 6:44 PM, "Nathan Rixham" wrote: > XSL Templates are near perfect, built for the job, and very powerful - > but time hasn't favoured them well; and until (if

Re: [PHP] db messed up

2009-05-26 Thread Tom Worster
On 5/26/09 4:11 PM, "Ashley Sheridan" wrote: > I can't find anything that will repair a whole database, only individual > tables. It's odd that you can't even connect to the database at all, :-/ isn't mysql_upgrade --force a script that effectively runs repair table on all your databases and tab

Re: [PHP] templating engine options

2009-05-26 Thread Tom Worster
thanks for the pointers on xsl. i'll take a look. On 5/26/09 6:05 PM, "Nathan Rixham" wrote: >> it seems you're saying that there would be some kind of an intermediate >> level of data representation that a script can be invoked to produce from >> which different templates can produce different

[PHP] continue working after finishing up with the http client

2009-05-27 Thread Tom Worster
what options are there to do the following: 1. receive request from client (including post data) 2. do some work, update the db, prepare output for client 3. send output and finish up with the client 4. do some more work that might take considerable time, updating the db some more it would be

Re: [PHP] continue working after finishing up with the http client

2009-05-27 Thread Tom Worster
at options are there for ending the http transition and then continuing on to do the cache update work? > -----Original Message- > From: Tom Worster [mailto:f...@thefsb.org] > Sent: Wednesday, May 27, 2009 6:27 AM > To: php-general@lists.php.net > Subject: [PHP] continue working after

Re: [PHP] continue working after finishing up with the http client

2009-05-27 Thread Tom Worster
process the cache entry. > > without getting into whether or not this cache design makes sense, my > question in this example is: what options are there for ending the http > transition and then continuing on to do the cache update work? > > >> -Original Message- >> From:

Re: [PHP] continue working after finishing up with the http client

2009-05-27 Thread Tom Worster
On 5/27/09 10:33 AM, "David Otton" wrote: > 2009/5/27 Tom Worster : > >> without getting into whether or not this cache design makes sense, my >> question in this example is: what options are there for ending the http >> transition and then continuing on to

Re: [PHP] Confirmation email caught by spam filter

2009-05-27 Thread Tom Worster
On 5/27/09 12:07 PM, "LAMP" wrote: > The problem is the confirmation emails and "reset password" emails are > very often caught by email filter and finish in Spam/Junk folder, or > even stopped by ISP. What am I doing wrong, or what to do to improve the > code? i've run into this. among many fa

Re: [PHP] Create multipart email

2009-05-28 Thread Tom Worster
guus, take a look at: http://pear.php.net/manual/en/package.mail.mail-mime.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Confirmation email caught by spam filter

2009-05-28 Thread Tom Worster
On 5/28/09 3:20 AM, "Ashley Sheridan" wrote: > Would setting up a backup MX record solve this do you think? this is what the spf record is for. http://en.wikipedia.org/wiki/Sender_Policy_Framework -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/u

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 10:15 AM, "Nitsan Bin-Nun" wrote: > I have wrote a files-based php system which not requires any kind of > database to work, it is based upon files and directories. > > I'm using scandir() to fetch the file names of a directory, when the files > and the directories are in English ever

Re: [PHP] PHP, OOP and AJAX

2009-05-28 Thread Tom Worster
On 5/28/09 7:31 AM, "Julian Muscat Doublesin" wrote: > I had been programming in ASP.NET for years using Object Oriented > Princeliness but decided to walk away from that. I am now researching and > specialising in the open source world. yay! > I have started to develop a project using MySQL,

Re: [PHP] PHP vs ASP.NET

2009-05-28 Thread Tom Worster
On 5/28/09 9:20 AM, "Olexandr Heneralov" wrote: > I have a question for everyone: > Can it happen so that PHP will be replaced with ASP.NET? why you pry it out of my cold dead hand ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 1:19 PM, "Tom Worster" wrote: > i suspect there will be serious dependency on os and file system. i was unable to do anything with hebrew file or dir names on freebsd 7.1 with ufs. i even tried scping and tarring over the directory that worked on os x. -- PHP General

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 2:06 PM, "Nitsan Bin-Nun" wrote: > i have tried this: > > > >> $default_locale = setlocale(LC_ALL, 'en_US.UTF-8'); >> ini_set('default_charset', 'UTF-8' ); >> >> >> $_GET['folder'] = >> preg_replace("/([\xE0-\xFA])/e","chr(215).chr(ord(\${1})-80)",$_GET['folder'] >> ); >> >> $dirn

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 3:21 PM, "Nitsan Bin-Nun" wrote: > That's the thing, I do NOT know the encoding of the GET parameters. in which case that preg_replace is _extremely_ risky. > They are not submitting any form, the request is made through a link ( > tag). if you have control over the pages that incl

Re: [PHP] detecting spam keywords with stripos

2009-05-29 Thread Tom Worster
On 5/29/09 5:36 AM, "Merlin Morgenstern" wrote: > Does somebody have an idea on how to make my function better in terms of > not detecting the string inside a word? i agree with per. learn pcre: http://us.php.net/manual/en/book.pcre.php as for successfully filtering spam by keyword matching: go

Re: [PHP] Hebrew Directory Names

2009-05-29 Thread Tom Worster
On 5/28/09 2:06 PM, "Nitsan Bin-Nun" wrote: > preg_replace("/([\xE0-\xFA])/e","chr(215).chr(ord(\${1})-80)",$s); ... > The preg_replace() above convert the Hebrew chars into UTF8. that preg_replace takes a byte string $s and: - leaves bytes with value 0-127 intact - converts bytes with value

Re: [PHP] Anyone know whats the best way to learn PHP

2009-06-01 Thread Tom Worster
On 6/1/09 6:43 AM, "Muhammad Hassan Samee" wrote: > Anyone know whats the best way to learn PHP? Every time I open an php book > or look the codes online, my mind goes "oh man, So many stuffs to learn and > gets frustrated before i even start" but on the other hand, I don't know why > some how th

Re: [PHP] Re: PHP vs ASP.NET

2009-06-01 Thread Tom Worster
assuming one had suitable hardware, what does it cost to start developing for asp? i guess you'd need to buy a copy of some windows server for dev test. what else? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Outputting File To The Browser Failed And Kill Apache

2009-06-05 Thread Tom Worster
if the problem is due to flow control issues between the script and the httpd server then perhaps changing the approach could help. i quit using this approach of writing files to the php output buffer a little while ago. it seemed that it was better to leave the flow control issues entirely to apa

Re: [PHP] php applications

2009-06-08 Thread Tom Worster
On 6/8/09 12:30 PM, "Kyle Terry" wrote: > I don't mean to be the thread spirit killer, but I think another language > would be better for this. Such as Python. > > PHP desktop apps might be fun to hack around with, but I wouldn't use it for > a production application. if there were a cocoa inte

Re: [PHP] php applications

2009-06-08 Thread Tom Worster
On 6/8/09 4:26 PM, "Dee Ayy" wrote: > Not as smooth as Xcode and Interface Builder eh? no -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] detect cli sapi

2009-06-10 Thread Tom Worster
what's a reliable way to detect that the sapi is cli, including in a included scripts? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] truncate a mb-string to a given octet length?

2009-06-12 Thread Tom Worster
say a table in the db has a varchar(255) column, 255 being the max number of octets of strings that can go in the column. now say the php script very occasionally has to deal with utf8 input strings with octet length > 255 -- it needs to select rows matching the input string or insert the input str

Re: [PHP] truncate a mb-string to a given octet length?

2009-06-12 Thread Tom Worster
27;t know about other dbms. > On Fri, Jun 12, 2009 at 11:50 AM, Tom Worster wrote: > say a table in the db has a varchar(255) column, 255 being the max number of >> octets of strings that can go in the column. now say the php script very >> occasionally has to deal with utf8 input st

[PHP] Re: truncate a mb-string to a given octet length?

2009-06-12 Thread Tom Worster
On 6/12/09 11:50 AM, "Tom Worster" wrote: > say a table in the db has a varchar(255) column, 255 being the max number of > octets of strings that can go in the column. now say the php script very > occasionally has to deal with utf8 input strings with octet length > 255 -

Re: [PHP] truncate a mb-string to a given octet length?

2009-06-13 Thread Tom Worster
the string, not the > decoded character count. i don't know about other dbms. > > >> On Fri, Jun 12, 2009 at 11:50 AM, Tom Worster wrote: >> say a table in the db has a varchar(255) column, 255 being the max number of >>> octets of strings that can go in the col

[PHP] inserting blobs into mysql

2009-06-17 Thread Tom Worster
i'm having trouble getting binary data into blobs in mysql. to help debug, i set up a test db and discovered that when i insert a binary string encoded using mysql_real_escape_string (according to the php manual: "If binary data is to be inserted, this function must be used."), only byte values lo

Re: [PHP] Totally weird behavior trying to download a Mac DMG file

2009-06-17 Thread Tom Worster
On 6/16/09 1:40 PM, "Brian Dunning" wrote: > However, when I complete a test purchase and download using the above > code, the DMG file downloads, but then it mounts; the contents are > copied into the Downloads folder; the image unmounts; and then > deletes. All the contents are delivered, but n

[PHP] Re: inserting blobs into mysql

2009-06-17 Thread Tom Worster
false alarm. the error was in my mysql abstraction class. some time ago i put a function in there to clean up invalid utf8 strings and it was doing a nice job on my binary strings. On 6/17/09 1:24 PM, "Tom Worster" wrote: > i'm having trouble getting binary data into blobs

Re: [PHP] Re: aesthetic beauty in conception, execution

2009-06-18 Thread Tom Worster
On 6/18/09 12:35 PM, "PJ" wrote: > Peter Ford wrote: >> PJ wrote: >> >>> I just thought I would share a revelation. >>> Someone just pointed me to a site that IMHO is superb for elegance of >>> artistic design and programming. >>> I was blown away. >>> http://www.apfq.ca >>> You won't regret i

Re: [PHP] This Friday's OT Thread

2009-06-26 Thread Tom Worster
and Kaleem Omar. and 15 people in Baghdad when motorcycle loaded with nails and ball-bearings exploded in a crowded bazaar. On 6/26/09 4:27 AM, "Robert Cummings" wrote: > Farah Fawcett has also died. I guess you gotta go sometime :| > > Björn Bartels wrote: >> Hello fellow coders... >> >> T

Re: [PHP] This Friday's OT Thread

2009-06-26 Thread Tom Worster
On 6/26/09 9:20 AM, "Michelle Konzack" wrote: > ...and no one care about the foreign (european) sniper WHO killed Neda > in Iran. i don't know why you'd think that. the story is all over the news. american pols have been exploiting it. cnn reports cia hay have been behind the shooting. --

Re: [PHP] mysql_query blocking

2009-06-27 Thread Tom Worster
On 6/27/09 3:15 PM, "Daniel Kolbo" wrote: > When a MySQL table is locked a php call of mysql_query() that requires > that table will hang as the request blocks at the MySQL server until the > table is unlocked. Is there a way to stop a mysql_query from hanging > (by setting a time limit)? would

Re: [PHP] mysql_query blocking

2009-06-28 Thread Tom Worster
On 6/27/09 7:09 PM, "Daniel Kolbo" wrote: > Tom Worster wrote: >> On 6/27/09 3:15 PM, "Daniel Kolbo" wrote: >> >>> When a MySQL table is locked a php call of mysql_query() that requires >>> that table will hang as the request blocks at

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Tom Worster
On 6/30/09 11:17 AM, "Ashley Sheridan" wrote: > It's a bad way of doing it, but could you not create a unique index on the > particular key you want to be unique, and then just try the select anyway > with the mysql_query() call preceeded with an @ to suppress warnings? if you're going that rout

Re: [PHP] Best way to reinstate radio-button states from database?

2009-06-30 Thread Tom Worster
On 6/29/09 10:26 PM, "Michael A. Peters" wrote: > Rob Gould wrote: >> I have a webpage which allows people to log in and make selections with >> radio buttons and hit SUBMIT and saves the data from those radio buttons >> to a mySQL database. >> >> However, I'm finding that I also need the abilit

Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Tom Worster
On 7/7/09 1:23 AM, "Jeff Weinberger" wrote: > On Jul 6, 2009, at 7:47 PM, Paul M Foster wrote: > >> On Mon, Jul 06, 2009 at 02:16:09PM -0700, Jeff Weinberger wrote: >> >>> Hi: >>> >>> I am hoping someone can help me figure this out >>> >>> I've just upgraded my PHP installation to 5.3.0.

Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Tom Worster
On 7/7/09 11:38 AM, "Daniel Brown" wrote: > On Tue, Jul 7, 2009 at 11:03, Jeff Weinberger wrote: >> >> This seemed like it would be the perfect solution...but alas it did not >> work. 22527 seems right, but after changing php.ini to that and restarting >> php and apache, I am still getting "Depr

Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Tom Worster
On 7/7/09 12:17 PM, "Jeff Weinberger" wrote: > On Jul 7, 2009, at 8:38 AM, Daniel Brown wrote: > >> On Tue, Jul 7, 2009 at 11:03, Jeff >> Weinberger wrote: >>> >>> This seemed like it would be the perfect solution...but alas it did >>> not >>> work. 22527 seems right, but after changing php.ini

Re: [PHP] I have an idea

2009-07-15 Thread Tom Worster
On 7/15/09 12:21 AM, "Martin Scotta" wrote: > Hi > > Do you noted that all the discussion here are about problems, bugs, or > just "urgent pleaaase help me" > I have an idea. It is not really THE idea... but it is. > What happen if tell this idea to the community? I don't know, so, > let's take

[PHP] unsetting a referenced parameter in a function

2009-07-22 Thread Tom Worster
though the manual is perfectly clear that this should be expected, i was a bit surprised that the result of the following is 42 normally i would expect unset() to free some memory. but in this example it doesn't and has a different behavior: it releases foo's reference to the global $a, allowing

Re: [PHP] Re: unsetting a referenced parameter in a function

2009-07-22 Thread Tom Worster
On 7/22/09 6:09 PM, "Shawn McKenzie" wrote: > Tom Worster wrote: >> though the manual is perfectly clear that this should be expected, i was a >> bit surprised that the result of the following is 42 >> >> > function foo(&$a) { >> $a = 42; &

Re: [PHP] Re: This is the kind of [expletives deleted] answer that is certain to prevent bugs being reported.

2009-07-25 Thread Tom Worster
On 7/25/09 6:27 AM, "Per Jessen" wrote: > Lupus Michaelis wrote: > >> Per Jessen wrote: >>> See http://bugs.php.net/?id=48612 >> >>I don't understand too the answer. For me it is obvious it is a bug >> because it breaks the system locale behaviour. >> > > Thanks, I'm glad I'm not alone in

Re: [PHP] curl_exec not hit server

2009-08-07 Thread Tom Worster
On 8/6/09 2:33 PM, "Ted Yu" wrote: > > Hi, > I use the following code to call third party web service: > curl_setopt($ch, CURLOPT_URL, $url); > curl_setopt($ch, CURLOPT_TIMEOUT, 120); > curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); > curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); > curl_setopt($ch,

[PHP] where does CURLOPT_QUOTE output go?

2009-08-13 Thread Tom Worster
just for example's sake, say i were doing something like $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'ftp://user:p...@server/dir/filename'); curl_setopt($ch, CURLOPT_UPLOAD, true); curl_setopt($ch, CURLOPT_FILE, $outfileh); curl_setopt($ch, CURLOPT_INFILE, $infileh); curl_setopt($ch, CURLOPT_

  1   2   >