[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

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

2009-03-24 Thread Tom Worster
On 3/23/09 2:02 PM, Tom Worster f...@thefsb.org 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

Re: [PHP] Problems with implode

2009-03-24 Thread Tom Worster
On 3/24/09 7:14 AM, Toke Herkild t...@ezl-data.dk 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

Re: [PHP] Problems with implode

2009-03-24 Thread Tom Worster
On 3/24/09 8:58 AM, Per Jessen p...@computer.org 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 p...@computer.org 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

Re: [PHP] Problems with implode

2009-03-25 Thread Tom Worster
On 3/24/09 9:25 AM, Andrea Giammarchi an_...@hotmail.com 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

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

2009-03-25 Thread Tom Worster
somewhere? On 3/25/09 6:32 AM, Nisse Engström news.nospam.0ixbt...@luden.se wrote: On Tue, 24 Mar 2009 08:15:35 -0400, Tom Worster wrote: On 3/23/09 2:02 PM, Tom Worster f...@thefsb.org wrote: i havea general replacement or workaround for every php function in my code that i know to be utf-8

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

2009-03-27 Thread Tom Worster
On 3/26/09 11:36 AM, Nisse Engström news.nospam.0ixbt...@luden.se 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 that it may be ok with two

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

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

2009-03-27 Thread Tom Worster
On 3/27/09 5:39 PM, Mary Anderson maryf...@demog.berkeley.edu 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

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

Re: [PHP] $_GET verses $_POST

2009-04-13 Thread Tom Worster
On 4/12/09 10:23 AM, Ron Piggott ron@actsministries.org 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

Re: [PHP] $_GET verses $_POST

2009-04-13 Thread Tom Worster
On 4/13/09 6:47 PM, Michael A. Peters mpet...@mac.com 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

Re: [PHP] utf-8 ?

2009-04-27 Thread Tom Worster
On 4/27/09 9:55 AM, PJ af.gour...@videotron.ca 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 aacute; type of stuff in inputs for searches queries.

Re: [PHP] Re: utf-8 ?

2009-04-27 Thread Tom Worster
On 4/27/09 11:17 AM, PJ af.gour...@videotron.ca 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

Re: [PHP] utf-8 ?

2009-04-27 Thread Tom Worster
On 4/27/09 4:25 PM, PJ af.gour...@videotron.ca 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

Re: [PHP] Re: utf-8 ?

2009-04-27 Thread Tom Worster
On 4/27/09 3:57 PM, 9el le...@phpxperts.net 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

Re: [PHP] utf-8 ?

2009-04-28 Thread Tom Worster
On 4/28/09 4:05 PM, Reese howel...@inkworkswell.com 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

Re: [PHP] utf-8 ?

2009-04-30 Thread Tom Worster
On 4/29/09 6:52 PM, Reese howel...@inkworkswell.com wrote: Tom Worster wrote: On 4/28/09 4:05 PM, Reese howel...@inkworkswell.com 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

[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

Re: [PHP] utf-8 ?

2009-04-30 Thread Tom Worster
On 4/30/09 6:15 PM, Reese howel...@inkworkswell.com 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 different file extensions

Re: [PHP] object literals

2009-05-02 Thread Tom Worster
On 5/2/09 6:45 AM, Robert Cummings rob...@interjinn.com 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

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

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 mpet...@mac.com 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 current installed php? I assume

Re: [PHP] elseif statements

2009-05-05 Thread Tom Worster
On 5/5/09 9:49 AM, tedd tedd.sperl...@gmail.com 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.

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

2009-05-05 Thread Tom Worster
On 5/5/09 1:41 PM, Bastien Koert phps...@gmail.com wrote: On Tue, May 5, 2009 at 1:20 PM, revDAVE c...@hosting4days.com 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

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

2009-05-05 Thread Tom Worster
On 5/5/09 2:07 PM, revDAVE c...@hosting4days.com 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

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 rscrawf...@mossroot.com wrote: On Tue, May 5, 2009 at 1:34 PM, PJ af.gour...@videotron.ca 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

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

2009-05-06 Thread Tom Worster
On 5/6/09 7:05 AM, Robert Cummings rob...@interjinn.com 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

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

2009-05-06 Thread Tom Worster
On 5/6/09 6:56 AM, Marcus Gnaß gona...@gmx.de 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 which might be the most proper way

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

2009-05-06 Thread Tom Worster
On 5/5/09 8:55 PM, Clancy clanc...@cybec.com.au 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 you can ... But PHP 5.3

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

2009-05-06 Thread Tom Worster
On 5/6/09 8:55 AM, Per Jessen p...@computer.org 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:

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

2009-05-07 Thread Tom Worster
On 5/6/09 9:31 PM, Clancy clanc...@cybec.com.au 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

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

2009-05-07 Thread Tom Worster
On 5/6/09 4:02 PM, Al n...@ridersite.org 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 phph...@comcast.net 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

Re: [PHP] Mail subject encoding breaks

2009-05-12 Thread Tom Worster
On 5/11/09 11:58 AM, Thodoris t...@kinetix.gr 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 κηδφκξγσ; Hi,

Re: [PHP] CSS tables

2009-05-15 Thread Tom Worster
On 5/15/09 1:25 PM, PJ af.gour...@videotron.ca 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

Re: [PHP] textarea new line to mysql database

2009-05-15 Thread Tom Worster
On 5/15/09 10:12 AM, Stuart stut...@gmail.com 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

[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 p...@computer.org 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. i could exec(tail $logfile, $lines

Re: [PHP] CSS tables

2009-05-17 Thread Tom Worster
On 5/15/09 6:28 PM, Nathan Rixham nrix...@gmail.com 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

Re: [PHP] CSS tables

2009-05-17 Thread Tom Worster
On 5/16/09 2:25 AM, Paul M Foster pa...@quillandmouse.com 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

Re: [PHP] Re: Parsing of forms

2009-05-20 Thread Tom Worster
On 5/20/09 6:50 AM, Ford, Mike m.f...@leedsmet.ac.uk 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

Re: [PHP] product listing columns

2009-05-21 Thread Tom Worster
On 5/21/09 3:05 AM, Ashley Sheridan a...@ashleysheridan.co.uk 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:

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

2009-05-21 Thread Tom Worster
On 5/21/09 5:06 AM, O. Lavell olav...@xs4all.nl 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 table-less layouts involving tabular data, calendars, etc... Why? it's a zen practice.

Re: [PHP] table-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 li...@cmsws.com wrote: Since this has been a topic of dicussion, I figured I would add my thoughts. I

Re: [PHP] templating engine options

2009-05-25 Thread Tom Worster
On 5/23/09 6:21 PM, Nathan Rixham nrix...@gmail.com 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

Re: [PHP] templating engine options

2009-05-25 Thread Tom Worster
On 5/25/09 10:04 AM, Stuart stut...@gmail.com wrote: Quick question, how would you implement the following using your XML-based template syntax... div class=option ?php if (!empty($option_class)) { echo $option_class; } ? ... /div It's worth noting that I'm simply suggesting a different

Re: [PHP] templating engine options

2009-05-26 Thread Tom Worster
On 5/25/09 8:48 PM, Nathan Rixham nrix...@gmail.com wrote: Sancar Saran wrote: ?php $content = 'No Comments'; if(isset($comments) and is_array($comments) and count($comments) 0 ) { $content = ''; foreach( $comments as $index = $comment ) : $content. = a href='.

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 nrix...@gmail.com wrote: XSL Templates are near perfect, built for the job, and very powerful - but time hasn't favoured them well;

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

[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
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 finishing up with the http client what

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

2009-05-27 Thread Tom Worster
ignore_user_abort(), then send Connection: close and Content-Length: #octets headers, then send the response followed by ob_flush and flush. can't say i'm in love with this. http://waynepan.com/2007/10/11/how-to-use-ignore_user_abort-to-do-process-ou t-of-band/ -Original Message- From: Tom Worster

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 phpm...@jawbone.freeserve.co.uk wrote: 2009/5/27 Tom Worster f...@thefsb.org: 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

Re: [PHP] Confirmation email caught by spam filter

2009-05-27 Thread Tom Worster
On 5/27/09 12:07 PM, LAMP l...@afan.net 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

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 a...@ashleysheridan.co.uk 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,

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 10:15 AM, Nitsan Bin-Nun nit...@binnun.co.il 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

Re: [PHP] PHP, OOP and AJAX

2009-05-28 Thread Tom Worster
On 5/28/09 7:31 AM, Julian Muscat Doublesin opensourc...@gmail.com 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

Re: [PHP] PHP vs ASP.NET

2009-05-28 Thread Tom Worster
On 5/28/09 9:20 AM, Olexandr Heneralov ohenera...@gmail.com 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:

Re: [PHP] Hebrew Directory Names

2009-05-28 Thread Tom Worster
On 5/28/09 1:19 PM, Tom Worster f...@thefsb.org 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 nit...@binnun.co.il wrote: i have tried this: ?php if (!defined('THROUGH_INDEX')) die('Sorry mate!'); $default_locale = setlocale(LC_ALL, 'en_US.UTF-8'); ini_set('default_charset', 'UTF-8' ); $_GET['folder'] =

Re: [PHP] detecting spam keywords with stripos

2009-05-29 Thread Tom Worster
On 5/29/09 5:36 AM, Merlin Morgenstern merli...@fastmail.fm 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

Re: [PHP] Hebrew Directory Names

2009-05-29 Thread Tom Worster
On 5/28/09 2:06 PM, Nitsan Bin-Nun nit...@binnun.co.il 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

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

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

Re: [PHP] php applications

2009-06-08 Thread Tom Worster
On 6/8/09 12:30 PM, Kyle Terry k...@kyleterry.com 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

Re: [PHP] php applications

2009-06-08 Thread Tom Worster
On 6/8/09 4:26 PM, Dee Ayy dee@gmail.com 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

[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 f...@thefsb.org 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 -- it needs

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

2009-06-13 Thread Tom Worster
character count. i don't know about other dbms. On Fri, Jun 12, 2009 at 11:50 AM, Tom Worster f...@thefsb.org 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

[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

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 br...@briandunning.com 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

[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 f...@thefsb.org 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 af.gour...@videotron.ca 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

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 rob...@interjinn.com wrote: Farah Fawcett has also died. I guess you gotta go sometime :| Björn Bartels wrote: Hello fellow

Re: [PHP] This Friday's OT Thread

2009-06-26 Thread Tom Worster
On 6/26/09 9:20 AM, Michelle Konzack linux4miche...@tamay-dogan.net 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

Re: [PHP] mysql_query blocking

2009-06-27 Thread Tom Worster
On 6/27/09 3:15 PM, Daniel Kolbo kolb0...@umn.edu 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

Re: [PHP] mysql_query blocking

2009-06-28 Thread Tom Worster
On 6/27/09 7:09 PM, Daniel Kolbo kolb0...@umn.edu wrote: Tom Worster wrote: On 6/27/09 3:15 PM, Daniel Kolbo kolb0...@umn.edu 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

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Tom Worster
On 6/30/09 11:17 AM, Ashley Sheridan a...@ashleysheridan.co.uk 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

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 mpet...@mac.com 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

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 j...@jeffweinberger.com 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 danbr...@php.net wrote: On Tue, Jul 7, 2009 at 11:03, Jeff Weinbergerj...@jeffweinberger.com 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

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 j...@jeffweinberger.com wrote: On Jul 7, 2009, at 8:38 AM, Daniel Brown wrote: On Tue, Jul 7, 2009 at 11:03, Jeff Weinbergerj...@jeffweinberger.com wrote: This seemed like it would be the perfect solution...but alas it did not work. 22527 seems right,

Re: [PHP] I have an idea

2009-07-15 Thread Tom Worster
On 7/15/09 12:21 AM, Martin Scotta martinsco...@gmail.com 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,

[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 ?php function foo($a) { $a = 42; unset($a); $a = 'meaning'; } foo($a); print($a\n); ? normally i would expect unset() to free some memory. but in this example it

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 nos...@mckenzies.net 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 ?php function foo($a) { $a = 42; unset($a); $a = 'meaning'; } foo

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 p...@computer.org 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 ted...@yahoo.com 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);

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

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Tom Worster
On 8/17/09 5:24 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Mon, 2009-08-17 at 02:17 -0700, nashrul wrote: This is a newbie question... Let's say there are 3 php files, page1.php, page2.php and page3.php. Form submission from page1.php or page2.php will take user to page3.php. I

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Tom Worster
On 8/17/09 5:17 AM, nashrul anas_a...@yahoo.com wrote: This is a newbie question... Let's say there are 3 php files, page1.php, page2.php and page3.php. Form submission from page1.php or page2.php will take user to page3.php. I know that we can use parameter that is appended in the action

Re: [PHP] Help on pregreplace

2009-08-18 Thread Tom Worster
On 8/18/09 10:56 AM, Merlin Morgenstern merli...@fastmail.fm wrote: Ashley Sheridan wrote: On Tue, 2009-08-18 at 16:00 +0200, Merlin Morgenstern wrote: Hi there, I am highlighting keywords with the help of pregreplace. This works great with one limitation. If the word that has to be

Re: [PHP] How to make sure that the target file to read is not under writing by others?

2009-08-19 Thread Tom Worster
On 8/19/09 3:55 AM, Dengxule dengx...@gmail.com wrote: I have a crontab command to execuate my php-script every half an hour. The mission of the php-script is to open a file(log file), examine it. The target file(log file) is transported to local every half an hour. I've no idea how

Re: [PHP] How to make sure that the target file to read is not under writing by others?

2009-08-20 Thread Tom Worster
On 8/19/09 9:56 PM, Clancy clanc...@cybec.com.au wrote: I gather from this discussion that PHP allows two users to open a file for R/W? I had assumed it wouldn't. i think php does allow this. but i'm not sure all file systems do. -- PHP General Mailing List (http://www.php.net/) To

  1   2   >