From phillip.powell at adnet-sys.com Sat May 1 16:38:11 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Sat, 01 May 2004 16:38:11 -0400 Subject: [nycphp-talk] Problem with $_SESSION, PHP 4.3.2, register_globals off, class methods Message-ID: <40940AB3.6090507@adnet-sys.com> Very first lines of index.php: [PHP] session_start(); // USED FOR ANY STORED SESSION VARIABLES (ONLY HAS TO BE SET HERE) echo "PHPSESSID = $PHPSESSID

"; echo "SESSION the moment you first enter this script of $PHP_SELF is: "; print_r(array_keys($_SESSION)); echo'

'; [/PHP] This is what you see the moment you first go into index.php and have not yet submitted a search query: [QUOTE] PHPSESSID = a964d0d6683757cafbe5576737ea5bf9 SESSION the moment you first enter this script of /image_catalog/index.php is: Array ( [0] => search [1] => sql ) [/QUOTE] Ok, now you submitted a search query. You entered some form stuff and submitted. You're now at the search results page (which is also "index.php"); this is what you see: [QUOTE] PHPSESSID = a964d0d6683757cafbe5576737ea5bf9 SESSION the moment you first enter this script of /image_catalog/index.php is: Array ( [0] => search [1] => sql ) GET: Array ( ) POST: Array ( [0] => image_name [1] => allAlbums [2] => album [3] => boolword [4] => keywords [5] => persons [6] => events [7] => image_alt [8] => image_creation_start_month [9] => image_creation_start_day [10] => image_creation_start_year [11] => image_creation_end_month [12] => image_creation_end_day [13] => image_creation_end_year [14] => image_location_city [15] => image_location_state [16] => image_location_country [17] => sortBy [18] => search [19] => isFromSearch [20] => section ) SESSION: Array ( [0] => search [1] => sql ) PHPSESSID = a964d0d6683757cafbe5576737ea5bf9 SESSION after setting it is: Array ( [0] => search [1] => sql [2] => hidden ) [/QUOTE] (note: to save space and sensitive info I am not doing: [PHP]print_r($_POST);[/PHP] but instead I'm using [PHP]print_r(array_keys($_POST));[/PHP], and the same with $_GET) $_SESSION['sql'] is set via an instance of SearchPerformer object that runs the generateSearchSQL() method: [PHP] class SearchPerformer extends DBActionPerformer { function SearchPerformer () { // CONSTRUCTOR $this->doSearch(); // THIS METHOD RUNS generateSearchSQL() } function &displayResults() { // STATIC HTML STRING METHOD $html = SearchView::retainFormElements($html); // SEE BELOW FOR CODE DETAIL // DO MORE STUFF TO $html return $html; } function generateSearchSQL() { // SQL STRING METHOD // BUILD $sql HERE WITH STUFF $_SESSION['sql'] = $sql; // DO MORE STUFF return $sql; } } $performer =& new SearchPerformer(); // CONSTRUCTOR [/PHP] So everything is fine so far; I have $_SESSION['sql'] and I even have $_SESSION['hidden'] which is set via the displayResults() method in the SearchPerformer object, it running this class method (class SearchView is *NOT* instantiated here!!!): [PHP] class SearchView extends View { function SearchView() {} // CONSTRUCTOR (you will be instantiating SearchView objects elsewhere, just not in SearchPerformer's methods) function &retainFormElements(&$html) { // STATIC HTML METHOD print_r("

GET: "); print_r(array_keys($_GET)); print_r("

POST: "); print_r(array_keys($_POST)); print_r("

SESSION: "); print_r(array_keys($_SESSION)); print_r("

"); if ((!is_array($_POST) || @sizeof(array_values($_POST)) == 0) && $_SESSION['hidden']) { $html .= $_SESSION['hidden']; } else { /*-------------------------------------------------------------------------------------------------------------------- Set $collection to either $_POST (if form post variables exist in $_POST) or default to $_GET to parse through either/or and produce HTML hidden elements in either case ---------------------------------------------------------------------------------------------------------------------*/ $collection = ($_POST && is_array($_POST) && @sizeof(array_values($_POST)) > 0) ? $_POST : $_GET; foreach ($collection as $key => $val) { if (!is_array($val)) { $hiddenHTMLRetainer .= "\n"; $html .= "\n"; // ADD FROM QS TO PASS BACK } else { foreach ($val as $innerKey => $indivVal) { if ($indivVal) { $hiddenHTMLRetainer .= "\n"; // PUT IN INDIVIDUAL ARRAY ELEMENTS $hiddenHTMLRetainer .= "]\" value=\"$indivVal\">\n"; } } } } $_SESSION['hidden'] = $hiddenHTMLRetainer; global $PHPSESSID; print_r("PHPSESSID = "); print_r($PHPSESSID); print_r("

"); print_r('SESSION after setting it is: '); print_r(array_keys($_SESSION)); } return $html; } } [/PHP] Now, in the search results page I click a link to sort my results. The link takes me back to, you guessed it, index.php (in fact, every single portion of my application literally has only one address: "index.php" and nowhere else). The moment I do that, this is what I see: [QUOTE] PHPSESSID = a964d0d6683757cafbe5576737ea5bf9 SESSION the moment you first enter this script of /mu-spin/image_catalog/index.php is: Array ( [0] => search [1] => sql ) GET: Array ( [0] => section [1] => search [2] => isSort [3] => sortBy ) POST: Array ( ) SESSION: Array ( [0] => search [1] => sql ) PHPSESSID = a964d0d6683757cafbe5576737ea5bf9 SESSION after setting it is: Array ( [0] => search [1] => sql [2] => hidden ) [/QUOTE] This is totally wrong!!! The $_SESSION['hidden'] variable is gone!!! It is, in fact, erroneously RESET once again (with the wrong values), whereas it was supposed to have been retained within $_SESSION superglobal array, yet it is not. I hope this makes it a bit more clear as to what is literally going on. Synopsis: 1) I go to index.php 2) I see $_SESSION 3) I submit form elements 4) I see $_SESSION 5) I add $_SESSION['sql'] in generateSearchSQL() method 6) I add $_SESSION['hidden'] in SearchView::retainFormElements() method 7) I see $_SESSION with both elements 8) I click a link to go back to index.php 9) I see $_SESSION.. with just 'sql' and NOT 'hidden' 10) I tear my hair out, what little I have left! Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From cwf at axlotl.net Sat May 1 18:50:33 2004 From: cwf at axlotl.net (chris) Date: Sat, 1 May 2004 18:50:33 -0400 Subject: [nycphp-talk] confused by classes Message-ID: <200405011850.34004.cwf@axlotl.net> The first program I wrote a couple months ago was (of course) an email program and now I feel it's time to try to learn the OOP aspects, so I thought I'd rewrite that program. After a few days, I've become utterly confused. I've been trying to figure out which question to ask; this one seems to capture several of the issues confusing me. Each user can have several mail servers, and it seemed useful to start once a user logged into a session by constructing an object containing server addresses and passwords, and then maybe add in methods as needed. So I made this class (stripped down): class mailUser{ ? ? ? ? var $user; function mailUser ($user){ ? ? $dsn = 'mysql://username:pass at localhost/db'; ? ? $dbh = DB::connect($dsn); ? ? $user = $dbh->quote($user); ? ? $this->user = $dbh->getAssoc("SELECT server, m_user, m_pass, pop, smtp, u.name ? ? ? ? FROM servers s, users u, server_pass sp ? ? ? ? WHERE sp.user_id = u.id ? ? ? ? AND sp.server_id = s.id ? ? ? ? AND u.username LIKE $user"); ? ? } } And then when a user is logged in (returns $user ) I go: $cur_user = new mailUser($user); This gives me an object with an array of servers, each of those having an array of parameters. But I guess what I really need, maybe, is a class that returns $this->server with a few methods (seperate queries?) to extract the parameters specific to the currently active server? I'm trying that now, but it's maybe my twelfth scheme, and it'd be nice once it fails to pan out to check this list to see if anyone has some pointers. So, I realize it's a rather broad query; anyone in a pedagogical frame of mind today? Ending my lurking ways, Chris From jonbaer at jonbaer.net Sat May 1 21:17:05 2004 From: jonbaer at jonbaer.net (jon baer) Date: Sat, 1 May 2004 21:17:05 -0400 Subject: [nycphp-talk] [ot] open source "Security" is amazing to watch ... Message-ID: <004e01c42fe3$40cffa30$6500a8c0@thinkpad> if you are on bugtraq or other "security" related lists, its amazing how fast things go from discovery to exposure to exploit code to viruses in literally hours ... http://www.microsoft.com/security/incident/sasser.asp what in the world can the point be to post virus code when you *know* it will always be used for bad purposes in the end? - jon pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 From Rafi.Sheikh at Ingenix.com Sun May 2 21:17:25 2004 From: Rafi.Sheikh at Ingenix.com (Rafi Sheikh) Date: Sun, 2 May 2004 20:17:25 -0500 Subject: [nycphp-talk] RE: [tcphp] Hella fun project I'm about to throw at some tech col lege students Message-ID: Hi List. A quick question. I have some categories that are really long and I would like to re-word or re-format them when I am bring data in from a DB. Now which would be better: Do it with PHP or Do it with MySQL Any suggestions as to how to? Example: A column name: Customer --> VARCHAR Values in Customer: "USA-North Upper ABVDFR Co. and Sons" I would like to re-word it for example: ABVDFR Co. I know I could use SUBSTRING or MID, or replace but the issue is since the column is a VARCHAR, the length of the value may change from row to row, for example: one row it maybe 20, in the next 13 and so on so forth. I also thought that if I could use a length statement and come up with a formula...but so far no success....any suggestions? Thx in Adv. RS This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. From danielc at analysisandsolutions.com Sun May 2 23:10:49 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Sun, 2 May 2004 23:10:49 -0400 Subject: [nycphp-talk] confused by classes In-Reply-To: <200405011850.34004.cwf@axlotl.net> References: <200405011850.34004.cwf@axlotl.net> Message-ID: <20040503031049.GA22394@panix.com> On Sat, May 01, 2004 at 06:50:33PM -0400, chris wrote: First, your coding style needs improvement. See http://pear.php.net/manual/en/standards.php > class mailUser{ > ? ? ? ? var $user; > function mailUser ($user){ > ? ? $dsn = 'mysql://username:pass at localhost/db'; > ? ? $dbh = DB::connect($dsn); Assign the return by reference in order to conserve memory, etc: ? ? $dbh =& DB::connect($dsn); > ? ? $user = $dbh->quote($user); quote() is deprecated. Use quoteSmart(). > ? ? $this->user = $dbh->getAssoc("SELECT server, m_user, m_pass, pop, smtp, ... snip ... So, there can be multiple rows of data returned for a given user? If it's only one row, use getRow(). >? ? ? ? AND u.username LIKE $user"); Don't you mean "= $user" rather than "LIKE $user"? > And then when a user is logged in (returns $user ) I go: > $cur_user = new mailUser($user); Again, do that with "=&" to assign by reference instead of assigning a copy. > This gives me an object with an array of servers, each of those having an > array of parameters. But I guess what I really need, maybe, is a class that > returns > $this->server > with a few methods (seperate queries?) to extract the parameters specific to > the currently active server? It's not clear what you're looking for here. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From shiflett at php.net Mon May 3 02:37:21 2004 From: shiflett at php.net (Chris Shiflett) Date: Sun, 2 May 2004 23:37:21 -0700 (PDT) Subject: [nycphp-talk] [ot] open source "Security" is amazing to watch ... In-Reply-To: <004e01c42fe3$40cffa30$6500a8c0@thinkpad> Message-ID: <20040503063721.47469.qmail@web14311.mail.yahoo.com> --- jon baer wrote: > what in the world can the point be to post virus code when you > *know* it will always be used for bad purposes in the end? While posting a virus definitely seems to cross an ethical boundary of some sort, I think an exploit is an essential piece of a security vulnerability announcement. It really helps developers to both clearly understand the vulnerability and gauge the danger. However, this is frequently debated. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From yury at heavenspa.com Mon May 3 09:44:06 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Mon, 3 May 2004 09:44:06 -0400 Subject: [nycphp-talk] dynamic jump menu from flatfile References: <40926961.90608@ceruleansky.com> <20040430150050.GA27073@panix.com> Message-ID: <00a401c43114$b4551bc0$0400a8c0@heavenspanyc> Hiya folks.. was juts sitting here wondering if there was a way to make a jump menu that got its info from a flat file. This way you can just drop the jump menu into your web pages and have 1 file ( text/php/include) which changes the jump menu details accross the whole website.. any ideas? and is this even possible. regards yury From danielc at analysisandsolutions.com Mon May 3 10:00:21 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 3 May 2004 10:00:21 -0400 Subject: [nycphp-talk] dynamic jump menu from flatfile In-Reply-To: <00a401c43114$b4551bc0$0400a8c0@heavenspanyc> References: <40926961.90608@ceruleansky.com> <20040430150050.GA27073@panix.com> <00a401c43114$b4551bc0$0400a8c0@heavenspanyc> Message-ID: <20040503140020.GA22575@panix.com> Hola: On Mon, May 03, 2004 at 09:44:06AM -0400, yury at heavenspa.com wrote: > Hiya folks.. was juts sitting here wondering if there was a way to make a > jump menu that got its info from a flat file. I use an array contained in a separate for navigation items on some sites. The array's key is the name of the file and the value is the text to appear in the hyperlink. Later, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From yury at heavenspa.com Mon May 3 10:09:36 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Mon, 3 May 2004 10:09:36 -0400 Subject: [nycphp-talk] dynamic jump menu from flatfile References: <40926961.90608@ceruleansky.com> <20040430150050.GA27073@panix.com><00a401c43114$b4551bc0$0400a8c0@heavenspanyc> <20040503140020.GA22575@panix.com> Message-ID: <00d101c43118$445df180$0400a8c0@heavenspanyc> Dan, can you please reply with a simple/easy to follow example thanks yury ----- Original Message ----- From: "Daniel Convissor" To: "NYPHP Talk" Sent: Monday, May 03, 2004 10:00 AM Subject: Re: [nycphp-talk] dynamic jump menu from flatfile > Hola: > > On Mon, May 03, 2004 at 09:44:06AM -0400, yury at heavenspa.com wrote: > > Hiya folks.. was juts sitting here wondering if there was a way to make a > > jump menu that got its info from a flat file. > > I use an array contained in a separate for navigation items on some sites. > The array's key is the name of the file and the value is the text to > appear in the hyperlink. > > Later, > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From danielk at us.ibm.com Mon May 3 10:13:49 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Mon, 3 May 2004 10:13:49 -0400 Subject: [nycphp-talk] dynamic jump menu from flatfile In-Reply-To: <00a401c43114$b4551bc0$0400a8c0@heavenspanyc> Message-ID: >Hiya folks.. was juts sitting here wondering if there was a way to make a >jump menu that got its info from a flat file. Certainly is possible, try something like this... '; foreach ($lines as $line) { $items = explode('|', $line); $html .= sprintf(''); } echo ($html . ''); } The JavaScript function in the select tag is: /** * Jumps to the selected item in the dropdown list . */ function go (dropdown) { location.href = dropdown.options[dropdown.selectedIndex].value; } Daniel Krook, Application Developer WW Web Production Services North 2, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Personal: http://info.krook.org/ Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 From danielc at analysisandsolutions.com Mon May 3 10:17:12 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 3 May 2004 10:17:12 -0400 Subject: [nycphp-talk] dynamic jump menu from flatfile In-Reply-To: <00d101c43118$445df180$0400a8c0@heavenspanyc> References: <40926961.90608@ceruleansky.com> <20040503140020.GA22575@panix.com> <00d101c43118$445df180$0400a8c0@heavenspanyc> Message-ID: <20040503141712.GA23559@panix.com> Yuri: On Mon, May 03, 2004 at 10:09:36AM -0400, yury at heavenspa.com wrote: > Dan, can you please reply with a simple/easy to follow example > thanks See http://nyphp.org/content/presentations/bikesummer/navigation.php and the frame after it as well. The example doesn't show the foreach loop used to extract the data from the array and print out the stuff, but here's a summary: foreach ($Nav1 as $Page => $Title) { echo '' . $Title . "\n"; } --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From danielk at us.ibm.com Mon May 3 10:18:38 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Mon, 3 May 2004 10:18:38 -0400 Subject: [nycphp-talk] dynamic jump menu from flatfile In-Reply-To: Message-ID: Sorry, Monday morning. My example should have looked like this: '; foreach ($lines as $line) { $items = explode('|', $line); $html .= sprintf('', $items[0], $items[1]); } echo ($html . ''); } Daniel Krook, Application Developer WW Web Production Services North 2, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Personal: http://info.krook.org/ Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 From danielc at analysisandsolutions.com Mon May 3 10:18:54 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 3 May 2004 10:18:54 -0400 Subject: [nycphp-talk] dynamic jump menu from flatfile In-Reply-To: References: <00a401c43114$b4551bc0$0400a8c0@heavenspanyc> Message-ID: <20040503141854.GB23559@panix.com> Folks: On Mon, May 03, 2004 at 10:13:49AM -0400, Daniel Krook wrote: > > function drawNav () { ... snip ... > $html = ''; Of course, don't forget to embed that in a

element for those who have JavaScript turned off. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From yury at heavenspa.com Mon May 3 10:46:15 2004 From: yury at heavenspa.com (yury at heavenspa.com) Date: Mon, 3 May 2004 10:46:15 -0400 Subject: [nycphp-talk] dynamic jump menu from flatfile References: <00a401c43114$b4551bc0$0400a8c0@heavenspanyc> <20040503141854.GB23559@panix.com> Message-ID: <010701c4311d$63392ac0$0400a8c0@heavenspanyc> Thanks Dan C & Dan K :) ciao yury ----- Original Message ----- From: "Daniel Convissor" To: "NYPHP Talk" Sent: Monday, May 03, 2004 10:18 AM Subject: Re: [nycphp-talk] dynamic jump menu from flatfile > Folks: > > On Mon, May 03, 2004 at 10:13:49AM -0400, Daniel Krook wrote: > > > > function drawNav () { > ... snip ... > > $html = ''; > > Of course, don't forget to embed that in a element for those who > have JavaScript turned off. > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From tgales at tgaconnect.com Mon May 3 13:45:12 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 3 May 2004 13:45:12 -0400 Subject: [nycphp-talk] PHP Training at New York PHP Message-ID: <000201c43136$62f22d50$e98d3818@oberon1> I am looking for low cost (but effective) venues to advertise upcoming PHP training sessions at New York on a continuing basis. Incidentally, the next training is scheduled for May 17-18 (you can see the course outline at: http://nyphp.org/content/training/twodaycourse.php ) Please contact me off list at: tim.gales at nyphp.org with any ideas. Thanks in advance, Tim Gales From jayeshsh at ceruleansky.com Mon May 3 14:30:48 2004 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Mon, 03 May 2004 14:30:48 -0400 Subject: [nycphp-talk] regexp for URLs (is this correct?) Message-ID: <40968FD8.6090109@ceruleansky.com> Hello all, I came up with this Perl-style regular expression to validate URLs. For example, if I want to match "http://www.google.com" then I would test it against the following pattern: #^([a-z]{3,}://)(([0-9a-z-]+\.)+[0-9a-z]{2,4})$#i maybe I want to do something like this though: #^([a-z]{3,5}://)(([0-9a-z-]+\.)+[0-9a-z]{2,4})$#i so that http://www.google.com and ftp://ftp.mozilla.org and https://www.amazon.com are matched but httpsabc://www.somewhere.com is not matched. I primarily want to validate http:// links, though. Another thought: I want to be flexible and allow the user to enter something like: www.google.com Should I first try to match against: #^([a-z]{3,5}://)(([0-9a-z-]+\.)+[0-9a-z]{2,4})$#i and then, if that fails against: #^(([0-9a-z-]+\.)+[0-9a-z]{2,4})$#i I also realize that something like http://www.google.com/ will not be matched. Any suggestions or corrections? Thanks in advance! Best Regards, - Jay From james at surgam.net Mon May 3 14:45:53 2004 From: james at surgam.net (James B. Wetterau Jr.) Date: Mon, 03 May 2004 14:45:53 -0400 Subject: Subject: Re: [nycphp-talk] regexp for URLs (is this correct?) Message-ID: <40969361.3020502@surgam.net> Jayesh Sheth says: > Hello all, > > I came up with this Perl-style regular expression to validate URLs. ... > Any suggestions or corrections? ... A Perl expert of some repute did the hard work of reading all the relevant protocol specs, BNF notation, etc., and came up with this valid URL parsing regexp. Anything shorter is likely to miss some special case. This is an article about how to do this: http://www.foad.org/~abigail/Perl/url2.html (Note that there were some judgement calls involved in interpretation of some of the edge cases.) This is the URL for the actual regexp: http://www.foad.org/~abigail/Perl/url3.regex This is the regexp (note that it is broken up into many lines but actually needs to be one long line; note also that it does not support https): (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+) ){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F \d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ 2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ 2}))|[;:@&=])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(? :%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a- fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|- )*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(? :\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+! *'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'() ,]|(?:%[a-fA-F\d]{2}))|[?:@&=])*))*)(?:;type=[AIDaid])?)?)|(?:news:(?: (?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;/?:&=])+@(?:(?:( ?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[ a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3})))|(?:[a-zA-Z]( ?:[a-zA-Z\d]|[_.+-])*)|\*))|(?:nntp://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[ a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d ])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?)/(?:[a-zA-Z](?:[a-zA-Z \d]|[_.+-])*)(?:/(?:\d+))?)|(?:telnet://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+ !*'(),]|(?:%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'() ,]|(?:%[a-fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a -zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d] )?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))/?)|(?:gopher://(?:(?: (?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?: (?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+ ))?)(?:/(?:[a-zA-Z\d$\-_.+!*'(),;/?:@&=]|(?:%[a-fA-F\d]{2}))(?:(?:(?:[ a-zA-Z\d$\-_.+!*'(),;/?:@&=]|(?:%[a-fA-F\d]{2}))*)(?:%09(?:(?:(?:[a-zA -Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@&=])*)(?:%09(?:(?:[a-zA-Z\d$ \-_.+!*'(),;/?:@&=]|(?:%[a-fA-F\d]{2}))*))?)?)?)?)|(?:wais://(?:(?:(?: (?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?: [a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))? )/(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)(?:(?:/(?:(?:[a-zA -Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)/(?:(?:[a-zA-Z\d$\-_.+!*'(),]|( ?:%[a-fA-F\d]{2}))*))|\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d] {2}))|[;:@&=])*))?)|(?:mailto:(?:(?:[a-zA-Z\d$\-_.+!*'(),;/?:@&=]|(?:% [a-fA-F\d]{2}))+))|(?:file://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d] |-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?: (?:\d+)(?:\.(?:\d+)){3}))|localhost)?/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'() ,]|(?:%[a-fA-F\d]{2}))|[?:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|( ?:%[a-fA-F\d]{2}))|[?:@&=])*))*))|(?:prospero://(?:(?:(?:(?:(?:[a-zA-Z \d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-) *[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?)/(?:(?:(?:(? :[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*)(?:/(?:(?:(?:[a- zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*))*)(?:(?:;(?:(?:(?:[ a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&])*)=(?:(?:(?:[a-zA-Z\d $\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&])*)))*)|(?:ldap://(?:(?:(?:(?: (?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?: [a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))? ))?/(?:(?:(?:(?:(?:(?:(?:[a-zA-Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]) )|(?:%20))+|(?:OID|oid)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%2 0)*)=(?:(?:%0[Aa])?(?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F \d]{2}))*))(?:(?:(?:%0[Aa])?(?:%20)*)\+(?:(?:%0[Aa])?(?:%20)*)(?:(?:(? :(?:(?:[a-zA-Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID |oid)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa]) ?(?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*)(?:( ?:(?:(?:%0[Aa])?(?:%20)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))(?:(?:(?:(?:( ?:(?:[a-zA-Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|o id)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?( ?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*))(?:(?:(?: %0[Aa])?(?:%20)*)\+(?:(?:%0[Aa])?(?:%20)*)(?:(?:(?:(?:(?:[a-zA-Z\d]|%( ?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|oid)\.(?:(?:\d+)(?: \.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?(?:%20)*))?(?:(?:[a -zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*))*(?:(?:(?:%0[Aa])?(?:%2 0)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))?)(?:\?(?:(?:(?:(?:[a-zA-Z\d$\-_.+ !*'(),]|(?:%[a-fA-F\d]{2}))+)(?:,(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-f A-F\d]{2}))+))*)?)(?:\?(?:base|one|sub)(?:\?(?:((?:[a-zA-Z\d$\-_.+!*'( ),;/?:@&=]|(?:%[a-fA-F\d]{2}))+)))?)?)?)|(?:(?:z39\.50[rs])://(?:(?:(? :(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(? :[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+)) ?)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))+)(?:\+(?:(?: [a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))+))*(?:\?(?:(?:[a-zA-Z\d$\-_ .+!*'(),]|(?:%[a-fA-F\d]{2}))+))?)?(?:;esn=(?:(?:[a-zA-Z\d$\-_.+!*'(), ]|(?:%[a-fA-F\d]{2}))+))?(?:;rs=(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA -F\d]{2}))+)(?:\+(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))+))*) ?))|(?:cid:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?:@&= ])*))|(?:mid:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?:@ &=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?:@&=] )*))?)|(?:vemmi://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z \d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\ .(?:\d+)){3}))(?::(?:\d+))?)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a -fA-F\d]{2}))|[/?:@&=])*)(?:(?:;(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a -fA-F\d]{2}))|[/?:@&])*)=(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d ]{2}))|[/?:@&])*))*))?)|(?:imap://(?:(?:(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+ !*'(),]|(?:%[a-fA-F\d]{2}))|[&=~])+)(?:(?:;[Aa][Uu][Tt][Hh]=(?:\*|(?:( ?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~])+))))?)|(?:(?:;[ Aa][Uu][Tt][Hh]=(?:\*|(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2 }))|[&=~])+)))(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[ &=~])+))?))@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d]) ?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?: \d+)){3}))(?::(?:\d+))?))/(?:(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?: %[a-fA-F\d]{2}))|[&=~:@/])+)?;[Tt][Yy][Pp][Ee]=(?:[Ll](?:[Ii][Ss][Tt]| [Ss][Uu][Bb])))|(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2})) |[&=~:@/])+)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[ &=~:@/])+))?(?:(?:;[Uu][Ii][Dd][Vv][Aa][Ll][Ii][Dd][Ii][Tt][Yy]=(?:[1- 9]\d*)))?)|(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~ :@/])+)(?:(?:;[Uu][Ii][Dd][Vv][Aa][Ll][Ii][Dd][Ii][Tt][Yy]=(?:[1-9]\d* )))?(?:/;[Uu][Ii][Dd]=(?:[1-9]\d*))(?:(?:/;[Ss][Ee][Cc][Tt][Ii][Oo][Nn ]=(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~:@/])+)))?)) )?)|(?:nfs:(?:(?://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA- Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?: \.(?:\d+)){3}))(?::(?:\d+))?)(?:(?:/(?:(?:(?:(?:(?:[a-zA-Z\d\$\-_.!~*' (),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\-_.!~*'(), ])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))?)|(?:/(?:(?:(?:(?:(?:[a-zA-Z\d \$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\ -_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))|(?:(?:(?:(?:(?:[a-zA- Z\d\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d \$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))) From phillip.powell at adnet-sys.com Mon May 3 14:57:03 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Mon, 03 May 2004 14:57:03 -0400 Subject: Subject: Re: [nycphp-talk] regexp for URLs (is this correct?) In-Reply-To: <40969361.3020502@surgam.net> References: <40969361.3020502@surgam.net> Message-ID: <409695FF.8050802@adnet-sys.com> I would think to simply support "https" all you would have to do is change "http://" to ((?:https)|(?:http://...)) Then again, it's pretty beastly as it is! If that's not a call for a global included variable, what is? Phil James B. Wetterau Jr. wrote: > Jayesh Sheth says: > > Hello all, > > > > I came up with this Perl-style regular expression to validate URLs. > ... > > Any suggestions or corrections? > ... > > A Perl expert of some repute did the hard work of reading all the > relevant protocol specs, BNF notation, etc., and came up with this > valid URL parsing regexp. Anything shorter is likely to miss some > special case. > > This is an article about how to do this: > http://www.foad.org/~abigail/Perl/url2.html > (Note that there were some judgement calls involved in interpretation > of some of the edge cases.) > > This is the URL for the actual regexp: > http://www.foad.org/~abigail/Perl/url3.regex > > This is the regexp (note that it is broken up into many lines but > actually needs to be > one long line; note also that it does not support https): > > (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. > )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+) > ){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F > \d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ > 2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ > 2}))|[;:@&=])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(? > :%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a- > fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|- > )*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(? > :\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+! > *'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'() > ,]|(?:%[a-fA-F\d]{2}))|[?:@&=])*))*)(?:;type=[AIDaid])?)?)|(?:news:(?: > (?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;/?:&=])+@(?:(?:( > ?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[ > a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3})))|(?:[a-zA-Z]( > ?:[a-zA-Z\d]|[_.+-])*)|\*))|(?:nntp://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[ > a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d > ])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?)/(?:[a-zA-Z](?:[a-zA-Z > \d]|[_.+-])*)(?:/(?:\d+))?)|(?:telnet://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+ > !*'(),]|(?:%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'() > ,]|(?:%[a-fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a > -zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d] > )?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))/?)|(?:gopher://(?:(?: > (?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?: > (?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+ > ))?)(?:/(?:[a-zA-Z\d$\-_.+!*'(),;/?:@&=]|(?:%[a-fA-F\d]{2}))(?:(?:(?:[ > a-zA-Z\d$\-_.+!*'(),;/?:@&=]|(?:%[a-fA-F\d]{2}))*)(?:%09(?:(?:(?:[a-zA > -Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@&=])*)(?:%09(?:(?:[a-zA-Z\d$ > \-_.+!*'(),;/?:@&=]|(?:%[a-fA-F\d]{2}))*))?)?)?)?)|(?:wais://(?:(?:(?: > (?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?: > [a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))? > )/(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)(?:(?:/(?:(?:[a-zA > -Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)/(?:(?:[a-zA-Z\d$\-_.+!*'(),]|( > ?:%[a-fA-F\d]{2}))*))|\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d] > {2}))|[;:@&=])*))?)|(?:mailto:(?:(?:[a-zA-Z\d$\-_.+!*'(),;/?:@&=]|(?:% > [a-fA-F\d]{2}))+))|(?:file://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d] > |-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?: > (?:\d+)(?:\.(?:\d+)){3}))|localhost)?/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'() > ,]|(?:%[a-fA-F\d]{2}))|[?:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|( > ?:%[a-fA-F\d]{2}))|[?:@&=])*))*))|(?:prospero://(?:(?:(?:(?:(?:[a-zA-Z > \d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-) > *[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?)/(?:(?:(?:(? > :[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*)(?:/(?:(?:(?:[a- > zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*))*)(?:(?:;(?:(?:(?:[ > a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&])*)=(?:(?:(?:[a-zA-Z\d > $\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&])*)))*)|(?:ldap://(?:(?:(?:(?: > (?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?: > [a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))? > ))?/(?:(?:(?:(?:(?:(?:(?:[a-zA-Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]) > )|(?:%20))+|(?:OID|oid)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%2 > 0)*)=(?:(?:%0[Aa])?(?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F > \d]{2}))*))(?:(?:(?:%0[Aa])?(?:%20)*)\+(?:(?:%0[Aa])?(?:%20)*)(?:(?:(? > :(?:(?:[a-zA-Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID > |oid)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa]) > ?(?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*)(?:( > ?:(?:(?:%0[Aa])?(?:%20)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))(?:(?:(?:(?:( > ?:(?:[a-zA-Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|o > id)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?( > ?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*))(?:(?:(?: > %0[Aa])?(?:%20)*)\+(?:(?:%0[Aa])?(?:%20)*)(?:(?:(?:(?:(?:[a-zA-Z\d]|%( > ?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|oid)\.(?:(?:\d+)(?: > \.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?(?:%20)*))?(?:(?:[a > -zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*))*(?:(?:(?:%0[Aa])?(?:%2 > 0)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))?)(?:\?(?:(?:(?:(?:[a-zA-Z\d$\-_.+ > !*'(),]|(?:%[a-fA-F\d]{2}))+)(?:,(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-f > A-F\d]{2}))+))*)?)(?:\?(?:base|one|sub)(?:\?(?:((?:[a-zA-Z\d$\-_.+!*'( > ),;/?:@&=]|(?:%[a-fA-F\d]{2}))+)))?)?)?)|(?:(?:z39\.50[rs])://(?:(?:(? > :(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(? > :[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+)) > ?)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))+)(?:\+(?:(?: > [a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))+))*(?:\?(?:(?:[a-zA-Z\d$\-_ > .+!*'(),]|(?:%[a-fA-F\d]{2}))+))?)?(?:;esn=(?:(?:[a-zA-Z\d$\-_.+!*'(), > ]|(?:%[a-fA-F\d]{2}))+))?(?:;rs=(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA > -F\d]{2}))+)(?:\+(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))+))*) > ?))|(?:cid:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?:@&= > ])*))|(?:mid:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?:@ > &=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?:@&=] > )*))?)|(?:vemmi://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z > \d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\ > .(?:\d+)){3}))(?::(?:\d+))?)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a > -fA-F\d]{2}))|[/?:@&=])*)(?:(?:;(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a > -fA-F\d]{2}))|[/?:@&])*)=(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d > ]{2}))|[/?:@&])*))*))?)|(?:imap://(?:(?:(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+ > !*'(),]|(?:%[a-fA-F\d]{2}))|[&=~])+)(?:(?:;[Aa][Uu][Tt][Hh]=(?:\*|(?:( > ?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~])+))))?)|(?:(?:;[ > Aa][Uu][Tt][Hh]=(?:\*|(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2 > }))|[&=~])+)))(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[ > &=~])+))?))@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d]) > ?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?: > \d+)){3}))(?::(?:\d+))?))/(?:(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?: > %[a-fA-F\d]{2}))|[&=~:@/])+)?;[Tt][Yy][Pp][Ee]=(?:[Ll](?:[Ii][Ss][Tt]| > [Ss][Uu][Bb])))|(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2})) > |[&=~:@/])+)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[ > &=~:@/])+))?(?:(?:;[Uu][Ii][Dd][Vv][Aa][Ll][Ii][Dd][Ii][Tt][Yy]=(?:[1- > 9]\d*)))?)|(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~ > :@/])+)(?:(?:;[Uu][Ii][Dd][Vv][Aa][Ll][Ii][Dd][Ii][Tt][Yy]=(?:[1-9]\d* > )))?(?:/;[Uu][Ii][Dd]=(?:[1-9]\d*))(?:(?:/;[Ss][Ee][Cc][Tt][Ii][Oo][Nn > ]=(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~:@/])+)))?)) > )?)|(?:nfs:(?:(?://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA- > Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?: > \.(?:\d+)){3}))(?::(?:\d+))?)(?:(?:/(?:(?:(?:(?:(?:[a-zA-Z\d\$\-_.!~*' > (),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\-_.!~*'(), > ])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))?)|(?:/(?:(?:(?:(?:(?:[a-zA-Z\d > \$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\ > -_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))|(?:(?:(?:(?:(?:[a-zA- > Z\d\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d > \$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))) > > > > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From epaul at speakeasy.net Mon May 3 14:56:54 2004 From: epaul at speakeasy.net (epaul at speakeasy.net) Date: Mon, 03 May 2004 18:56:54 +0000 Subject: [nycphp-talk] PHP Training at New York PHP Message-ID: Tim, In the next week or two, I will be launching a new PHP training portal web site. The site should be an excellent medium to promote PHP training courses. The site is still under dev BUT should be ready in a week or two. I'll send an email once the site launches. Evan > -----Original Message----- > From: Tim Gales [mailto:tgales at tgaconnect.com] > Sent: Monday, May 3, 2004 05:45 PM > To: talk at lists.nyphp.org > Subject: [nycphp-talk] PHP Training at New York PHP > > > > I am looking for low cost (but effective) > venues to advertise upcoming PHP training > sessions at New York on a continuing basis. > > Incidentally, the next training is scheduled > for May 17-18 (you can see the course outline at: > http://nyphp.org/content/training/twodaycourse.php ) > > Please contact me off list at: > > tim.gales at nyphp.org > > with any ideas. > > > Thanks in advance, > > Tim Gales > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From tgales at tgaconnect.com Mon May 3 15:23:21 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 3 May 2004 15:23:21 -0400 Subject: [nycphp-talk] PHP Training at New York PHP In-Reply-To: Message-ID: <001801c43144$193b2460$e98d3818@oberon1> Thanks, that's great news. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com P.S. Good Luck on your launch -- let me know if there's something I can do to help (off list) > -----Original Message----- > From: talk-bounces at lists.nyphp.org > Sent: Monday, May 03, 2004 2:57 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] PHP Training at New York PHP > > > Tim, > > In the next week or two, I will be launching a new PHP > training portal web site. The site should be an excellent > medium to promote PHP training courses. The site is still > under dev BUT should be ready in a week or two. I'll send an > email once the site launches. > > Evan > > > -----Original Message----- > > Sent: Monday, May 3, 2004 05:45 PM > > To: talk at lists.nyphp.org > > Subject: [nycphp-talk] PHP Training at New York PHP > > > > > > > > I am looking for low cost (but effective) > > venues to advertise upcoming PHP training > > sessions at New York on a continuing basis. > > > > Incidentally, the next training is scheduled > > for May 17-18 (you can see the course outline at: > > http://nyphp.org/content/training/twodaycourse.php ) > > > > Please contact me off list at: > > > > > > with any ideas. > > > > > > Thanks in advance, > > > > Tim Gales > > > > > > _______________________________________________ > > talk mailing list > > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > > > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > From adam at trachtenberg.com Mon May 3 15:25:00 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 3 May 2004 15:25:00 -0400 (EDT) Subject: [nycphp-talk] regexp for URLs (is this correct?) In-Reply-To: <40968FD8.6090109@ceruleansky.com> References: <40968FD8.6090109@ceruleansky.com> Message-ID: On Mon, 3 May 2004, Jayesh Sheth wrote: > Any suggestions or corrections? I trust Jeff Friedl's regex. He wrote "Mastering Regular Expressions" for O'Reilly and works at Yahoo! http://www.regex.info/listing.cgi?ps=208 Also, FWIW, it's often faster and easier to write two regular expressions to check a string than trying to cram everything into one hugegantic regex. You end up spending more time working on the regex than you ever save during the course of the total run time of the program. OTOH, it's fun. :) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From james at surgam.net Mon May 3 15:32:52 2004 From: james at surgam.net (James B. Wetterau Jr.) Date: Mon, 03 May 2004 15:32:52 -0400 Subject: [nycphp-talk] regexp for URLs (is this correct?) Message-ID: <40969E64.3080508@surgam.net> Adam Maccabee Trachtenberg says: > On Mon, 3 May 2004, Jayesh Sheth wrote: > > > Any suggestions or corrections? > > I trust Jeff Friedl's regex. He wrote "Mastering Regular Expressions" > for O'Reilly and works at Yahoo! > > http://www.regex.info/listing.cgi?ps=208 ... His is a little out of date. He's missing some of the new TLD's e.g. .museum. For example, check out this cool URL (as the Netscape mailto default subject used to say): http://musedoma.museum/musedoma.html There's a .name, and .coop, and .aero, and others, too. OTOH, I didn't check if the URL that ate Toledo handled the new TLD's either. From adam at trachtenberg.com Mon May 3 15:58:36 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 3 May 2004 15:58:36 -0400 (EDT) Subject: [nycphp-talk] regexp for URLs (is this correct?) In-Reply-To: <40969E64.3080508@surgam.net> References: <40969E64.3080508@surgam.net> Message-ID: On Mon, 3 May 2004, James B. Wetterau Jr. wrote: > His is a little out of date. He's missing some of the new TLD's e.g. > .museum. That's probably true, but it's easy to tack on new TLDs. > OTOH, I didn't check if the URL that ate Toledo handled the new TLD's > either. Most regexen just check that the TLD is something like [a-zA-Z]{2,} -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From dmintz at davidmintz.org Mon May 3 16:18:42 2004 From: dmintz at davidmintz.org (David Mintz) Date: Mon, 3 May 2004 16:18:42 -0400 (EDT) Subject: [nycphp-talk] regexp for URLs (is this correct?) In-Reply-To: References: <40969E64.3080508@surgam.net> Message-ID: I know this is sort of a copout but once, when I had this situation and had the resources to kill -- importing thousand rows from a text file to MySQL and sanity-checking a ton of things in the process -- I said the hell with it, let's just try to access the resource that the URL points to. No response means URL no good, well-formedness notwithstanding. if ($handle = @fopen ($url, "r")) True, a site could be down temporarily. Call it the one-strike-and-you're-out rule. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From chubbard at next-online.net Mon May 3 17:32:38 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Mon, 03 May 2004 14:32:38 -0700 Subject: [nycphp-talk] regexp for URLs (is this correct?) In-Reply-To: <40968FD8.6090109@ceruleansky.com> References: <40968FD8.6090109@ceruleansky.com> Message-ID: <66648D0A-9D49-11D8-9321-003065D637D0@next-online.net> Jay, I've played with this one a lot and I've got a regex that I'm using. It has one bug that I know about, maybe someone on this list can suggest a fix: $regx = "^((http|https|ftp)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z0-9]{2,5}(:[a-zA-Z0 -9]*)?\/?([a-zA-Z0-9\-\._\?\,\'\/\\\+&%\$#\=~])*)$"; The bug is domain names with a hyphen fail. So, www.big-boots.com would fail, where www.bigboots.com passes. Chris On May 3, 2004, at 11:30 AM, Jayesh Sheth wrote: > Hello all, > > I came up with this Perl-style regular expression to validate URLs. > > For example, if I want to match "http://www.google.com" > then I would test it against the following pattern: > > #^([a-z]{3,}://)(([0-9a-z-]+\.)+[0-9a-z]{2,4})$#i > > maybe I want to do something like this though: > > #^([a-z]{3,5}://)(([0-9a-z-]+\.)+[0-9a-z]{2,4})$#i > > so that > http://www.google.com > > and > ftp://ftp.mozilla.org > > and > https://www.amazon.com > > are matched > > but > httpsabc://www.somewhere.com > > is not matched. > > I primarily want to validate http:// links, though. > > Another thought: I want to be flexible and allow the user to enter > something like: > > www.google.com > > Should I first try to match against: > #^([a-z]{3,5}://)(([0-9a-z-]+\.)+[0-9a-z]{2,4})$#i > > and then, if that fails against: > #^(([0-9a-z-]+\.)+[0-9a-z]{2,4})$#i > > I also realize that something like > http://www.google.com/ > > will not be matched. > > Any suggestions or corrections? > > Thanks in advance! > > Best Regards, > > - Jay > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1836 bytes Desc: not available URL: From danielc at analysisandsolutions.com Mon May 3 17:41:26 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 3 May 2004 17:41:26 -0400 Subject: [nycphp-talk] regexp for URLs (is this correct?) In-Reply-To: <66648D0A-9D49-11D8-9321-003065D637D0@next-online.net> References: <40968FD8.6090109@ceruleansky.com> <66648D0A-9D49-11D8-9321-003065D637D0@next-online.net> Message-ID: <20040503214126.GA15735@panix.com> On Mon, May 03, 2004 at 02:32:38PM -0700, Chris Hubbard wrote: > "^((http|https|ftp)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z0-9]{2,5}(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9\-\._\?\,\'\/\\\+&%\$#\=~])*)$"; You're over escaping things. Items in [] don't need to be escaped, and to search for "-" itself, put it at the beginning or the end, [a-zA-Z0-9.-], so it doesn't think you're creating another range. Also, I don't think ":" needs escaping and you can change your delimiter from "/" to some other character that's unused in the expression so you don't have to do "\/" over and over. ... snip, the polite thing to do ... --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From cmerlo at ncc.edu Mon May 3 17:12:31 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Mon, 3 May 2004 17:12:31 -0400 Subject: Subject: Re: [nycphp-talk] regexp for URLs (is this correct?) In-Reply-To: <40969361.3020502@surgam.net> References: <40969361.3020502@surgam.net> Message-ID: <20040503211231.GB23690@ncc.edu> On 2004-05-03 14:45 -0400, James B. Wetterau Jr. wrote: > A Perl expert of some repute did the hard work of reading all the > relevant protocol specs, BNF notation, etc., and came up with this > valid URL parsing regexp. Anything shorter is likely to miss some > special case. I'm glad I don't have to debug that. I like the idea (sorry, I deleted the original post) of checking with fopen. Perhaps create a DB table with a column for last good result from fopen. If that column reaches a threshold, chuck the URL. -c -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Q: How many software engineers does it take to change a lightbulb? A: None. We'll document it in the manual. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From cwf at axlotl.net Mon May 3 21:39:36 2004 From: cwf at axlotl.net (chris) Date: Mon, 3 May 2004 21:39:36 -0400 Subject: [nycphp-talk] confused by classes In-Reply-To: <20040503031049.GA22394@panix.com> References: <200405011850.34004.cwf@axlotl.net> <20040503031049.GA22394@panix.com> Message-ID: <200405032139.36021.cwf@axlotl.net> On Sunday 02 May 2004 11:10 pm, Daniel Convissor wrote: > First, your coding style needs improvement. See You think I have a coding *style*? ..Gee, thanks! > Assign the return by reference in order to conserve memory, etc: > ? ? $dbh =& DB::connect($dsn); Good to know > quote() is deprecated. Use quoteSmart(). And thanks for this and the others. > > It's not clear what you're looking for here. What I'm looking for is an answer to a general design question. I see three vaguely defined ways of doing this. Should I make the functions generic, and customize the sql in the script (that is, write a specific query and pass that and an array of parameters for each specific need, reusing a very generic DB connect/query function)? $res = ("SELECT $sql, $data") Or is it better to code a catch all query in the function, and return a bunch of methods like this (my most recent brainstorm): $res = ("SELECT w, x, y, y, z FROM [...]) Returns an array, or: $this->one = $res[0]; $this->two = $res[1]; $this->three = $res[2]; ...etc... Or, lastly, is it best to make a bunch of rather specific functions with queries hard coded in them, but which are only returning tightly restricted datasets: function a(){ $res = ("SELECT w FROM x"); return $res;} function b(){ $res = ("SELECT y FROM z"); return $res;} I guess I'm asking if I should be working with some general principle governing in which direction I should be pushing complexity. Towards the functions, or towards the scripts? Or should I just go away and run my head into a wall until I've learned enough to come back and ask more coherent questions (a reasonable answer, I would have to admit)? Chris > --Dan From jayeshsh at ceruleansky.com Mon May 3 22:08:27 2004 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Mon, 03 May 2004 22:08:27 -0400 Subject: [nycphp-talk] Re: regexp for URLs (is this correct?) Message-ID: <4096FB1B.8010905@ceruleansky.com> Hello all, thanks for the excellent pointers regarding URL validation. I think that since I am only validating http:// and https:// URLs for now, the really (30 - 50 line) long one would be too much to incorporate for this job ... But I just realized some things that were wrong with my previous regular expressions (those matching 'http://www.google.com' and 'www.google.com' respectively): a) I could check for a optional slash at the end by using something like: /? b) In both cases, input such as the following would fail: http://www.google.com/something/something.html OR www.google.com/something/something.html With a bit of experimenting (I really need to upload my interactive Perl-regex tester script to my public scripts area), I came up with the following: /* Should match: http://www.google.com/something/something.html http://www.google.com/something/something http://www.google.com/something/something/ http://www.google.com/ http://www.google.com */ #^(([a-z]{3,5})://)(([0-9a-z-]+\.)+[0-9a-z]{2,6})((/[0-9a-z-]*)+?/?([0-9a-z-.]*)+?)$#i and /* Should match: www.google.com/something/something.html www.google.com/something/something www.google.com/something/something/ www.google.com/ www.google.com */ #^(([0-9a-z-]+\.)+[0-9a-z]{2,6})((/[0-9a-z-]*)+?/?([0-9a-z-.]*)+?)$#i It is getting close to my bed time now, so I am not sure how correct these are. I will do some more testing tomorrow. If, however, they do work, they might be of use to others. If anyone finds anything wrong with them, please let me know. Best Regards, - Jay PS: I changed my regexps to allow 6 letter domains ( .museum ) after reading some responses today. The [0-9a-z]{2,6} part, that is. PPS: I will be using these expressions to mostly evaluate newly submitted URLs via a text input box. The other regexps that I posted recently were for batch validation (and transformation / import) of lots of invalid MySQL data. Thanks for the fopen() tip, David. From wfan at encogent.com Tue May 4 11:28:15 2004 From: wfan at encogent.com (Wellington Fan) Date: Tue, 4 May 2004 11:28:15 -0400 Subject: [nycphp-talk] Re: regexp for URLs (is this correct?) In-Reply-To: <4096FB1B.8010905@ceruleansky.com> Message-ID: <001b01c431ec$6b913da0$6400a8c0@lorimervmware> Listfolk, Try this really nifty regex tester: The Regex Coach http://www.weitz.de/regex-coach/ Windows & Linux versions available. -- Wellington From tgales at tgaconnect.com Tue May 4 12:16:48 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Tue, 4 May 2004 12:16:48 -0400 Subject: [nycphp-talk] Scholarships for Training at New York PHP Message-ID: <00a401c431f3$345b5030$e98d3818@oberon1> The education dept. at New York PHP will be awarding at least one partial scholarship to the upcoming two day training session scheduled for May 17-18. The criteria used to select recipients of the scholarships will be based primarily on (but not limited to) the following factors: a) past participation on the mailing lists as well as contributions to general meetings at NYPHP b) willingness to contribute and help others (can be demonstrated by participation in groups other that NYPHP) c) a brief write-up from the applicant stating how the granting of a scholarship to him or her will make a beneficial impact (for the individual as well as the open source community at large in terms of widening the understanding PHP, MySQL, and Apache tools) The scholarships are to be for fifty (50) percent of the full tuition price, presently $780 Please address questions and responses to: training at nyphp.org From jonbaer at jonbaer.net Tue May 4 13:06:29 2004 From: jonbaer at jonbaer.net (jon baer) Date: Tue, 04 May 2004 13:06:29 -0400 Subject: [nycphp-talk] Scholarships for Training at New York PHP In-Reply-To: <00a401c431f3$345b5030$e98d3818@oberon1> References: <00a401c431f3$345b5030$e98d3818@oberon1> Message-ID: <4097CD95.9060304@jonbaer.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 do these include RAMP Certification classes? or is this just for the 2-day overview class? thanks. (good idea :-) - - jon - -- pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFAl82VQdvbi5oMr0cRArFgAJ9g9teKE3sRgVAEZFSL3clwmnV5zwCgjokF k8YGybzxHTTy3/uXvHBzvdc= =O5S9 -----END PGP SIGNATURE----- From southwell at dneba.com Tue May 4 13:21:18 2004 From: southwell at dneba.com (Michael Southwell) Date: Tue, 04 May 2004 13:21:18 -0400 Subject: [nycphp-talk] Scholarships for Training at New York PHP In-Reply-To: <4097CD95.9060304@jonbaer.net> References: <00a401c431f3$345b5030$e98d3818@oberon1> <4097CD95.9060304@jonbaer.net> Message-ID: <6.1.0.6.2.20040504132042.01ef0378@mail.optonline.net> At 01:06 PM 5/4/2004, you wrote: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >do these include RAMP Certification classes? or is this just for the >2-day overview class? just the 17-18 May two-day class Michael Southwell VP, Education Department NYPHP michael.southwell at nyphp.org From Rafi.Sheikh at Ingenix.com Tue May 4 14:36:14 2004 From: Rafi.Sheikh at Ingenix.com (Rafi Sheikh) Date: Tue, 4 May 2004 13:36:14 -0500 Subject: [nycphp-talk] data vector Message-ID: Hi list. Admittedly a very silly and basic question: I need to pass data vector to a variable that could be later used to plot a graph. I am able to -finally!- get the data in an array format...and it looks like this: Array ( [0] => 59 [1] => 72 [2] => 45 ) Array ( [0] => 118 [1] => 77 [2] => 107) But apparently I am not passing this data correctly. My code is as follows: [code] "; print_r($g1); echo "
"; print_r($g2); echo "
"; print_r($g3); echo "
"; print_r($g4); } ?> [/code] Q1. Should I not use associative array? Q2. How can I pass the data points in the var $g0-$g4 so the data vector is passed? I am signed up for some formal class in PHP in June-04, but I have to figure this out before that, and plz. trust me when I say that this basic level of headache is really embarassing, and yes, I have been reading and reading and ... RS This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. From suzerain at suzerain.com Tue May 4 17:39:21 2004 From: suzerain at suzerain.com (Marc Antony Vose) Date: Tue, 4 May 2004 17:39:21 -0400 Subject: [nycphp-talk] windows 98 or 2000, file uploads and name length In-Reply-To: References: Message-ID: Hi there: I'm primarily an OS X user, but I have an XP box that I am testing on. I've got a client who is using a tool I created to manage all the content on their site. It includes file upload capability, and some of their files were getting mangled somehow in the upload process. It looks like the browser they are using (Windows 98, IE 5, or IE 6 on Windows 2000) is chopping the file name and inserting an ellipsis character. This seems really stupid to me, since the ellipsis character is not part of the valid ASCII set. Anyway, they have files whose names are getting changed to something like: ABU_REP_70_2004_04_01_Certificate_for_FSC_web_page_tradema....pdf which translates to: ABU_REP_70_2004_04_01_Certificate_for_FSC_web_page_tradema%E2%80%A6.pdf Therefore, browsers can't find the file, even though it is uploaded to the proper location. She sent me a file that she can't upload, which is called: FSC_STD_20_001_General_requirements_for_FSC_certification_bodies_V1_0.PDF Obviously, this file name is long -- maybe even obnoxiously long -- but it's only 73 characters. My problem is...I have tried and tried, and I can't NOT get this file to upload properly, on either my Mac or my XP box. Is there some file length restriction in Internet Explorer for Windows 98 or 2000? Is there something else causing these files to end up with phantom ellipses? Just hoping someone has encountered this before. -- Marc Antony Vose http://www.suzerain.com/ Life feeds on life. -- Tool -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.net Tue May 4 17:58:53 2004 From: jonbaer at jonbaer.net (Jon Baer) Date: Tue, 04 May 2004 17:58:53 -0400 Subject: [nycphp-talk] windows 98 or 2000, file uploads and name length In-Reply-To: References: Message-ID: <4098121D.4050703@jonbaer.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Have not heard of such a thing (I know there were charset problems in the early days) but have you tried HTTP_Upload? http://pear.php.net/package/HTTP_Upload - - Jon Marc Antony Vose wrote: | Is there some file length restriction in Internet Explorer for Windows | 98 or 2000? Is there something else causing these files to end up with | phantom ellipses? | | Just hoping someone has encountered this before. - -- pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFAmBIdQdvbi5oMr0cRAlAjAKDQ3JSYMVAMN7dNKuuxvUX9ivuomwCg5VvM BMx09/7S0aFfC5Z9MH0NK+I= =9A3d -----END PGP SIGNATURE----- From pl at eskimo.com Tue May 4 23:41:43 2004 From: pl at eskimo.com (Peter Lehrer) Date: Tue, 4 May 2004 23:41:43 -0400 Subject: [nycphp-talk] Fw: [nylug-talk] Problems with PHP Message-ID: <003601c43252$e3c40d00$682c0242@default> Can anyone help this guy? p l ----- Original Message ----- From: "Luigi" To: "NYLUG" Sent: Tuesday, May 04, 2004 9:52 PM Subject: [nylug-talk] Problems with PHP > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > A friend of mine is having some trouble with PHP, since I don't know much > about PHP then I can't help him, hope someone from here can =] > He told me that when he creates an html doc and adds PHP code to it it will > only execute the HTML part and not the PHP. > He has Mandrake 9.2 installed and the PHP version and software which comes > with it. > If more data regarding the problem is needed please tell me and I'll ask him. > Any help will be welcomed. > - -- > ____________ > Luigi > Luigi2k2 at myrealbox.com > > Linux User #350832 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.4 (GNU/Linux) > > iD8DBQFAmEjhJsp/8mif/FURAgZ/AJ0aHQcJAfLyHgUayN/Zpc03qiUhvgCdEPNL > 4Gj7t8BkSKFcAl8YfeZZASA= > =wJwx > -----END PGP SIGNATURE----- > > _______________________________________________ > The nylug-talk mailing list is at nylug-talk at nylug.org > To subscribe or unsubscribe: http://www.nylug.org/mailman/listinfo/nylug-talk > From crisscott at netzero.com Wed May 5 08:02:05 2004 From: crisscott at netzero.com (Scott Mattocks) Date: Wed, 05 May 2004 08:02:05 -0400 Subject: [nycphp-talk] Fw: [nylug-talk] Problems with PHP In-Reply-To: <003601c43252$e3c40d00$682c0242@default> References: <003601c43252$e3c40d00$682c0242@default> Message-ID: <4098D7BD.6030604@netzero.com> I would tell him to check that apache is set up properly. Make sure that his httpd.conf file has this line: AddType application/x-httpd-php .php If apache isn't told to pass the file to PHP it will just spit it out as is and the users browser will ignore any tags () it doesn't recognize. Scott Mattocks Peter Lehrer wrote: > Can anyone help this guy? > > p l > ----- Original Message ----- > From: "Luigi" > To: "NYLUG" > Sent: Tuesday, May 04, 2004 9:52 PM > Subject: [nylug-talk] Problems with PHP > > > >>-----BEGIN PGP SIGNED MESSAGE----- >>Hash: SHA1 >> >>A friend of mine is having some trouble with PHP, since I don't know much >>about PHP then I can't help him, hope someone from here can =] >>He told me that when he creates an html doc and adds PHP code to it it > > will > >>only execute the HTML part and not the PHP. >>He has Mandrake 9.2 installed and the PHP version and software which comes >>with it. >>If more data regarding the problem is needed please tell me and I'll ask > > him. > >>Any help will be welcomed. >>- -- >>____________ >>Luigi >>Luigi2k2 at myrealbox.com >> >>Linux User #350832 >>-----BEGIN PGP SIGNATURE----- >>Version: GnuPG v1.2.4 (GNU/Linux) >> >>iD8DBQFAmEjhJsp/8mif/FURAgZ/AJ0aHQcJAfLyHgUayN/Zpc03qiUhvgCdEPNL >>4Gj7t8BkSKFcAl8YfeZZASA= >>=wJwx >>-----END PGP SIGNATURE----- >> >>_______________________________________________ >>The nylug-talk mailing list is at nylug-talk at nylug.org >>To subscribe or unsubscribe: > > http://www.nylug.org/mailman/listinfo/nylug-talk > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > From phillip.powell at adnet-sys.com Wed May 5 10:04:10 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Wed, 05 May 2004 10:04:10 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! Message-ID: <4098F45A.9010406@adnet-sys.com> I'm curious as to how I should handle this, other than the obvious H*LL NO: A guy posted a request for bids for a project whereby he needs an entire file management application system, complete with ability to handle streaming audio/video uploads and downloads, search engine, advanced search engine, "Top Ten" videos, a "My" personalization feature, and at least 12 - 13 other major applications. Total time to develop ALL of this: 15 days Max bid: $20 Hey if anything I gave you all the laugh of the day! :) Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From yury at heavenspa.com Wed May 5 10:04:51 2004 From: yury at heavenspa.com (Yury Rush) Date: Wed, 5 May 2004 10:04:51 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <4098F45A.9010406@adnet-sys.com> Message-ID: I'd pay atleast 50 for all that and buy lunch :) regards yury p.s. /me wonders if he/she is outsourced or a native :D -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Phillip Powell Sent: Wednesday, May 05, 2004 9:04 AM To: NYPHP Talk Subject: [nycphp-talk] Worst freelance offer of all time! I'm curious as to how I should handle this, other than the obvious H*LL NO: A guy posted a request for bids for a project whereby he needs an entire file management application system, complete with ability to handle streaming audio/video uploads and downloads, search engine, advanced search engine, "Top Ten" videos, a "My" personalization feature, and at least 12 - 13 other major applications. Total time to develop ALL of this: 15 days Max bid: $20 Hey if anything I gave you all the laugh of the day! :) Phil -- ---------------------------------------------------------------------------- ----- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From joel at tagword.com Wed May 5 11:54:43 2004 From: joel at tagword.com (Joel De Gan) Date: Wed, 05 May 2004 11:54:43 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <4098F45A.9010406@adnet-sys.com> References: <4098F45A.9010406@adnet-sys.com> Message-ID: <1083772483.4838.25.camel@bezel> A lot of time people who do that are looking for pre-built opensource scripts to be installed. $20 to upload a file and ungzip/untar a file and change a couple things is not to bad for people.. in particular people overseas. I run a small job bid site and see those a lot. -joeldg On Wed, 2004-05-05 at 10:04, Phillip Powell wrote: > I'm curious as to how I should handle this, other than the obvious H*LL NO: > > A guy posted a request for bids for a project whereby he needs an entire > file management application system, complete with ability to handle > streaming audio/video uploads and downloads, search engine, advanced > search engine, "Top Ten" videos, a "My" personalization feature, and at > least 12 - 13 other major applications. > > Total time to develop ALL of this: 15 days > Max bid: $20 > > Hey if anything I gave you all the laugh of the day! :) > > Phil -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From nyphp at enobrev.com Wed May 5 11:16:58 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Wed, 5 May 2004 11:16:58 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <1083772483.4838.25.camel@bezel> Message-ID: $20 for even just an upload and configuration is absurd. Even so, 15 days max says that s/he's looking for some customization. I don't even know of overseas groups that would do 15 days of work for $20. Besides that, bid for work sites have the silliest pricing I've ever scene (nothing against you or your site personally, joel). Mark From ejp at well.com Wed May 5 11:33:41 2004 From: ejp at well.com (Edward Potter) Date: Wed, 5 May 2004 11:33:41 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <1083772483.4838.25.camel@bezel> References: <4098F45A.9010406@adnet-sys.com> <1083772483.4838.25.camel@bezel> Message-ID: <962B576E-9EA9-11D8-BE4D-000393CAC09E@well.com> Well, while staying in India, my daily rent for a GREAT apartment was about .50 cents a day (Rishikesh). Assume living in NYC your rent is $30 per day. So it's about 1/60 the cost. Thats why the odds are this vendor may actually get someone for $20 for this project. And why I'd HIGHLY recommend to any up and coming USA based programmer to learn welding. plumbing, or carpentry as a sideline, or at least Java2ME. :-) -ed On May 5, 2004, at 11:54 AM, Joel De Gan wrote: > A lot of time people who do that are looking for pre-built opensource > scripts to be installed. > $20 to upload a file and ungzip/untar a file and change a couple things > is not to bad for people.. in particular people overseas. > I run a small job bid site and see those a lot. > -joeldg > > On Wed, 2004-05-05 at 10:04, Phillip Powell wrote: >> I'm curious as to how I should handle this, other than the obvious >> H*LL NO: >> >> A guy posted a request for bids for a project whereby he needs an >> entire >> file management application system, complete with ability to handle >> streaming audio/video uploads and downloads, search engine, advanced >> search engine, "Top Ten" videos, a "My" personalization feature, and >> at >> least 12 - 13 other major applications. >> >> Total time to develop ALL of this: 15 days >> Max bid: $20 >> >> Hey if anything I gave you all the laugh of the day! :) >> >> Phil > -- > joeldg - developer, Intercosmos media group. > http://lucifer.intercosmos.net > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > //----------------------------------------- http://mygoo.typepad.com http://mygoo.typepad.com/coder From joel at tagword.com Wed May 5 12:53:02 2004 From: joel at tagword.com (Joel De Gan) Date: Wed, 05 May 2004 12:53:02 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: References: Message-ID: <1083775982.4837.38.camel@bezel> Usually the "lower-bidders" i.e. $1 for a portal site + graphics. are just trying to get into talks with the buyer, they then try to bring them up to more realistic terms. But, I have seen russian programmers do a ton of work for very little, however the quality is usually kind of low as they will take on a multitude of jobs. Job bidding is a strange deal. Poke around on http://listbid.com/ which is my board. and you will see. I make a good bit each month just in referrals from this site. -joeldg On Wed, 2004-05-05 at 11:16, Mark Armendariz wrote: > $20 for even just an upload and configuration is absurd. Even so, 15 days > max says that s/he's looking for some customization. I don't even know of > overseas groups that would do 15 days of work for $20. Besides that, bid > for work sites have the silliest pricing I've ever scene (nothing against > you or your site personally, joel). > > Mark > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From danielk at us.ibm.com Wed May 5 11:48:29 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Wed, 5 May 2004 11:48:29 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <1083775982.4837.38.camel@bezel> Message-ID: Well, at least it's not a full-time job in California paying $2-5k a year for LAMP :) http://jobsearch.monster.com/getjob.asp?JobID=21235904 2,000.00 - 5,000.00 USD /year Salary Depends on Experience "Fast paced internet company seeks an adavnaced PHP programmer. Must have experience developing web applications using PHP and MySQL in a Linux environment. Candidate must show samples of work and knowledge of job skills. Salary will be based upon years of job experience and programming level." Daniel Krook, Application Developer WW Web Production Services North 2, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Personal: http://info.krook.org/ Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 From joel at tagword.com Wed May 5 13:09:25 2004 From: joel at tagword.com (Joel De Gan) Date: Wed, 05 May 2004 13:09:25 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <962B576E-9EA9-11D8-BE4D-000393CAC09E@well.com> References: <4098F45A.9010406@adnet-sys.com> <1083772483.4838.25.camel@bezel> <962B576E-9EA9-11D8-BE4D-000393CAC09E@well.com> Message-ID: <1083776965.4840.45.camel@bezel> $30!!.. haha, I wish.. Not sure where you are getting your numbers for NY rentals. try about $61 on a 30 day month for this loft in Chelsea. I chose to live in Manhattan though, if I lived in Brooklyn I could get something similar for much much less.. NY is one of the most expensive places to live. I think San Francisco 'might' actually be more but they have a lot of vacancies there and the market got bombed after 2000. -joeldg On Wed, 2004-05-05 at 11:33, Edward Potter wrote: > Well, while staying in India, my daily rent for a GREAT apartment was > about .50 cents a day (Rishikesh). Assume living in NYC your rent is > $30 per day. So it's about 1/60 the cost. Thats why the odds are this > vendor may actually get someone for $20 for this project. And why I'd > HIGHLY recommend to any up and coming USA based programmer to learn > welding. plumbing, or carpentry as a sideline, or at least Java2ME. > :-) > > -ed -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From phillip.powell at adnet-sys.com Wed May 5 12:07:45 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Wed, 05 May 2004 12:07:45 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <1083776965.4840.45.camel@bezel> References: <4098F45A.9010406@adnet-sys.com> <1083772483.4838.25.camel@bezel> <962B576E-9EA9-11D8-BE4D-000393CAC09E@well.com> <1083776965.4840.45.camel@bezel> Message-ID: <40991151.1060001@adnet-sys.com> According to CNN/Money, the Great City of New York is not only America's most expensive city, it's #11 in the world. And if you think New York is something, it's like INDIA.. compared to Oslo, Norway!!!! Give you an idea: McDonald's Happy Meal: DC: $5 NYC: $6 Oslo: $12.50 Phil Joel De Gan wrote: >$30!!.. haha, I wish.. Not sure where you are getting your numbers for >NY rentals. >try about $61 on a 30 day month for this loft in Chelsea. I chose to >live in Manhattan though, if I lived in Brooklyn I could get something >similar for much much less.. NY is one of the most expensive places to >live. I think San Francisco 'might' actually be more but they have a lot >of vacancies there and the market got bombed after 2000. >-joeldg > >On Wed, 2004-05-05 at 11:33, Edward Potter wrote: > > >>Well, while staying in India, my daily rent for a GREAT apartment was >>about .50 cents a day (Rishikesh). Assume living in NYC your rent is >>$30 per day. So it's about 1/60 the cost. Thats why the odds are this >>vendor may actually get someone for $20 for this project. And why I'd >>HIGHLY recommend to any up and coming USA based programmer to learn >>welding. plumbing, or carpentry as a sideline, or at least Java2ME. >>:-) >> >>-ed >> >> > > > -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From phillip.powell at adnet-sys.com Wed May 5 12:10:13 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Wed, 05 May 2004 12:10:13 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: References: Message-ID: <409911E5.30709@adnet-sys.com> Geez, what's the point? Might as well quit programming and learn other trades, like bean farming. Phil Daniel Krook wrote: > > >Well, at least it's not a full-time job in California paying $2-5k a year >for LAMP :) > > > >http://jobsearch.monster.com/getjob.asp?JobID=21235904 > >2,000.00 - 5,000.00 USD /year >Salary Depends on Experience > >"Fast paced internet company seeks an adavnaced PHP programmer. Must have >experience developing web applications using PHP and MySQL in a Linux >environment. > >Candidate must show samples of work and knowledge of job skills. > >Salary will be based upon years of job experience and programming level." > > > > > >Daniel Krook, Application Developer >WW Web Production Services North 2, ibm.com >1133 Westchester Avenue, White Plains, NY 10604 > >Personal: http://info.krook.org/ >Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 > > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From carlos at sprout.net Wed May 5 12:04:03 2004 From: carlos at sprout.net (Carlos G. Chiossone) Date: Wed, 5 May 2004 12:04:03 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! Message-ID: <49A9DEB886049242BA28C484A36C03F15A7421@email.sprout.net> Is there a carpentry list we can join? I better start doing something else! Carlos -----Original Message----- From: Phillip Powell [mailto:phillip.powell at adnet-sys.com] Sent: Wednesday, May 05, 2004 12:10 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Worst freelance offer of all time! Geez, what's the point? Might as well quit programming and learn other trades, like bean farming. Phil Daniel Krook wrote: > > >Well, at least it's not a full-time job in California paying $2-5k a >year for LAMP :) > > > >http://jobsearch.monster.com/getjob.asp?JobID=21235904 > >2,000.00 - 5,000.00 USD /year >Salary Depends on Experience > >"Fast paced internet company seeks an adavnaced PHP programmer. Must >have experience developing web applications using PHP and MySQL in a >Linux environment. > >Candidate must show samples of work and knowledge of job skills. > >Salary will be based upon years of job experience and programming level." > > > > > >Daniel Krook, Application Developer >WW Web Production Services North 2, ibm.com >1133 Westchester Avenue, White Plains, NY 10604 > >Personal: http://info.krook.org/ >Persona: >http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 > > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > -- ------------------------------------------------------------------------ --------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From yury at heavenspa.com Wed May 5 12:19:38 2004 From: yury at heavenspa.com (Yury Rush) Date: Wed, 5 May 2004 12:19:38 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <49A9DEB886049242BA28C484A36C03F15A7421@email.sprout.net> Message-ID: www.escorts.com is always hiring ;) might be better pay then IT too :) ciao yury p.s. I dno't know if that site exists heheh -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Carlos G. Chiossone Sent: Wednesday, May 05, 2004 11:04 AM To: NYPHP Talk Subject: RE: [nycphp-talk] Worst freelance offer of all time! Is there a carpentry list we can join? I better start doing something else! Carlos -----Original Message----- From: Phillip Powell [mailto:phillip.powell at adnet-sys.com] Sent: Wednesday, May 05, 2004 12:10 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Worst freelance offer of all time! Geez, what's the point? Might as well quit programming and learn other trades, like bean farming. Phil Daniel Krook wrote: > > >Well, at least it's not a full-time job in California paying $2-5k a >year for LAMP :) > > > >http://jobsearch.monster.com/getjob.asp?JobID=21235904 > >2,000.00 - 5,000.00 USD /year >Salary Depends on Experience > >"Fast paced internet company seeks an adavnaced PHP programmer. Must >have experience developing web applications using PHP and MySQL in a >Linux environment. > >Candidate must show samples of work and knowledge of job skills. > >Salary will be based upon years of job experience and programming level." > > > > > >Daniel Krook, Application Developer >WW Web Production Services North 2, ibm.com >1133 Westchester Avenue, White Plains, NY 10604 > >Personal: http://info.krook.org/ >Persona: >http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 > > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > -- ------------------------------------------------------------------------ --------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From joel at tagword.com Wed May 5 13:58:44 2004 From: joel at tagword.com (Joel De Gan) Date: Wed, 05 May 2004 13:58:44 -0400 Subject: [nycphp-talk] totally OT but fun regardless. Message-ID: <1083779924.4843.52.camel@bezel> This hit /. the other day and I have been getting a *ton* of those nigerian scam letters and this is a great forum to post them in as these guys have a blast screwing them over and trying to scam the scammers.. http://www.419eater.com/forum/viewforum.php?f=18 In case you get a bunch of those, post them in the surplus forum so other people can mess with them. -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From dmintz at davidmintz.org Wed May 5 12:58:09 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 5 May 2004 12:58:09 -0400 (EDT) Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: References: Message-ID: On Wed, 5 May 2004, Yury Rush wrote: > www.escorts.com is always hiring ;) might be better pay then IT too :) For that matter, you could try becoming a wholesale heroin and/or cocaine distributor here in New York City. Judging from the numbers of people I see undertaking that career, there must be fabulous opportunities. --- David Mintz http://sdnyinterpreters.org/ http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From carlos at sprout.net Wed May 5 14:00:00 2004 From: carlos at sprout.net (Carlos G. Chiossone) Date: Wed, 5 May 2004 14:00:00 -0400 Subject: [nycphp-talk] Caching images problem Message-ID: <49A9DEB886049242BA28C484A36C03F15A7428@email.sprout.net> Hi all, this is kind of strange it seems to do with timing but... I am using our CMS which will regenerate images as needed... So I publish, all images get regenerated with new ones, but my browsers keep seeing the old images for a few minutes. - we know that the images changed in the directories, we can see that - we have cleared the browsers cache - further we go with a computer that has never seen the page and still sees old images Environment: PHP 4... On IIS, using Smarty templates. And don't ask why IIS, please!!! We also have a script that runs within the publish that access the Linux server to create the images with fonts. We thought it could have been that but we see the images in the directories right away, no delay. WHO THE HELL IS CACHING my images? This is driving me nuts. Any one had a similar issue? Thanks, Carlos From dcech at phpwerx.net Wed May 5 14:19:06 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 05 May 2004 14:19:06 -0400 Subject: [nycphp-talk] Caching images problem In-Reply-To: <49A9DEB886049242BA28C484A36C03F15A7428@email.sprout.net> References: <49A9DEB886049242BA28C484A36C03F15A7428@email.sprout.net> Message-ID: <4099301A.5090404@phpwerx.net> Carlos G. Chiossone wrote: > I am using our CMS which will regenerate images as needed... So I > publish, all images get regenerated with new ones, but my browsers keep > seeing the old images for a few minutes. Sounds to me like you have a proxy somewhere between your boxen...some ISPs run transparent proxies which could cause this behaviour... Dan From carlos at sprout.net Wed May 5 15:02:50 2004 From: carlos at sprout.net (Carlos G. Chiossone) Date: Wed, 5 May 2004 15:02:50 -0400 Subject: [nycphp-talk] Caching images problem Message-ID: <49A9DEB886049242BA28C484A36C03F15A742E@email.sprout.net> All the servers are in-house. There is a 3Com switch and a hub between the servers and us. I wonder if it could be the switch then. Thanks Dan. Carlos. -----Original Message----- From: Dan Cech [mailto:dcech at phpwerx.net] Sent: Wednesday, May 05, 2004 2:19 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Caching images problem Carlos G. Chiossone wrote: > I am using our CMS which will regenerate images as needed... So I > publish, all images get regenerated with new ones, but my browsers > keep seeing the old images for a few minutes. Sounds to me like you have a proxy somewhere between your boxen...some ISPs run transparent proxies which could cause this behaviour... Dan _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From jlacey at att.net Wed May 5 15:13:01 2004 From: jlacey at att.net (John Lacey) Date: Wed, 05 May 2004 13:13:01 -0600 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <4098F45A.9010406@adnet-sys.com> References: <4098F45A.9010406@adnet-sys.com> Message-ID: <40993CBD.6030709@att.net> Phillip Powell wrote: > I'm curious as to how I should handle this, other than the obvious H*LL NO: > > A guy posted a request for bids for a project whereby he needs an entire > file management application system, complete with ability to handle > streaming audio/video uploads and downloads, search engine, advanced > search engine, "Top Ten" videos, a "My" personalization feature, and at > least 12 - 13 other major applications. > > Total time to develop ALL of this: 15 days > Max bid: $20 > this sounds a lot like the job you had taken when you first starting posting on the list... but I don't think it was paying that much :) John From tgales at tgaconnect.com Wed May 5 16:09:40 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 5 May 2004 16:09:40 -0400 Subject: [nycphp-talk] MySQL reports that port 3306 is not free. Message-ID: <012a01c432dc$e8ad1e30$e98d3818@oberon1> when I run msqld_safe & it says: "Starting mysqld daemon with databases from /usr/local/mysql/data 040505 15:57:51 mysqld ended" jobs says: "jobs [1]+ Stopped(SIGTSTP) mysqld_safe (wd: ../bin/mysqld_safe) [2]- Done ./bin/mysqld_safe the last lines of the error log say: 040505 15:54:51 mysqld started 040505 15:54:51 Can't start server: Bind on TCP/IP port: Address already in use 040505 15:54:51 Do you already have another mysqld server running on port: 3306 ? 040505 15:54:51 Aborting so I edited my.cnf to have #port = 3308 #socket = /tmp/mysql.sock in both sections [client] and [mysqld] and reran the safe start script exactly the same results I haven't change any permissions on any directories anywhere (intentionally). I am starting to think that the error logging is mis-reporting the stuff about the port being used. Any advice would be appreciated TIA T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From phillip.powell at adnet-sys.com Wed May 5 16:17:48 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Wed, 05 May 2004 16:17:48 -0400 Subject: [nycphp-talk] has anyone ever used "exif_thumbnail()" PHP 4.3+? Message-ID: <40994BEC.3070402@adnet-sys.com> PHP 4.3.2 with --enable-exif I have the following class: [CODE] isSuccessful) { $thumbStreamObj = exif_thumbnail($this->locationPath . '/' . $this->fileName, $width, $height, $mimeTypeInt); print_r('

thumbStreamObj: '); print_r($thumbStreamObj); if (!$thumbStreamObj) { $this->isSuccessful = false; $this->setErrorArray(array('section' => 'Could not extract embedded thumbnail contents from "' . $this->locationPath . '/' . $this->fileName . '"')); } } } } ?> [/CODE] The class is being used to literally generate a thumbnail from an existing image. I read in the PHP manual (see http://us3.php.net/manual/en/function.exif-thumbnail.php ) that exif_thumbnail() only extracts embedded thumbnail information from a TIFF or JPEG image. In knowing that I've simplified my method to only handle TIFF or JPEG images (this is done in the class constructor - sorting out what image type you got). At this point, however, I am receiving nothing into the $thumbStreamObj binary stream string variable; it's "empty" (false): [CODE]$thumbstreamObj = exif_thumbnail($this->locationPath . '/' . $this->fileName, $width, $height, $mimeTypeInt);[/CODE] I checked the values of $this->fileName and $this->locationPath and both contain the correct values to be able to locate the image in the system for the function to extract the embedded thumbnail information reportedly found in TIFF and JPEG images. Has anyone had any luck using this to create a thumbnail? I could use some more experted advice than I would think to find in the manual notes, which I am certain I'll find among you gurus here. Thanx Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From jonbaer at jonbaer.net Wed May 5 16:08:57 2004 From: jonbaer at jonbaer.net (Jon Baer) Date: Wed, 05 May 2004 16:08:57 -0400 Subject: [nycphp-talk] MySQL reports that port 3306 is not free. In-Reply-To: <012a01c432dc$e8ad1e30$e98d3818@oberon1> References: <012a01c432dc$e8ad1e30$e98d3818@oberon1> Message-ID: <409949D9.9070306@jonbaer.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 what does "netstat -a" + "iptables -L" say about 3306? Tim Gales wrote: | when I run msqld_safe & | | it says: | "Starting mysqld daemon with databases from /usr/local/mysql/data 040505 | 15:57:51 mysqld ended" - -- pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFAmUnZQdvbi5oMr0cRAtBiAKCkmt6Ya2a+M6W1gM1cZkcgk31XpwCgq4h1 4phpDZnJEFd/A4yGI0McC1Y= =p+95 -----END PGP SIGNATURE----- From erank at isthmus.com Wed May 5 16:18:11 2004 From: erank at isthmus.com (Eric Rank) Date: Wed, 5 May 2004 15:18:11 -0500 Subject: [nycphp-talk] http headers & measuring size of string in 'bits' References: <4098F45A.9010406@adnet-sys.com> <40993CBD.6030709@att.net> Message-ID: <002301c432de$16a8b460$8b01a8c0@DB> Howdy folks, I'm working on generating a file on the fly by sending headers and echoing out the content of the file. The trouble is that the php script that does this makes a database query to retrieve the content, and it seems to cause problems. Merely echoing out the string if content itself works fine. In short, the process looks like this: 1. database is queried to retrieve the content based on some variables passed to the page 2. content is built from the query 3. http headers are sent 4. finally the content is echoed out for your curiosity, the headers are the following: header('Content-Disposition: inline; filename="file.m3u"'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); Now, what's interesting is that when the query to the db is limited (eg. " LIMIT 30") to 30 or less results, it works. Any more, and it doesn't. My first line of thought is that the connection is dying too quickly I'm interested in trying out the 'connection: Keep-Alive' header to see if it does anything, but I'm also thinking that a 'content-length' header might be interesting. And that is why I am asking about measuring the file size of a string. content-length expects units in octets (bits / 8). Is there a way to measure the file size of a string? Or even better, can anyone illuminate what might be happening? Thanks, Eric Rank From tgales at tgaconnect.com Wed May 5 16:21:58 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 5 May 2004 16:21:58 -0400 Subject: [nycphp-talk] MySQL reports that port 3306 is not free. In-Reply-To: <409949D9.9070306@jonbaer.net> Message-ID: <012f01c432de$9e46dff0$e98d3818@oberon1> > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jon Baer > Sent: Wednesday, May 05, 2004 4:09 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] MySQL reports that port 3306 is not free. > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > what does "netstat -a" + "iptables -L" say about 3306? > lobotomized shell (I think the client is super paranoid) is missing netstat It's a linux 7.2 release with a lot of stuff ripped out. From danielc at analysisandsolutions.com Wed May 5 16:24:05 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 5 May 2004 16:24:05 -0400 Subject: [nycphp-talk] MySQL reports that port 3306 is not free. In-Reply-To: <012a01c432dc$e8ad1e30$e98d3818@oberon1> References: <012a01c432dc$e8ad1e30$e98d3818@oberon1> Message-ID: <20040505202405.GA8482@panix.com> Hi Tim: On Wed, May 05, 2004 at 04:09:40PM -0400, Tim Gales wrote: > > when I run msqld_safe & > > it says: > "Starting mysqld daemon with databases from /usr/local/mysql/data 040505 > 15:57:51 mysqld ended" > > jobs says: "jobs > [1]+ Stopped(SIGTSTP) mysqld_safe (wd: ../bin/mysqld_safe) > [2]- Done ./bin/mysqld_safe It looks like MySQL is already running. What's the output of the following command (assuming your OS has sockstat) sockstat -4 | grep -E (mysql|3306) and/or ps | grep mysql --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jonbaer at jonbaer.net Wed May 5 16:18:11 2004 From: jonbaer at jonbaer.net (Jon Baer) Date: Wed, 05 May 2004 16:18:11 -0400 Subject: [nycphp-talk] http headers & measuring size of string in 'bits' In-Reply-To: <002301c432de$16a8b460$8b01a8c0@DB> References: <4098F45A.9010406@adnet-sys.com> <40993CBD.6030709@att.net> <002301c432de$16a8b460$8b01a8c0@DB> Message-ID: <40994C03.5060408@jonbaer.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The script could just be timing out with a large amount of records ... look @ stream_set_timeout for examples, see: www.php.net/stream_set_timeout. I used this for a large db query once. - - Jon Eric Rank wrote: | Howdy folks, | | I'm working on generating a file on the fly by sending headers and echoing | out the content of the file. The trouble is that the php script that does | this makes a database query to retrieve the content, and it seems to cause | problems. Merely echoing out the string if content itself works fine. In | short, the process looks like this: - -- pgp key: http://www.jonbaer.net/jonbaer.asc fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFAmUwDQdvbi5oMr0cRAg+6AKDiQyn3n2zyt02u5+JiEVStTEEOtwCfYt/W ZA36UgdFQ07GEHcej7ZoOkU= =UUA0 -----END PGP SIGNATURE----- From danielc at analysisandsolutions.com Wed May 5 16:25:34 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 5 May 2004 16:25:34 -0400 Subject: [nycphp-talk] MySQL reports that port 3306 is not free. In-Reply-To: <20040505202405.GA8482@panix.com> References: <012a01c432dc$e8ad1e30$e98d3818@oberon1> <20040505202405.GA8482@panix.com> Message-ID: <20040505202534.GB8482@panix.com> On Wed, May 05, 2004 at 04:24:05PM -0400, Daniel Convissor wrote: > > ps | grep mysql Make that ps -a | grep mysql --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From tgales at tgaconnect.com Wed May 5 16:27:06 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 5 May 2004 16:27:06 -0400 Subject: [nycphp-talk] MySQL reports that port 3306 is not free. In-Reply-To: <409949D9.9070306@jonbaer.net> Message-ID: <013001c432df$56021790$e98d3818@oberon1> > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jon Baer > Sent: Wednesday, May 05, 2004 4:09 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] MySQL reports that port 3306 is not free. > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > what does "netstat -a" + "iptables -L" say about 3306? > Thank for the idea -- I think I am just going to have to call their 'guru' who put this thing together. I am tires of playing 'wheel of fortune' trying to find working ports. Thanks again From tgales at tgaconnect.com Wed May 5 16:32:52 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 5 May 2004 16:32:52 -0400 Subject: [nycphp-talk] MySQL reports that port 3306 is not free. In-Reply-To: <20040505202534.GB8482@panix.com> Message-ID: <013101c432e0$247de4f0$e98d3818@oberon1> > On Wed, May 05, 2004 at 04:24:05PM -0400, Daniel Convissor wrote: > > > > ps | grep mysql > > Make that > > ps -a | grep mysql > > --Dan I think on good days mysql.sock shows up in a temp dir. which is not the case today... Tim G. From dcech at phpwerx.net Wed May 5 17:18:32 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 05 May 2004 17:18:32 -0400 Subject: [nycphp-talk] has anyone ever used "exif_thumbnail()" PHP 4.3+? In-Reply-To: <40994BEC.3070402@adnet-sys.com> References: <40994BEC.3070402@adnet-sys.com> Message-ID: <40995A28.1090004@phpwerx.net> Phillip Powell wrote: > The class is being used to literally generate a thumbnail from an > existing image. I read in the PHP manual (see > http://us3.php.net/manual/en/function.exif-thumbnail.php ) that > exif_thumbnail() only extracts embedded thumbnail information from a > TIFF or JPEG image. There is your answer, it will *only* work on an image which has an *embedded* thumbnail, which is not many images. You need to look at the GD or NetPBM or ImageMagick functions for resizing images if you want to be able to reliably create thumbnails. > At this point, however, I am receiving nothing into the $thumbStreamObj > binary stream string variable; it's "empty" (false): Your images almost definitely *do not* contain embedded thumbnails. Dan From dcech at phpwerx.net Wed May 5 17:21:50 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 05 May 2004 17:21:50 -0400 Subject: [nycphp-talk] Caching images problem In-Reply-To: <49A9DEB886049242BA28C484A36C03F15A742E@email.sprout.net> References: <49A9DEB886049242BA28C484A36C03F15A742E@email.sprout.net> Message-ID: <40995AEE.6000104@phpwerx.net> Carlos G. Chiossone wrote: > All the servers are in-house. There is a 3Com switch and a hub between > the servers and us. I wonder if it could be the switch then. Hmm, not likely to be the switch, sounds like it might be put down to IIS weirdness...there may be a caching mechanism at play within IIS... Dan From nyphp at enobrev.com Wed May 5 17:26:46 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Wed, 5 May 2004 17:26:46 -0400 Subject: [nycphp-talk] has anyone ever used "exif_thumbnail()" PHP 4.3+? In-Reply-To: <40995A28.1090004@phpwerx.net> Message-ID: You can embed thumbnails?! How cool is that? Any idea if gd, imageMagick or netpbm can utilize such things? Would be equally sweet if browsers couple access such things. Ah well. Time for a Mexican dinner and a few shots of tequila (El Cantinero on 11th and University if anyone's interested) Happy Cinco De Mayo! Mark From erank at isthmus.com Wed May 5 17:27:22 2004 From: erank at isthmus.com (Eric Rank) Date: Wed, 5 May 2004 16:27:22 -0500 Subject: [nycphp-talk] http headers & measuring size of string in 'bits' References: <4098F45A.9010406@adnet-sys.com> <40993CBD.6030709@att.net><002301c432de$16a8b460$8b01a8c0@DB> <40994C03.5060408@jonbaer.net> Message-ID: <002f01c432e7$c116fd40$8b01a8c0@DB> Thanks for the help Jon, I think I jumped the gun a little bit on this one. Another guy I work with was testing this thing, and it didn't work for him, but it works on all other computers I've tried. But that itself doesn't mean the php is right yet. Thanks Eric ----- Original Message ----- From: "Jon Baer" To: "NYPHP Talk" Sent: Wednesday, May 05, 2004 3:18 PM Subject: Re: [nycphp-talk] http headers & measuring size of string in 'bits' > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > The script could just be timing out with a large amount of records ... > look @ stream_set_timeout for examples, see: > www.php.net/stream_set_timeout. I used this for a large db query once. > > - - Jon > > Eric Rank wrote: > > | Howdy folks, > | > | I'm working on generating a file on the fly by sending headers and echoing > | out the content of the file. The trouble is that the php script that does > | this makes a database query to retrieve the content, and it seems to cause > | problems. Merely echoing out the string if content itself works fine. In > | short, the process looks like this: > > - -- > > pgp key: http://www.jonbaer.net/jonbaer.asc > fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.2 (Cygwin) > Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org > > iD8DBQFAmUwDQdvbi5oMr0cRAg+6AKDiQyn3n2zyt02u5+JiEVStTEEOtwCfYt/W > ZA36UgdFQ07GEHcej7ZoOkU= > =UUA0 > -----END PGP SIGNATURE----- > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From phillip.powell at adnet-sys.com Wed May 5 17:46:58 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Wed, 05 May 2004 17:46:58 -0400 Subject: [nycphp-talk] has anyone ever used "exif_thumbnail()" PHP 4.3+? In-Reply-To: <40995A28.1090004@phpwerx.net> References: <40994BEC.3070402@adnet-sys.com> <40995A28.1090004@phpwerx.net> Message-ID: <409960D2.9040109@adnet-sys.com> Ok, facing both "fully customizable solution" and "manual resizing", I am using the GD library to do so, what would you do in this scenario, would you just come up with an arbitrary size (e.g., 115) and factor the new image size to that, somehow recalculating height and width and presto, new image? Phil Dan Cech wrote: > Phillip Powell wrote: > >> The class is being used to literally generate a thumbnail from an >> existing image. I read in the PHP manual (see >> http://us3.php.net/manual/en/function.exif-thumbnail.php ) that >> exif_thumbnail() only extracts embedded thumbnail information from a >> TIFF or JPEG image. > > > There is your answer, it will *only* work on an image which has an > *embedded* thumbnail, which is not many images. > > You need to look at the GD or NetPBM or ImageMagick functions for > resizing images if you want to be able to reliably create thumbnails. > >> At this point, however, I am receiving nothing into the >> $thumbStreamObj binary stream string variable; it's "empty" (false): > > > Your images almost definitely *do not* contain embedded thumbnails. > > Dan > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From dcech at phpwerx.net Wed May 5 17:49:56 2004 From: dcech at phpwerx.net (Dan Cech) Date: Wed, 05 May 2004 17:49:56 -0400 Subject: [nycphp-talk] has anyone ever used "exif_thumbnail()" PHP 4.3+? In-Reply-To: <409960D2.9040109@adnet-sys.com> References: <40994BEC.3070402@adnet-sys.com> <40995A28.1090004@phpwerx.net> <409960D2.9040109@adnet-sys.com> Message-ID: <40996184.8070705@phpwerx.net> Phillip Powell wrote: > Ok, facing both "fully customizable solution" and "manual resizing", I > am using the GD library to do so, what would you do in this scenario, > would you just come up with an arbitrary size (e.g., 115) and factor the > new image size to that, somehow recalculating height and width and > presto, new image? > > Phil Yes, there are quite a lot of projects out there that do this already, it's not too complicated. http://www.zend.com/zend/spotlight/photogallery-part2.php That should get you started, failing that there is plenty on google. Dan From bpang at bpang.com Wed May 5 18:24:22 2004 From: bpang at bpang.com (bpang at bpang.com) Date: Wed, 5 May 2004 18:24:22 -0400 (EDT) Subject: [nycphp-talk] has anyone ever used "exif_thumbnail()" PHP 4.3+? In-Reply-To: <40996184.8070705@phpwerx.net> References: <40994BEC.3070402@adnet-sys.com> <40995A28.1090004@phpwerx.net><409960D2.9040109@adnet-sys.com> <40996184.8070705@phpwerx.net> Message-ID: <53358.38.117.145.89.1083795862.squirrel@www.bpang.com> Check Chris Snyder's image-list script http://chxo.com/be2/software/imagelistphp.html I've also done this myself (from scratch)... not that hard. > Phillip Powell wrote: > >> Ok, facing both "fully customizable solution" and "manual resizing", I >> am using the GD library to do so, what would you do in this scenario, >> would you just come up with an arbitrary size (e.g., 115) and factor the >> new image size to that, somehow recalculating height and width and >> presto, new image? >> >> Phil > > Yes, there are quite a lot of projects out there that do this already, > it's not too complicated. > > http://www.zend.com/zend/spotlight/photogallery-part2.php > > That should get you started, failing that there is plenty on google. > > Dan > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From phillip.powell at adnet-sys.com Wed May 5 19:06:36 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Wed, 05 May 2004 19:06:36 -0400 Subject: [nycphp-talk] has anyone ever used "exif_thumbnail()" PHP 4.3+? In-Reply-To: <40996184.8070705@phpwerx.net> References: <40994BEC.3070402@adnet-sys.com> <40995A28.1090004@phpwerx.net> <409960D2.9040109@adnet-sys.com> <40996184.8070705@phpwerx.net> Message-ID: <4099737C.3080305@adnet-sys.com> Got it 60% completed. I kept the original method in case the image is JPEG/TIFF with embedded thumbnail info inside, otherwise, it'll default to generateGenericThumb() method which makes a size-proportioned thumbnail (right now at 120 width). Thanx! Now I can go celebrate Cinco do Mayo.. Pero yo no soy mexicano, pero, por que no?! Phil Dan Cech wrote: > Phillip Powell wrote: > >> Ok, facing both "fully customizable solution" and "manual resizing", >> I am using the GD library to do so, what would you do in this >> scenario, would you just come up with an arbitrary size (e.g., 115) >> and factor the new image size to that, somehow recalculating height >> and width and presto, new image? >> >> Phil > > > Yes, there are quite a lot of projects out there that do this already, > it's not too complicated. > > http://www.zend.com/zend/spotlight/photogallery-part2.php > > That should get you started, failing that there is plenty on google. > > Dan > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From tmote at lastmansoftware.com Wed May 5 19:05:08 2004 From: tmote at lastmansoftware.com (Ty R. Mote) Date: Wed, 5 May 2004 18:05:08 -0500 Subject: [nycphp-talk] Typo3 Message-ID: Has anyone used Typo3? (http://www.typo3.org) It seems quite robust but I am interested in speaking with someone who has administered the CMS and even developed some modules. From cmerlo at ncc.edu Wed May 5 19:45:32 2004 From: cmerlo at ncc.edu (Christopher R. Merlo) Date: Wed, 5 May 2004 19:45:32 -0400 Subject: [nycphp-talk] has anyone ever used "exif_thumbnail()" PHP 4.3+? In-Reply-To: References: <40995A28.1090004@phpwerx.net> Message-ID: <20040505234532.GA30287@ncc.edu> On 2004-05-05 17:26 -0400, Mark Armendariz wrote: > You can embed thumbnails?! Yeah, my digital camera does it (and I imagine others do as well). It's all EXIF information - date taken, image size, etc., is all in the EXIF record. > How cool is that? Very. :) -- cmerlo at ncc.edu http://turing.matcmp.ncc.edu/~cmerlo We are sorry, but the number you have dialed is imaginary. Please rotate your phone 90 degrees and try again. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available URL: From smanes at magpie.com Thu May 6 07:33:03 2004 From: smanes at magpie.com (Steve Manes) Date: Thu, 06 May 2004 07:33:03 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: References: Message-ID: <409A226F.4030804@magpie.com> Mark Armendariz wrote: > $20 for even just an upload and configuration is absurd. Even so, 15 days > max says that s/he's looking for some customization. I don't even know of > overseas groups that would do 15 days of work for $20. Besides that, bid > for work sites have the silliest pricing I've ever scene (nothing against > you or your site personally, joel). Here's how: http://www.newtechusa.com/ppi/faq.asp#started From smanes at magpie.com Thu May 6 07:34:50 2004 From: smanes at magpie.com (Steve Manes) Date: Thu, 06 May 2004 07:34:50 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <49A9DEB886049242BA28C484A36C03F15A7421@email.sprout.net> References: <49A9DEB886049242BA28C484A36C03F15A7421@email.sprout.net> Message-ID: <409A22DA.9060909@magpie.com> Carlos G. Chiossone wrote: > Is there a carpentry list we can join? I better start doing something > else! I got the message a few years ago and started learning the home renovation biz. Not much chance of outsourcing this: http://www.magpie.com/house From tgales at tgaconnect.com Thu May 6 07:58:56 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Thu, 6 May 2004 07:58:56 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <409A226F.4030804@magpie.com> Message-ID: <003e01c43361$82c2df30$e98d3818@oberon1> > Here's how: > > http://www.newtechusa.com/ppi/faq.asp#started > Now I know how to get in touch with some 'webmonkeys' now that Webmonkey is reported to be shutting down: "Webmonkey, the site that turned humble Web developers into attention-grabbing authors, said last weekit is closing down following a round of layoffs in the U.S. division of its parent company, Terra Lycos" http://www.wired.com/news/infostructure/0,1377,62300,00.html [dateline: Feb 17, 2004] T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From danielk at us.ibm.com Thu May 6 10:15:36 2004 From: danielk at us.ibm.com (Daniel Krook) Date: Thu, 6 May 2004 10:15:36 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <409A226F.4030804@magpie.com> Message-ID: > Here's how: > > http://www.newtechusa.com/ppi/faq.asp#started "So the rule of thumb is, if you don?t have a tail, you can probably program." Can't argue with that. Despite her name, my cat Tarball is useless when it comes to coding. She can hold her own with Visio and Project though. Daniel Krook, Application Developer WW Web Production Services North 2, ibm.com 1133 Westchester Avenue, White Plains, NY 10604 Personal: http://info.krook.org/ Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 From phillip.powell at adnet-sys.com Thu May 6 11:03:28 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Thu, 06 May 2004 11:03:28 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: References: Message-ID: <409A53C0.8090403@adnet-sys.com> I dispute that. Something had to have created ASP. [evil grin] Phil Daniel Krook wrote: > > > > >>Here's how: >> >>http://www.newtechusa.com/ppi/faq.asp#started >> >> > > >"So the rule of thumb is, if you don?t have a tail, you can probably >program." > >Can't argue with that. Despite her name, my cat Tarball is useless when it >comes to coding. She can hold her own with Visio and Project though. > > > > > > > > > >Daniel Krook, Application Developer >WW Web Production Services North 2, ibm.com >1133 Westchester Avenue, White Plains, NY 10604 > >Personal: http://info.krook.org/ >Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 > > >------------------------------------------------------------------------ > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From nyphp at websapp.com Thu May 6 14:15:37 2004 From: nyphp at websapp.com (Daniel Kushner) Date: Thu, 6 May 2004 14:15:37 -0400 Subject: [nycphp-talk] PHP Training Message-ID: <200405061815.i46IFcqX023172@ns5.oddcast.com> As you all know, there is a New York PHP training session taking place on May 17th - 18th in Manhattan. Only a few places left so please sign up ASAP if you would like to attend. http://nyphp.org/content/training/twodaycourse.php If the location is a problem, there is a similar course delivered by Zend which is online (eLearning) and starts next week! For a special NYPHP discount, please contact me off list at daniel at nyphp.org http://www.zend.com/store/education/zend-online-training.php Best, Daniel From phillip.powell at adnet-sys.com Fri May 7 10:06:38 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Fri, 07 May 2004 10:06:38 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <409A53C0.8090403@adnet-sys.com> References: <409A53C0.8090403@adnet-sys.com> Message-ID: <409B97EE.9040304@adnet-sys.com> Well, it's bad enough that this buyer is not only willing to only pay $20 for 15 day-only work of an entire file management/streaming content management application/display application.. He doesn't want it in PHP because "I'm not happy with PHP at all, maybe it was bad coding, but I want ASP" *sigh* Phil Phillip Powell wrote: > I dispute that. Something had to have created ASP. [evil grin] > > Phil > > Daniel Krook wrote: > >> >> >> >> >>> Here's how: >>> >>> http://www.newtechusa.com/ppi/faq.asp#started >>> >> >> >> >> "So the rule of thumb is, if you don?t have a tail, you can probably >> program." >> >> Can't argue with that. Despite her name, my cat Tarball is useless >> when it >> comes to coding. She can hold her own with Visio and Project though. >> >> >> >> >> >> >> >> >> >> Daniel Krook, Application Developer >> WW Web Production Services North 2, ibm.com >> 1133 Westchester Avenue, White Plains, NY 10604 >> >> Personal: http://info.krook.org/ >> Persona: >> http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=C-0M7P897 >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk >> >> > > -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From tom at supertom.com Fri May 7 11:09:34 2004 From: tom at supertom.com (Tom) Date: Fri, 7 May 2004 08:09:34 -0700 Subject: [nycphp-talk] Dumb Pear Question Message-ID: <200405071509.IAA06620@earth.he.net> Hey Folks, I have what is probably a dumb Pear question. I have been from the PHPLib camp for quite a while now, and am now moving over to using Pear in my development. In PHPLib, there is a Table class, which takes a dataset and builds the table for you. I've extended that class over the years to include search, sortable columns, callback functions, pagination and a few other goodies. I'm looking for the equivalent in Pear. I just tried DB_Table, and was disappointed when I got through the tutorial and discovered that I was left holding the query result and was expected to handle the display myself - I'm too lazy for that! :-) I'm now looking at DB_Pager, but it is old (2002), and DB_DataObject, but I don't think these do this either. I have the "form" stuff handled with HTML_Quickform, but can't seem to locate anything that does what I am looking for recordsets. Any ideas or experience with this? Perhaps someone out there has extended one of these Pear modules and would like to share? Thanks, Tom www.liphp.org - May 31st meeting: SQLite *************************************************** What's Tom listening to right now? Find out here: http://www.supertom.com/current_track.php From mitchy at spacemonkeylabs.com Fri May 7 11:45:50 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Fri, 07 May 2004 11:45:50 -0400 Subject: [nycphp-talk] Dumb Pear Question In-Reply-To: <200405071509.IAA06620@earth.he.net> References: <200405071509.IAA06620@earth.he.net> Message-ID: <409BAF2E.9020902@spacemonkeylabs.com> Tom wrote: > Any ideas or experience with this? Perhaps someone out there has extended one of these Pear modules and would like to share? How 'bout PEAR::HTML_Table? http://pear.php.net/manual/en/package.html.html-table.php Or maybe Pager? http://pear.php.net/manual/en/package.html.pager.php Or maybe even Pager_Sliding? http://pear.php.net/manual/en/package.html.pager-sliding.php HTH, -- Mitch From nyphp at newslogic.com Fri May 7 13:26:06 2004 From: nyphp at newslogic.com (Andy Crain) Date: Fri, 7 May 2004 13:26:06 -0400 Subject: [nycphp-talk] Dumb Pear Question In-Reply-To: <200405071509.IAA06620@earth.he.net> Message-ID: <012e01c43458$64868380$650aa8c0@newslogiyn65wg> Tom, > In PHPLib, there is a Table class, which takes a dataset and builds the > table for you. I've extended that class over the years to include search, > sortable columns, callback functions, pagination and a few other goodies. > > I'm looking for the equivalent in Pear. I just tried DB_Table, and was > disappointed when I got through the tutorial and discovered that I was > left holding the query result and was expected to handle the display > myself - I'm too lazy for that! :-) Also try http://pear.php.net/package/HTML_Table_Matrix and the new http://pear.php.net/package/Structures_DataGrid Good luck, Andy From nhart at musicpf.org Fri May 7 16:34:06 2004 From: nhart at musicpf.org (Nicholas Hart) Date: Fri, 7 May 2004 16:34:06 -0400 Subject: [nycphp-talk] MySQL reports that port 3306 is not free. In-Reply-To: <20040505202534.GB8482@panix.com> Message-ID: <001801c43472$a8c4ea90$0f01a8c0@DC823JN11> I am looking to get an ODBC connection working between linux and a DB2 database on an IBM AS400. Ultimately, I need this to work with PHP. According to the IBM website, this involves installing and configuring unixODBC and I am hoping someone has some experience with this. Any input would be appreciated. Thanks. Nicholas Hart MPF From phillip.powell at adnet-sys.com Fri May 7 18:26:21 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Fri, 07 May 2004 18:26:21 -0400 Subject: [nycphp-talk] inconsistency using "imagegif()": is there a workaround? Message-ID: <409C0D0D.6040408@adnet-sys.com> re: http://us4.php.net/manual/en/function.imagegif.php I have one class method that resizes images, including GIF images, and works just fine doing so, even up to this line: [PHP] eval('image' . $extArray[$type] . '($newImage, "$tmpImageDownloadDir/" . $this->fileName);'); // SAVE TO TEMPORARY IMAGE DIR FOR DOWNLOAD [/PHP] (yes even with.. EVAL!) However, in another class method, THIS line produces the following error: [Quote] Fatal error: Call to undefined function: imagegif() in /www/html/mu-spin/image_catalog/include/classes.inc.php(2262) : eval()'d code on line 1 [/Quote] The line: [PHP] eval('image' . $extArray[$type] . '($newImage, "$this->thumbLocationPath/$this->fileName", $thumbDimensionInt);'); [/PHP] I've taken out the reference to $thumbDimensionInt, to no avail. Same exact error every time, but ONLY for GIF images. But why is it the nearly-identical line in one class method resizes GIF images, but the near very same line in another class method (creates thumbnails) bombs for GIF images? Both work just fine for all other images (i.e., JPG, TIFF, PNG, SWF, BMP, etc.) Thanx Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From danielc at analysisandsolutions.com Fri May 7 19:44:25 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 7 May 2004 19:44:25 -0400 Subject: [nycphp-talk] SecurityFocus issue #247 Message-ID: <20040507234425.GA14662@panix.com> FusionPHP Fusion News Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/10203 Network Query Tool Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/10205 Multiple Protector System Input Validation Vulnerabilities http://www.securityfocus.com/bid/10206 Advanced Guestbook Password Parameter SQL Injection Vulnerab... http://www.securityfocus.com/bid/10209 OpenBB Multiple Input Validation Vulnerabilities http://www.securityfocus.com/bid/10214 OpenBB Private Message Disclosure Vulnerability http://www.securityfocus.com/bid/10217 OpenBB Arbitrary Avatar File Upload Vulnerability http://www.securityfocus.com/bid/10218 PHPWebSite phpwsBB and phpwsContacts Modules Information Dis... http://www.securityfocus.com/bid/10220 PAFileDB ID Variable Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/10229 Admin Access With Levels Plug-in For osCommerce Access Contr... http://www.securityfocus.com/bid/10235 -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From dcech at phpwerx.net Fri May 7 20:51:07 2004 From: dcech at phpwerx.net (Dan Cech) Date: Fri, 07 May 2004 20:51:07 -0400 Subject: [nycphp-talk] inconsistency using "imagegif()": is there a workaround? In-Reply-To: <409C0D0D.6040408@adnet-sys.com> References: <409C0D0D.6040408@adnet-sys.com> Message-ID: <409C2EFB.4080602@phpwerx.net> Phillip Powell wrote: > re: http://us4.php.net/manual/en/function.imagegif.php > > I have one class method that resizes images, including GIF images, and > works just fine doing so, even up to this line: > > eval('image' . $extArray[$type] . '($newImage, "$tmpImageDownloadDir/" . > $this->fileName);'); // SAVE TO TEMPORARY IMAGE DIR FOR DOWNLOAD > > THIS line produces the following error: > > Fatal error: Call to undefined function: imagegif() > Both work just fine for all other images (i.e., JPG, TIFF, PNG, SWF, > BMP, etc.) Did you read the manual page you linked to? GIF is not supported by all version of GD, and I'd be willing to bet yours doesn't support it, hence no imagegif function. Also, using eval like that is just nasty, you should really be doing something more like the example code found on that page and at http://www.php.net/imagetypes Dan >From hans not junk at nyphp.com Sat May 8 00:09:15 2004 Return-Path: Received: from ehost011-1.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 45AA2A86E8 for ; Sat, 8 May 2004 00:09:15 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Worst freelance offer of all time! Date: Fri, 7 May 2004 21:09:07 -0700 Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E43D2D at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Worst freelance offer of all time! Thread-Index: AcQyuHB4idBiQd7ISE6q7fxNJDqCjgB+XsZg From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2004 04:09:15 -0000 > Well, at least it's not a full-time job in California paying=20 > $2-5k a year for LAMP :) >=20 > http://jobsearch.monster.com/getjob.asp?JobID=3D21235904 >=20 > 2,000.00 - 5,000.00 USD /year > Salary Depends on Experience >=20 > "Fast paced internet company seeks an adavnaced PHP=20 > programmer. Must have experience developing web applications=20 > using PHP and MySQL in a Linux environment. >=20 > Candidate must show samples of work and knowledge of job skills. >=20 > Salary will be based upon years of job experience and=20 > programming level." That is quite disgusting. I hope that all PHP developers snub their nose at any such absurdity - otherwise, PHP has a very long way to go. H >From hans not junk at nyphp.com Sat May 8 00:19:01 2004 Return-Path: Received: from ehost011-1.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 863A3A85FE for ; Sat, 8 May 2004 00:19:01 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] RE: [tcphp] Hella fun project I'm about to throw atsome tech col lege students Date: Fri, 7 May 2004 21:18:58 -0700 Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E43D2F at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] RE: [tcphp] Hella fun project I'm about to throw atsome tech col lege students Thread-Index: AcQwrLFfLzyvidRMQYe3NVtQwLombwEBpIHA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2004 04:19:02 -0000 > Hi List. A quick question. I have some categories that are really long > and I would like to re-word or re-format them when I am bring=20 > data in from a DB. Now which would be better: >=20 > Do it with PHP > or > Do it with MySQL This is probably a silly answer, but: -- but if possible, do it in the DB. -- otherwise, select all records from the DB, process in PHP, and reload the DB. Don't forget to lock the database if concurrency is a concern. Sometimes string manipulation is too complex for any database. But, if possible, do the process in the DB with a function or two. If things get too sticky, then a real programming language like PHP is in order. H >=20 > Any suggestions as to how to? >=20 > Example: > A column name: Customer --> VARCHAR > Values in Customer: "USA-North Upper ABVDFR Co. and Sons"=20 >=20 > I would like to re-word it for example: ABVDFR Co. >=20 > I know I could use SUBSTRING or MID, or replace but the issue=20 > is since the column is a VARCHAR, the length of the value may=20 > change from row to row, for > example: one row it maybe 20, in the next 13 and so on so=20 > forth. I also thought that if I could use a length statement=20 > and come up with a formula...but so far no success....any suggestions? >=20 > Thx in Adv. >=20 > RS >=20 >=20 > This e-mail, including attachments, may include confidential=20 > and/or proprietary information, and may be used only by the=20 > person or entity to which it is addressed. If the reader of=20 > this e-mail is not the intended recipient or his or her=20 > authorized agent, the reader is hereby notified that any=20 > dissemination, distribution or copying of this e-mail is=20 > prohibited. If you have received this e-mail in error, please=20 > notify the sender by replying to this message and delete this=20 > e-mail immediately. > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk >=20 >=20 >From hans not junk at nyphp.com Sat May 8 00:20:27 2004 Return-Path: Received: from ehost011-1.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 3ED39A85FE for ; Sat, 8 May 2004 00:20:27 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] Installing PEAR in FreeBSD Date: Fri, 7 May 2004 21:20:24 -0700 Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E43D30 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] Installing PEAR in FreeBSD Thread-Index: AcQu+1kCGjExDCWjRuqwebfZCezruAFuE2BQ From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2004 04:20:27 -0000 > Anyone has gotten PEAR installed in FreeBSD through the port system? > I am getting an error saying that PHP is already installed. I=20 > have looked at some documents on installing it from scratch=20 > and doesn't seem terribly bad, but it would be so much better=20 > to do it from ports... I've always done this by compiling from source, but maybe: make reinstall would help? Maybe even a: make deinstall first, then a make install from the ports. H From lists at mx2pro.com Sat May 8 02:03:11 2004 From: lists at mx2pro.com (Dan Horning) Date: Sat, 8 May 2004 02:03:11 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <41EE526EC2D3C74286415780D3BA9F8701E43D2D@ehost011-1.exch011.intermedia.net> Message-ID: <200405080603.i4863Fre014444@ms-smtp-04.nyroc.rr.com> ya know .. they can't even spell... that's just funny. Dan Horning - Technical Systems Administration http://www.mx2pro.com/ http://dan.mx2pro.com/ 1-518-894-4155 (Personal Direct Line) > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Hans Zaunere > Sent: Saturday, May 08, 2004 12:09 AM > To: NYPHP Talk > Subject: RE: [nycphp-talk] Worst freelance offer of all time! > > > > Well, at least it's not a full-time job in California paying > > $2-5k a year for LAMP :) > > > > http://jobsearch.monster.com/getjob.asp?JobID=21235904 > > > > 2,000.00 - 5,000.00 USD /year > > Salary Depends on Experience > > > > "Fast paced internet company seeks an adavnaced PHP > > programmer. Must have experience developing web applications > > using PHP and MySQL in a Linux environment. > > > > Candidate must show samples of work and knowledge of job skills. > > > > Salary will be based upon years of job experience and > > programming level." > > That is quite disgusting. I hope that all PHP developers snub their > nose at any such absurdity - otherwise, PHP has a very long way to go. > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > >From hans not junk at nyphp.com Sat May 8 21:16:22 2004 Return-Path: Received: from ehost011-1.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 244C7A85E9 for ; Sat, 8 May 2004 21:16:22 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] PHP server app Date: Sat, 8 May 2004 18:16:17 -0700 Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E43DE6 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] PHP server app Thread-Index: AcQu36e6K0FH3N6iSE2loLLI2QZx8gGgxLLw From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2004 01:16:22 -0000 > > > Anyone have experience running a constantly running 'server' app=20 > > > based on php from a linux server? > .... > > Memory leaks may be a problem. You can certainly do it but be=20 > > prepared to restart the thing daily. >=20 > How about using a super daemon like Inetd to call the program=20 > on demand instead of having it up all the time. Should have=20 > some performance degradation, but would solve the memory leak problem. This would make a very interesting article in the upcoming AMPeers. I've run PHP daemons for some time (we're talking several weeks) without any indication of memory leaks. In fact, I even coded a timer in to email me stats of the process so that I could keep an eye on it. At the end of a couple weeks, I brought the process down normally, and all seemed good. In fact, I'm looking to deploy another daemon in PHP. This one will accept considerable network traffic from a remote sensor (using FUID I believe it will be) and then manipulate an inline Apache PHP via MySQL for web page generation (yeah, it's crazy; it's an art project). H From nyphp at enobrev.com Sat May 8 23:24:23 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Sat, 8 May 2004 23:24:23 -0400 Subject: [nycphp-talk] PHP server app In-Reply-To: <41EE526EC2D3C74286415780D3BA9F8701E43DE6@ehost011-1.exch011.intermedia.net> Message-ID: Well ,I'm definitely interested, but nowhere near well schooled enough on the subject. I've been reading quite a bit on it lately (thanks mostly to all the input I've received from a bunch of you). I have posix on my server, but unfortunately not pcntl. I can probably request it, but I figure I should set up something local for such a thing before putting it on my remote server. > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Hans Zaunere > Sent: Saturday, May 08, 2004 9:16 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] PHP server app > > > > > > Anyone have experience running a constantly running > 'server' app > > > > based on php from a linux server? > > .... > > > Memory leaks may be a problem. You can certainly do it but be > > > prepared to restart the thing daily. > > > > How about using a super daemon like Inetd to call the program on > > demand instead of having it up all the time. Should have some > > performance degradation, but would solve the memory leak problem. > > This would make a very interesting article in the upcoming AMPeers. > > I've run PHP daemons for some time (we're talking several > weeks) without any indication of memory leaks. In fact, I > even coded a timer in to email me stats of the process so > that I could keep an eye on it. At the end of a couple > weeks, I brought the process down normally, and all seemed good. > > In fact, I'm looking to deploy another daemon in PHP. This > one will accept considerable network traffic from a remote > sensor (using FUID I believe it will be) and then manipulate > an inline Apache PHP via MySQL for web page generation (yeah, > it's crazy; it's an art project). > > H > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > > From jeff.siegel at nyphp.org Mon May 10 07:30:39 2004 From: jeff.siegel at nyphp.org (Jeff Siegel - PHundamentals) Date: Mon, 10 May 2004 07:30:39 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling Message-ID: <409F67DF.1050403@nyphp.org> "Something can always go wrong in an application so it is essential that your application have an error handler. What types of errors can be safely ignored, and which ones should be trapped by an error handler? What is the best way to handle those errors?" Jeff Siegel & Michael Southwell The PHundamentals Team From tgales at tgaconnect.com Mon May 10 08:38:50 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 10 May 2004 08:38:50 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: <409F67DF.1050403@nyphp.org> Message-ID: <002801c4368b$bf3cbf80$e98d3818@oberon1> Indeed something can always go wrong. Good error handling should take a page out of basic journalism's playbook. when something goes wrong you want to know the five W's -- Who, What, Where, When, and How. Roughly speaking there are three Where's: Hardware (e.g. disk full) OS or system (e.g. a process never gets environment scheduled for some reason -- that is, it doesn't seem to be running for lack of a 'time slice') Software (this includes utility software like a compiler generating some sort of 'wrong stuff' and the developers' logic flaws in the application software) Basically the Who's are determine by what mode the code is running in. For example: kernel mode, user mode etc. The what's are generally governed by the Where's. For instance in unix-like operating systems events may be signaled. On a specific CPU the hardware may 'trap' to a vector interrupt when you try to divide by zero. In application software (or frameworks as well) there will quite likely be a list of possible exceptions. When's are not only the time according to the system clock, but also the order in which things have happened like a misbehaving routine was called just after calling some other routine (generally you can get this type of information from some sort of stack trace). Putting all the W's together show help to come up with an answer for the big 'W' -- WHY did something go wrong? In trying to answer the big W you sometimes can find yourself sounding like a member on a congressional investigation committee. Saying to yourself things like: "What did this routine know -- and when did he know it". T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jeff > Siegel - PHundamentals > Sent: Monday, May 10, 2004 7:31 AM > To: NYPHP Talk > Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling > > > "Something can always go wrong in an application so it is > essential that > your application have an error handler. What types of errors can be > safely ignored, and which ones should be trapped by an error handler? > What is the best way to handle those errors?" > > Jeff Siegel & Michael Southwell > The PHundamentals Team > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk > From tgales at tgaconnect.com Mon May 10 09:16:23 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 10 May 2004 09:16:23 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: <002801c4368b$bf3cbf80$e98d3818@oberon1> Message-ID: <002901c43690$fe535080$e98d3818@oberon1> > In trying to answer the big W you sometimes > can find yourself sounding like a member on > a congressional investigation committee. > Saying to yourself things like: > "What did this routine know -- and when did > he know it". So after performing the 'investigation' you determine the extent of criminal behavior (misdemeanor, felony, etc) -- if any criminal behavior exists. Once you've determined how bad the behavior is, you can let your error handler 'fit the crime'. (this is in response to: "What types of errors can be safely ignored, and which ones should be trapped by an error handler") T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com > > -----Original Message----- > > From: talk-bounces at lists.nyphp.org > > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jeff Siegel - > > PHundamentals > > Sent: Monday, May 10, 2004 7:31 AM > > To: NYPHP Talk > > Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling > > > > > > "Something can always go wrong in an application so it is essential > > that your application have an error handler. What types of > errors can > > be safely ignored, and which ones should be trapped by an error > > handler? What is the best way to handle those errors?" From phillip.powell at adnet-sys.com Mon May 10 09:20:22 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Mon, 10 May 2004 09:20:22 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <41EE526EC2D3C74286415780D3BA9F8701E43D2D@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F8701E43D2D@ehost011-1.exch011.intermedia.net> Message-ID: <409F8196.80905@adnet-sys.com> Hans Zaunere wrote: >>Well, at least it's not a full-time job in California paying >>$2-5k a year for LAMP :) >> >>http://jobsearch.monster.com/getjob.asp?JobID=21235904 >> >>2,000.00 - 5,000.00 USD /year >>Salary Depends on Experience >> >>"Fast paced internet company seeks an adavnaced PHP >>programmer. Must have experience developing web applications >>using PHP and MySQL in a Linux environment. >> >>Candidate must show samples of work and knowledge of job skills. >> >>Salary will be based upon years of job experience and >>programming level." >> >> > >That is quite disgusting. I hope that all PHP developers snub their >nose at any such absurdity - otherwise, PHP has a very long way to go. > >H > >_______________________________________________ >talk mailing list >talk at lists.nyphp.org >http://lists.nyphp.org/mailman/listinfo/talk > > > I personally think it's a misprint, either that or someone's exploiting someone. I mean, janitors, er, sanitation engineers, make more than that even in the poorer ports of the country! Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From jeff.siegel at nyphp.org Mon May 10 09:17:02 2004 From: jeff.siegel at nyphp.org (Jeff Siegel - PHundamentals) Date: Mon, 10 May 2004 09:17:02 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: <002801c4368b$bf3cbf80$e98d3818@oberon1> References: <002801c4368b$bf3cbf80$e98d3818@oberon1> Message-ID: <409F80CE.9050006@nyphp.org> Can you narrow this down in the context of PHP programming? Not everything may be relevant (or maybe it is?) in the context of building/programming a website. Jeff Tim Gales wrote: > Indeed something can always go wrong. > > Good error handling should take a page > out of basic journalism's playbook. > > when something goes wrong you want to > know the five W's -- > > Who, What, Where, When, and How. > > Roughly speaking there are three Where's: > > Hardware (e.g. disk full) > OS or system (e.g. a process never gets > environment scheduled for some reason -- > that is, it doesn't seem to > be running for lack of a > 'time slice') > Software (this includes utility software > like a compiler generating > some sort of 'wrong stuff' and > the developers' logic flaws in > the application software) > > Basically the Who's are determine by what > mode the code is running in. For example: > kernel mode, user mode etc. > > The what's are generally governed by the > Where's. For instance in unix-like operating > systems events may be signaled. On a specific > CPU the hardware may 'trap' to a vector > interrupt when you try to divide by zero. > > In application software (or frameworks as well) > there will quite likely be a list of possible > exceptions. > > When's are not only the time according to > the system clock, but also the order in > which things have happened like a misbehaving > routine was called just after calling some > other routine (generally you can get this > type of information from some sort of > stack trace). > > Putting all the W's together show help > to come up with an answer for the big 'W' -- > WHY did something go wrong? > > In trying to answer the big W you sometimes > can find yourself sounding like a member on > a congressional investigation committee. > Saying to yourself things like: > "What did this routine know -- and when did > he know it". > > > T. Gales & Associates > 'Helping People Connect with Technology' > > http://www.tgaconnect.com > > > >>-----Original Message----- >>From: talk-bounces at lists.nyphp.org >>[mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jeff >>Siegel - PHundamentals >>Sent: Monday, May 10, 2004 7:31 AM >>To: NYPHP Talk >>Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling >> >> >>"Something can always go wrong in an application so it is >>essential that >>your application have an error handler. What types of errors can be >>safely ignored, and which ones should be trapped by an error handler? >>What is the best way to handle those errors?" >> >>Jeff Siegel & Michael Southwell >>The PHundamentals Team >> >> >>_______________________________________________ >>talk mailing list >>talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk >> > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From phillip.powell at adnet-sys.com Mon May 10 09:45:15 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Mon, 10 May 2004 09:45:15 -0400 Subject: [nycphp-talk] Best alternative to imagegif()? Message-ID: <409F876B.8090906@adnet-sys.com> My application has no problem doing image resizing to any other type of image, except, obviously for GIF images, since imagegif() is not [yet] fully supported by GD (based on what I read at http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=0p6l909ujs8bdqjtu4r9j6asn8tjqel3rv%404ax.com and plenty of weekend personal experience in hair-tearing-out). What would be the experts' best suggestion for an alternative to imagegif(), bearing in mind that everything else works thus far. Thanx Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From tgales at tgaconnect.com Mon May 10 10:29:25 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 10 May 2004 10:29:25 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: <409F80CE.9050006@nyphp.org> Message-ID: <002a01c4369b$340b67d0$e98d3818@oberon1> > Can you narrow this down in the context of PHP programming? > Not everything may be relevant (or maybe it is?) in the context of > building/programming a website. > > Jeff I guess I was jumping ahead a bit in thinking it might be nice to develop an error handling class structure in the article to show how error handling decisions might be implemented. The granddaddy class would be rather abstract. It would have member variables correlating to the five W's. The 'abstract' class would be extended to take care of more specific situations. But in general all the descendant classes would have inherited methods for dealing with felonies, misdemeanors, and ethical infractions and perhaps a method for granting immunity (especially on a 'quid pro quo' basis for more information leading to an indictment of other guilty routines) The methods would be just overloaded -- whoops, pardon me, I mean extended to deal with the specifics of each of the more specialized classes (and their environments). Maybe there could be classes for Linux, Windows, HP-UX, BSD, etc. directly inheriting from the base class. And an Apache class and maybe a an IIS class. Towards the end of the line you might have a PHP error class and an Application error class. Something like this: Err_class Err_Linux Err_Apache Err_PHP Err_App_Framework Err_demo (the class in the article) You could make a simplified framework (really just for demonstrating the ideas in the article) and extend the framework class to handle things that can go wrong with some mini-app. (again the mini-app using the Err_demo class) would exist mainly to demonstrate the ideas in the article -- but might indicate how you could do something useful) This kind of article would be a major departure from most articles that often include comments in the code saying something like // handle exceptions here... Further, regular readers of PHundamentals could become familiar with the (admittedly over simplified) (PHundamental ?) error handling framework. And you could put in some realistic (and concrete) error handling code snippets to indicate things that might go wrong (as a danger signs for potential problems) in future article example code using the error framework that readers have gotten accustomed to -- rather than vague comments which remind readers that 'Something can always go wrong'. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From tgales at tgaconnect.com Mon May 10 11:02:50 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 10 May 2004 11:02:50 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: <002a01c4369b$340b67d0$e98d3818@oberon1> Message-ID: <002d01c4369f$ddbae6d0$e98d3818@oberon1> > ...dealing with felonies, > misdemeanors, and ethical infractions and > perhaps a method for granting immunity (especially > on a 'quid pro quo' basis for more information > leading to an indictment of other guilty routines) This comes from a technique (questioning routines for 'what they knew and when they knew it') which I have been using informally for quite some time now. I call it the 'Senate Hearing Investigative Technique'. When things break, I sometimes have to go through a whole lot of 'S.H.I.T.' to fix them. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From dmintz at davidmintz.org Mon May 10 11:55:20 2004 From: dmintz at davidmintz.org (David Mintz) Date: Mon, 10 May 2004 11:55:20 -0400 (EDT) Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: <002d01c4369f$ddbae6d0$e98d3818@oberon1> References: <002d01c4369f$ddbae6d0$e98d3818@oberon1> Message-ID: No discussion is complete without mentioning PHP's native error and logging functions (http://us3.php.net/manual/en/ref.errorfunc.php), especially set_error_handler(), error_reporting(), trigger_error() No discussion is complete without mentioning PEAR_Error which offers a lot of flexible and convenient means of error handling (http://pear.php.net/manual/en/core.pear.pear-error.php) One of the criticims of languages that don't have real exception handling (try/catch/finally) is that checking the return value of every call gets tedious and hard to read. One of the things I like about Pear is that you can set an error handling callback function, and then go ahead and run a few lines of e.g. database stuff without bothering line-by-line. Another point that bears mentioning -- since this is a Fundies thread -- is whether and how much error output to display it the browser in development versus production, from the security standpoint as well as style. Development: verbose and informative. Production: apologetic and vague. Perhaps it also bears mentioning by way of Fundies that if you have error reporting on and warnings on, you can still supress error output on a per-function-call basis by prepending an @ to the function name. I would (and could) elaborate on all of the above but I just wanted to get a shot in before someone else beat me to it (-: --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 From rahmin at insite-out.com Mon May 10 12:06:24 2004 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Mon, 10 May 2004 12:06:24 -0400 Subject: [nycphp-talk] input..select help Message-ID: <200405101606.i4AG6OSX005258@webmail3.megamailservers.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From danielc at analysisandsolutions.com Mon May 10 12:11:27 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 10 May 2004 12:11:27 -0400 Subject: [nycphp-talk] input..select help In-Reply-To: <200405101606.i4AG6OSX005258@webmail3.megamailservers.com> References: <200405101606.i4AG6OSX005258@webmail3.megamailservers.com> Message-ID: <20040510161126.GA5273@panix.com> On Mon, May 10, 2004 at 12:06:24PM -0400, Rahmin Pavlovic wrote: > > Which worked fairly quickly, however it also imported entries from > table_a that already exist in table_b. If you need to ensure records are unique, use primary and/or unique indexes on the columns in question. Doing this gets the database to automatically reject duplicates for you. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From ashaw at iifwp.org Mon May 10 12:14:29 2004 From: ashaw at iifwp.org (Allen Shaw) Date: Mon, 10 May 2004 12:14:29 -0400 Subject: [nycphp-talk] input..select help References: <200405101606.i4AG6OSX005258@webmail3.megamailservers.com> <20040510161126.GA5273@panix.com> Message-ID: <010801c436a9$df71da10$7801a8c0@iifwp.local> > If you need to ensure records are unique, use primary and/or unique > indexes on the columns in question. Doing this gets the database to > automatically reject duplicates for you. That, plus using IGNORE ("insert IGNORE into table_b(field1,field2) ...") will have MySQL insert all non-duplicate records without choking on the dupes. - Allen ----- Original Message ----- From: "Daniel Convissor" To: "NYPHP Talk" Sent: Monday, May 10, 2004 12:11 PM Subject: Re: [nycphp-talk] input..select help > On Mon, May 10, 2004 at 12:06:24PM -0400, Rahmin Pavlovic wrote: > > > > Which worked fairly quickly, however it also imported entries from > > table_a that already exist in table_b. > > If you need to ensure records are unique, use primary and/or unique > indexes on the columns in question. Doing this gets the database to > automatically reject duplicates for you. > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From rahmin at insite-out.com Mon May 10 12:39:52 2004 From: rahmin at insite-out.com (Rahmin Pavlovic) Date: Mon, 10 May 2004 12:39:52 -0400 Subject: [nycphp-talk] input..select help Message-ID: <200405101639.i4AGdqSX006914@webmail3.megamailservers.com> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From crisscott at netzero.com Mon May 10 13:00:47 2004 From: crisscott at netzero.com (Scott Mattocks) Date: Mon, 10 May 2004 13:00:47 -0400 Subject: [nycphp-talk] input..select help In-Reply-To: <200405101606.i4AG6OSX005258@webmail3.megamailservers.com> References: <200405101606.i4AG6OSX005258@webmail3.megamailservers.com> Message-ID: <409FB53F.8000009@netzero.com> Rahmin Pavlovic wrote: > insert into table_b(field1,field2) select table_a.field1, table_a.field2 from table_a > > Which worked fairly quickly, however it also imported entries from table_a that already exist in table_b. > So I'm wondering if someone could help me figure out how to just grab the new entries from table_a. Try something like this: INSERT INTO table_b (field1, field2) (SELECT table_a.field1, table_a.field2 FROM table_a LEFT JOIN table_b ON (table_a.field1 = table_b.field1 AND table_a.field2 = table_b.field2) WHERE table_b.field1 IS NULL AND table_b.field2 IS NULL) I would try the select first to make sure that it will get you everything in table_a that isn't already in table_b. And then if you like the results from that add the insert part to the begining. Scott Mattocks From jsiegel1 at optonline.net Mon May 10 13:33:13 2004 From: jsiegel1 at optonline.net (Jeff Siegel) Date: Mon, 10 May 2004 13:33:13 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: References: <002d01c4369f$ddbae6d0$e98d3818@oberon1> Message-ID: <409FBCD9.9070300@optonline.net> Putting PEAR aside for the moment, how should someone use those three PHP functions? For example, if someone uses trigger_error(), then what? Jeff S. David Mintz wrote: > > No discussion is complete without mentioning PHP's native error and > logging functions (http://us3.php.net/manual/en/ref.errorfunc.php), > especially set_error_handler(), error_reporting(), trigger_error() > > No discussion is complete without mentioning PEAR_Error which offers a lot > of flexible and convenient means of error handling > (http://pear.php.net/manual/en/core.pear.pear-error.php) > > One of the criticims of languages that don't have real exception handling > (try/catch/finally) is that checking the return value of every call gets > tedious and hard to read. One of the things I like about Pear is that you > can set an error handling callback function, and then go ahead and run a > few lines of e.g. database stuff without bothering line-by-line. > > Another point that bears mentioning -- since this is a Fundies thread -- > is whether and how much error output to display it the browser in > development versus production, from the security standpoint as well as > style. Development: verbose and informative. Production: apologetic and > vague. > > Perhaps it also bears mentioning by way of Fundies that if you have error > reporting on and warnings on, you can still supress error output on a > per-function-call basis by prepending an @ to the function name. > > > I would (and could) elaborate on all of the above but I just wanted to get > a shot in before someone else beat me to it (-: > > --- > David Mintz > http://davidmintz.org/ > > "Anybody else got a problem with Webistics?" -- Sopranos 24:17 > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From nyphp at enobrev.com Mon May 10 13:53:30 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Mon, 10 May 2004 13:53:30 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: Message-ID: Speaking of php's inherent error functions, has anyone ever tried building a try/catch/throw sytem of sorts using php's current error handling? I've personally never run across one. Mark > > No discussion is complete without mentioning PHP's native > error and logging functions > (http://us3.php.net/manual/en/ref.errorfunc.php), > especially set_error_handler(), error_reporting(), trigger_error() > --- > David Mintz > http://davidmintz.org/ From tgales at tgaconnect.com Mon May 10 14:10:26 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Mon, 10 May 2004 14:10:26 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: Message-ID: <004801c436ba$1298b070$e98d3818@oberon1> > Speaking of php's inherent error functions, has anyone ever > tried building a try/catch/throw sytem of sorts using php's > current error handling? I've personally never run across one. > > Mark You could have a look at some of the code in cowiki. * coWiki - includes/cowiki/class/core/class.RuntimeContext.php * $Id: class.RuntimeContext.php,v 1.43 2003/10/12 03:31:13 dtg Exp $ The class.RuntimeContext.php has something that might interest you around the function putToCache. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From adam at trachtenberg.com Mon May 10 14:26:12 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 10 May 2004 14:26:12 -0400 (EDT) Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: References: Message-ID: On Mon, 10 May 2004, Mark Armendariz wrote: > Speaking of php's inherent error functions, has anyone ever tried building a > try/catch/throw sytem of sorts using php's current error handling? I've > personally never run across one. Why would you do that when PHP 5 supports try/catch/throw? Seems easier to upgrade to PHP 5. :) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From shiflett at php.net Mon May 10 14:33:02 2004 From: shiflett at php.net (Chris Shiflett) Date: Mon, 10 May 2004 11:33:02 -0700 (PDT) Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: Message-ID: <20040510183302.4664.qmail@web14306.mail.yahoo.com> --- Adam Maccabee Trachtenberg wrote: > Why would you do that when PHP 5 supports try/catch/throw? Seems > easier to upgrade to PHP 5. :) That's what I was thinking. Now if I only had a book to help me with my upgrade... :-) Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ From danielc at analysisandsolutions.com Mon May 10 14:33:20 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 10 May 2004 14:33:20 -0400 Subject: [nycphp-talk] input..select help In-Reply-To: <409FB53F.8000009@netzero.com> References: <200405101606.i4AG6OSX005258@webmail3.megamailservers.com> <409FB53F.8000009@netzero.com> Message-ID: <20040510183319.GA29758@panix.com> On Mon, May 10, 2004 at 01:00:47PM -0400, Scott Mattocks wrote: > > INSERT INTO table_b (field1, field2) > (SELECT table_a.field1, table_a.field2 > FROM table_a > LEFT JOIN table_b > ON (table_a.field1 = table_b.field1 > AND > table_a.field2 = table_b.field2) > WHERE table_b.field1 IS NULL > AND table_b.field2 IS NULL) While that would stop records already in table_b from being copied from table_a, it would not stop duplicate records in table_a going into table_b. You could throw in a GROUP BY clause to take care of that. All that aside, adding primary/unique keys is the way to go. If tables already have duplicates but aren't keyed, like the original poster said, then you've got to mysqldump the data, drop the old table, change the table structure in the dumpped SQL data to add the indexes needed and then rebuild/import the table/data. Use the -f command line option that keeps SQL errors from stopping execution. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From nyphp at enobrev.com Mon May 10 14:53:02 2004 From: nyphp at enobrev.com (Mark Armendariz) Date: Mon, 10 May 2004 14:53:02 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: Message-ID: > Why would you do that when PHP 5 supports try/catch/throw? > Seems easier to upgrade to PHP 5. :) Well that will definitely help *here, but I figure if I want to start moving in that general direction, I'll want to overall, including on client servers which will probably run 4.3 for at least few more months. > The class.RuntimeContext.php has something that might > interest you around the function putToCache. Very interesting, I'll definitely take a look. Thanks! Mark From adam at trachtenberg.com Mon May 10 15:05:29 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 10 May 2004 15:05:29 -0400 (EDT) Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: References: Message-ID: On Mon, 10 May 2004, Mark Armendariz wrote: > > Why would you do that when PHP 5 supports try/catch/throw? > > Seems easier to upgrade to PHP 5. :) > > Well that will definitely help *here, but I figure if I want to start moving > in that general direction, I'll want to overall, including on client servers > which will probably run 4.3 for at least few more months. You can probably replicate some functionality of exceptions in PHP 4.3, but it'll very coarse grained. For instance, if all you want to do is bail out to an error handling section, then you can do that. However, I doubt you can replicate more subtle features, like exception bubbling. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From adam at trachtenberg.com Mon May 10 15:07:06 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Mon, 10 May 2004 15:07:06 -0400 (EDT) Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: <20040510183302.4664.qmail@web14306.mail.yahoo.com> References: <20040510183302.4664.qmail@web14306.mail.yahoo.com> Message-ID: On Mon, 10 May 2004, Chris Shiflett wrote: > --- Adam Maccabee Trachtenberg wrote: > > Why would you do that when PHP 5 supports try/catch/throw? Seems > > easier to upgrade to PHP 5. :) > > That's what I was thinking. Now if I only had a book to help me with my > upgrade... :-) Oddly enough, this is the last chapter standing between me and book writing freedom. We're involved in a stare down over how to best order the material. :) -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From lists at natserv.com Mon May 10 18:57:55 2004 From: lists at natserv.com (Francisco Reyes) Date: Mon, 10 May 2004 18:57:55 -0400 (EDT) Subject: [nycphp-talk] Installing PEAR in FreeBSD In-Reply-To: <41EE526EC2D3C74286415780D3BA9F8701E43D30@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F8701E43D30@ehost011-1.exch011.intermedia.net> Message-ID: <20040510185441.V80997@zoraida.natserv.net> On Fri, 7 May 2004, Hans Zaunere wrote: > > Anyone has gotten PEAR installed in FreeBSD through the port system? > > I am getting an error saying that PHP is already installed. I > I've always done this by compiling from source, but maybe: Have been considering that option. > make reinstall Will try. > would help? Maybe even a: > make deinstall The pear port is never installed so that won't work. It is also a problem in FreeBSD to install from Ports the mod_php and php CLI ports at the same time. I think this is why Pear may be failing. I am rebuilding my play box after a HD crash and I will experiment more thene. Amongst the options I am considering so far is to install the CLI on the play/test box and then make a tar of the files an copy them over to the production box. Then manually change php.ini and anything else... Although most likely my first option will be trying to install Pear by manually and see if that is not too much work. >From hans not junk at nyphp.com Mon May 10 21:19:16 2004 Return-Path: Received: from ehost011-1.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id AED61A862D for ; Mon, 10 May 2004 21:19:16 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] NEW PHundamentals Question - Error Handling Date: Mon, 10 May 2004 18:19:12 -0700 Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E444A3 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] NEW PHundamentals Question - Error Handling Thread-Index: AcQ2mzPsT014oPTKTiOkn7Y+s9/0ygACmMnA From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2004 01:19:17 -0000 > The granddaddy class would be rather=20 > abstract. It would have member variables=20 > correlating to the five W's. >=20 > The 'abstract' class would be extended to=20 > take care of more specific situations. >=20 > But in general all the descendant classes would have=20 > inherited methods for dealing with felonies,=20 > misdemeanors, and ethical infractions and=20 > perhaps a method for granting immunity (especially=20 > on a 'quid pro quo' basis for more information=20 > leading to an indictment of other guilty routines) > The methods would be just overloaded -- whoops,=20 > pardon me, I mean extended to deal with the specifics=20 > of each of the more specialized classes=20 > (and their environments). I think it's much simpler; usually, over-abstraction is a bad thing. The original PHundamentals seed was this: "Something can always go wrong in an application so it is essential that your application have an error handler. What types of errors can be=20 safely ignored, and which ones should be trapped by an error handler?=20 What is the best way to handle those errors?" I think the always important distinction of development vs production is again vital when talking about error handling. The first rule of error handling, in my view is to be alerted of ALL errors, notices, warnings, etc. As such, in php.ini I always have: error_reporting =3D E_ALL or if I can't modify my php.ini: error_reporting(E_ALL); is set in the top level include of my application. I do this for both dev and production environments (it's often more important in dev). I also ensure display_errors is off and log_errors is on. This is all automatically set correctly if you use php.ini-recommended By default, with log_errors set to on, errors go to the Apache error logs. So: tail -f /var/log/www/mydomain.com/error_log (or whatever the path obviously) will show all signs of errors, as they happen, without splashing errors to the browser. Even in development, errors dumped to the browser are bad because they can become hidden in the HTML. So, the big question; what is safe to ignore? Basically, nothing. I always code so that I never have any warnings about uninitialized variables, which is a common error (actually, notice) to ignore. I admit, there are times - like when repopulating form values on small sites - when I will suppress an uninitialized variable using a @ if I'm sure a NULL or 0 value will be handled correctly. It's good practice to not throw any "sloppy" errors in your application, and under any states of the page; this is "PHundamentally" good programming. So what about "non-sloppy" errors; or those errors caused by an exceptional or unexpected condition? For one, there are two sides to this; what the user (browser) sees, and what the maintainer (developer) sees. Always - *always* - show a generic error to the user. If the database is offline, don't say "Our database is currently offline" but rather "System under maintenance". If the system is about to crash and PHP's core has become horribly corrupted: "System under maintenance" This does two things. One, it makes it harder for crackers to fiddle with your application - they never really know what they're doing or what affect it has. Two, it makes error handling much simpler and eliminates complex class abstractions and hierarchies. In most cases, these bits of code is what I use: set_error_handler('myhandler'); if( $majorproblem ) { trigger_error('This is a major problem',E_USER_ERROR); } Then, the myhandler() function could look like: function myhandler( $message,$code ) { mail('siteadmin at domain.com','MAJOR PROBLEM at'.time(),trigger_dump($GLOBALS)); error_log('MAJOR PROBLEM at '.time().trigger_dump($GLOBALS)); go2('/error.php'); exit; } I know that code won't really work and is horribly sloppy; if anyone wants real code, let me know. go2() is part of the this_server PCOM (http://pcomd.net/this_server) to handler redirections and trigger_dump() is the PCOM at http://pcomd.net/trigger_dump as a wrapper for dumping variables. While many are probably shocked by the no-frills approach to this error handling scheme, it's all I've never needed. It's very "un-enterprise" I know. Look at it this way, when something goes wrong: -- you need to know the state of the application; trigger_dump($GLOBALS) -- you need to know when it happened; time() -- you need to know that it happened; mail() -- you need to have a record of the above three items; error_log() -- you need to prevent the user from knowing any of this, except that it happened; go2() I'm also curious as to other's approach. Granted, in PHP 5 we'll have exceptions - which are a great thing - but doesn't really change that much. Exceptions are for *detecting* errors, no handling after the fact. I'm curious as to other's thoughts. H >From hans not junk at nyphp.com Mon May 10 21:51:29 2004 Return-Path: Received: from ehost011-1.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 71F57A862D for ; Mon, 10 May 2004 21:51:29 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] re: Wiki anti-spam CAPTCHA patch: $_SESSION conflict Date: Mon, 10 May 2004 18:51:25 -0700 Message-ID: <41EE526EC2D3C74286415780D3BA9F8701E444B5 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] re: Wiki anti-spam CAPTCHA patch: $_SESSION conflict Thread-Index: AcQuytUedhhNudgjSOSQmiKtabR/QgIL4BMw From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2004 01:51:29 -0000 > I just found an answer to my own question. I used=20 > session_name() to rename the session. >=20 > The funny thing is that on Windows (my local test machine)=20 > having two scripts accessing a session with the same name did=20 > not cause a problem, whereas on the Linux production server it did. >=20 > On both session autostart is turned off ... >=20 > I am not sure why Win and Lin reacted differently here. Bam... another good topic for an article? This would be quite a tricky article, though, since the difference can be very subtle and complex. Good it's resolved Jayesh, H From danielc at analysisandsolutions.com Tue May 11 01:01:32 2004 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Tue, 11 May 2004 01:01:32 -0400 Subject: [nycphp-talk] #248 of security focus Message-ID: <20040511050132.GA13165@panix.com> Hi: Have you ever noticed that when someone is sloppy in one place, they're probably sloppy in loads of others? Well, this seems to hold true when it comes to the people responsible for buggy code. When reading the SF newsletter I need to determine if the reported package uses PHP. Many of the websites of the software in question don't say right up front which language the application is written in or even what their pacakge does. Oy. SquirrelMail Folder Name Cross-Site Scripting Vulnerability http://www.securityfocus.com/bid/10246 Moodle Cross Site Scripting Vulnerability http://www.securityfocus.com/bid/10251 Coppermine Photo Gallery Multiple Input Validation Vulnerabi... http://www.securityfocus.com/bid/10253 PROPS SQL Injection and Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/10258 JelSoft VBulletin Forum Creation HTML Injection Vulnerabilit... http://www.securityfocus.com/bid/10280 Simple Machines Forum Size Tag HTML Injection Vulnerability http://www.securityfocus.com/bid/10281 PHPNuke Modules.php Multiple SQL Injection Vulnerabilities http://www.securityfocus.com/bid/10282 PHPX Multiple Cross-Site Scripting Vulnerabilities http://www.securityfocus.com/bid/10283 PHPX Multiple Administrator Command Execution Vulnerability http://www.securityfocus.com/bid/10284 e107 Website System Multiple Script HTML Injection Vulnerabi... http://www.securityfocus.com/bid/10293 -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 From jayeshsh at ceruleansky.com Tue May 11 22:38:23 2004 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Tue, 11 May 2004 22:38:23 -0400 Subject: [nycphp-talk] re: Wiki anti-spam CAPTCHA patch: $_SESSION conflict Message-ID: <40A18E1F.8050300@ceruleansky.com> Hi Hans, thanks for the followup on my previous session-conflict thread. I think what was happening was that on Windows my session files could be renamed / overwritten, but on a (shared) Linux server that did not work. I might be wrong about this though ... Also, a good topic for a Phundamentals article might be incorporating anti-spam measures (such as Captcha code generators) into web applications / scripts (e.g. Wikis, blog comment forms, email-this-page forms, etc). Best Regards, - Jay From jayeshsh at ceruleansky.com Tue May 11 23:12:07 2004 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Tue, 11 May 2004 23:12:07 -0400 Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling Message-ID: <40A19607.2060203@ceruleansky.com> Hi all, Here is what I did recently for error handling within a (PHP 4) class. (This was for a redesign of a class that was originally written out of the need to collect 10 - 20 separate functions, all having resided in different files.) By the name, the naming scheme I use for class names and methods (functions) is unconventional - all lower case. This class's functionality has been fictionalized for your (and my) enjoyment. I am not sure if the way I do it is good or bad, but you can definitely let me know what you think. class appreciate_life { var $bitterness; // on a scale of 0 to 10 var $sweetness; // on a scale of 0 to 10 var $satisfaction; // how satisfied you are var $harddrivehealth; // on a scale of 0 to 10 var $freshairintake; // on a scale of 0 to 10 var $oopsies = array(); // errors var $oopsies4devs = array(); // debug messages // constructor function appreciate_life($bitterness, $sweetness, $harddrivehealth, $freshairintake) { $this->bitterness = $bitterness; $this->sweetness = $sweetness; $this->harddrivehealth = $harddrivehealth; $this->freshairintake = $freshairintake; } function measure_life_satisfaction() { if ($harddrivehealth < 0 || $freshairintake < 0) { $this->oopsies['warning_get_out_more'] = "Your hard drive just went kaput or you have been staring at that computer screen too long. Forget the computer and go to the Japanese pond at the Brooklyn Botanic Garden."; $this->oopsies4devs['take_user_on_walk'] = "This user needs to be taken on a walk."; } else if ( $this->sweetness > $this->bitterness ) { return "

Bravo! You are one happy (wo)man!

"; } else { return "

Life sure sucks, huh? If life is a lemon, maybe you can make some lemonade from it ...

"; } } function is_okay() { if ( count($this->oopsies) > 0 || count($this->oopsies4devs) > 0) { return false; } else { return true; } } function print_error_messages() { /* retrieve contents of $this->oopsies array and format them for display */ } function print_debug_messages() { /* retrieve contents of $this->oopsies4devs array and format them for display */ } } /* Instantiation */ $debug = 0; $life = new appreciate_life(5, 6, -1, -10); $sat_level = $life->measure_life_satisfaction(); echo $sat_level; if ( ! $life->is_okay() ) { if ( ! empty($debug) ) { $life->print_debug_messages(); } $life->print_error_messages(); } /* End */ I don't know if that made much sense at all - but I am way past my bedtime, so that is why I am a bit ... delirious. - Jay From jayeshsh at ceruleansky.com Tue May 11 23:20:18 2004 From: jayeshsh at ceruleansky.com (Jayesh Sheth) Date: Tue, 11 May 2004 23:20:18 -0400 Subject: [nycphp-talk] reporting hosting fraud (off-topic) Message-ID: <40A197F2.3040702@ceruleansky.com> Hello all, This is a bit of an off-topic question, but I did not know where else to ask. To make a long story short, it seems that an individual or group of individuals is responsible for setting up a series of hosting companies under fake names and then prompting over charging customers before going under. I have been in contact with at least one defrauded customer who has lost data and money, and heard from many more at webhostingtalk.com. I have written about the matter on my weblog: http://www.moztips.com/index.php?id=229 To which authority (FBI, BBB) should I report this case of suspected fraud? Should I also report it also to the press? Thanks in advance. - Jay From tgales at tgaconnect.com Wed May 12 07:54:05 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Wed, 12 May 2004 07:54:05 -0400 Subject: [nycphp-talk] Processing XML Documents with PHP 5 Message-ID: <002801c43817$d422a4e0$e98d3818@oberon1> Processing Large XML Documents with PHP 5 - Update Christian Stocker, May 10, 2004 at: http://blog.bitflux.ch/p1697.html May be of interest to readers of this list. T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From jeffknight at mac.com Wed May 12 09:49:53 2004 From: jeffknight at mac.com (putamare) Date: Wed, 12 May 2004 09:49:53 -0400 Subject: [nycphp-talk] Development Meeting: Important Change Message-ID: <3ED6E98C-A41B-11D8-9EDE-003065F9A07A@mac.com> An important piece of information is missing from the NYPHP.org homepage's invitation to tonight's development meeting. While all are welcome to the meeting, no one will be granted entrance into the building the meeting is being held unless their name is on a list. If you plan on attending, make sure you RSVP with your full name to jeff.knight at nyphp.org before 4PM today, or you will be turned away at the door. From phillip.powell at adnet-sys.com Wed May 12 09:58:32 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Wed, 12 May 2004 09:58:32 -0400 Subject: [nycphp-talk] Worst freelance offer of all time! In-Reply-To: <409F8196.80905@adnet-sys.com> References: <41EE526EC2D3C74286415780D3BA9F8701E43D2D@ehost011-1.exch011.intermedia.net> <409F8196.80905@adnet-sys.com> Message-ID: <40A22D88.8030007@adnet-sys.com> Just for laughs I had to include the details of the 15-day $20 project: Dear Bidders, 1. The new website needs to be coded preferably in asp. All pages need to be linked to one another. 2. I need an internet radio for the website so that when a member chooses a genre of music, media player will automatically open and start to play that specific genre of music, but only the music of our members that will be played by random. We will have further discussion on this. 3. A rating system where members will be able to rate other members. 4. Another rating system where members will be able to vote for their favorite members and whomever gets the most votes in their genre will be placed on our top 10 list. 5. There will be a calender for each member that they will have access to and will be able to add and delete messeges on their calender. 6. There will be a mail system on our website that will only be internal. 7. Information on how our members will be able to have their own address from our website, meaning if a members username was 'meme', that member could give the following address to someone so they may visit her on our site: [withheld so I wouldn't get sued] 8. There will also be a statistics page for every member, the statistics page is for them to see how many people will view them often. I think I have mentioned everything. If you haven't bid, I suggest you bid now so that I may make my decision. Thank you. -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From chendry at nyc.rr.com Wed May 12 10:37:24 2004 From: chendry at nyc.rr.com (Christopher Hendry) Date: Wed, 12 May 2004 10:37:24 -0400 Subject: [nycphp-talk] Development Meeting: Important Change In-Reply-To: <3ED6E98C-A41B-11D8-9EDE-003065F9A07A@mac.com> Message-ID: <200405121437.i4CEbPBO021893@ms-smtp-02.rdc-nyc.rr.com> Crap. I guess I'm coming, but maybe not. -> -----Original Message----- -> From: talk-bounces at lists.nyphp.org -> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of putamare -> Sent: Wednesday, May 12, 2004 9:50 AM -> To: NYPHP Talk -> Subject: [nycphp-talk] Development Meeting: Important Change -> -> An important piece of information is missing from the -> NYPHP.org homepage's invitation to tonight's development -> meeting. While all are welcome to the meeting, no one will -> be granted entrance into the building the meeting is being -> held unless their name is on a list. If you plan on -> attending, make sure you RSVP with your full name to -> jeff.knight at nyphp.org before 4PM today, or you will be -> turned away at the door. -> -> _______________________________________________ -> talk mailing list -> talk at lists.nyphp.org -> http://lists.nyphp.org/mailman/listinfo/talk -> From chendry at nyc.rr.com Wed May 12 10:39:36 2004 From: chendry at nyc.rr.com (Christopher Hendry) Date: Wed, 12 May 2004 10:39:36 -0400 Subject: [nycphp-talk] Development Meeting: Important Change In-Reply-To: <200405121437.i4CEbPBO021893@ms-smtp-02.rdc-nyc.rr.com> Message-ID: <200405121439.i4CEdb22018527@ms-smtp-03.rdc-nyc.rr.com> Sorry all, this was not supposed to go to Talk. Doh! -> -----Original Message----- -> From: talk-bounces at lists.nyphp.org -> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Christopher Hendry -> Sent: Wednesday, May 12, 2004 10:37 AM -> To: 'NYPHP Talk' -> Subject: RE: [nycphp-talk] Development Meeting: Important Change -> -> Crap. I guess I'm coming, but maybe not. -> -> -> -----Original Message----- -> -> From: talk-bounces at lists.nyphp.org -> -> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of putamare -> -> Sent: Wednesday, May 12, 2004 9:50 AM -> -> To: NYPHP Talk -> -> Subject: [nycphp-talk] Development Meeting: Important Change -> -> -> -> An important piece of information is missing from the NYPHP.org -> -> homepage's invitation to tonight's development meeting. -> While all are -> -> welcome to the meeting, no one will be granted entrance into the -> -> building the meeting is being held unless their name is -> on a list. If -> -> you plan on attending, make sure you RSVP with your full name to -> -> jeff.knight at nyphp.org before 4PM today, or you will be -> turned away at -> -> the door. -> -> -> -> _______________________________________________ -> -> talk mailing list -> -> talk at lists.nyphp.org -> -> http://lists.nyphp.org/mailman/listinfo/talk -> -> -> -> -> _______________________________________________ -> talk mailing list -> talk at lists.nyphp.org -> http://lists.nyphp.org/mailman/listinfo/talk -> From dmintz at davidmintz.org Wed May 12 11:44:59 2004 From: dmintz at davidmintz.org (David Mintz) Date: Wed, 12 May 2004 11:44:59 -0400 (EDT) Subject: [nycphp-talk] NEW PHundamentals Question - Error Handling In-Reply-To: <40A19607.2060203@ceruleansky.com> References: <40A19607.2060203@ceruleansky.com> Message-ID: On Tue, 11 May 2004, Jayesh Sheth wrote: > Here is what I did recently for error handling within a (PHP 4) class. > (This was for a redesign of a class that was originally written out of > the need to collect 10 - 20 separate functions, all having resided in > different files.) > > [snip] it looks as though your example is more concerned with evaluating user input than error handling per se. In other words for purposes of this discussion we need to distinguish between user input validation/evaluation on one hand, and server-side error conditions on the other $.02. --- David Mintz http://davidmintz.org/ "Anybody else got a problem with Webistics?" -- Sopranos 24:17 >From hans not junk at nyphp.com Wed May 12 12:00:35 2004 Return-Path: Received: from ehost011-1.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 4C6EAA860A for ; Wed, 12 May 2004 12:00:35 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] reporting hosting fraud (off-topic) Date: Wed, 12 May 2004 09:00:32 -0700 Message-ID: <41EE526EC2D3C74286415780D3BA9F8701F3AB87 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] reporting hosting fraud (off-topic) Thread-Index: AcQ30BnuPUv32U3xRsS6RccbInf+VgAal+6g From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2004 16:00:35 -0000 > http://www.moztips.com/index.php?id=3D229 >=20 > To which authority (FBI, BBB) should I report this case of suspected=20 > fraud? Should I also report it also to the press? I'd say probably FBI, but don't arrest me if I'm wrong! :) H From phillip.powell at adnet-sys.com Wed May 12 14:35:12 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Wed, 12 May 2004 14:35:12 -0400 Subject: [nycphp-talk] How do I use readfile() and redirect at the same time? Message-ID: <40A26E60.5090206@adnet-sys.com> [PHP] class DownloadGenerator { var $fullFilePath; function DownloadGenerator($fullFilePath) { $this->fullFilePath = $fullFilePath; } function &generateForceDownloadHeaders($fullFilePath = '') { // STATIC VOID METHOD $file = ($this->fullFilePath) ? $this->fullFilePath : $fullFilePath; if (if_file($file)) { $filesize = @filesize($file); header("Content-Disposition: attachment; filename=$file"); header('Content-Type: application/octet-stream'); header('Content-Type: application/force-download'); header('Content-Type: application/download'); header('Content-Transfer-Encoding: binary'); header('Pragma: no-cache'); header('Expires: 0'); @set_time_limit(600); readfile($file); } } } [/PHP] I am trying to "have my cake and eat it too", so to speak. I want to do a forced download of a file using readfile() and manipulating the headers; but at the exact same time I need to redirect to another page, the page that says "hey everything is cool" success message and display the rest of the application. Right now what it does is that it does force a download (in Mozilla) but your window is blank. The user has no ability to navigate any further and is forced to close and re-open their browser and start all over again, definitely not an option. How can I use readfile() to force a download of a file, yet at the same time display a screen indicating the rest of the application? The idea I thought up (that obviously fails) was this: [PHP] foreach ($_REQUEST as $key => $val) if (!isset(${$key})) ${$key} = $val; // RETRIEVE ALL PASSED VARS if ($forceDownload) { // HANDLE FORCED DOWNLOAD $dlGen =& new DownloadGenerator($fullFilePath); $dlGen->generateForceDownloadHeaders(); echo "generateQueryString() . "\">Continue\n"; $dlGen = null; } [/PHP] This resulting from [Quote]index.php?forceDownload=1&fullFilePath=/tmp/images/blah.jpg[/Quote] Thanx Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer ADNET Systems., Inc. 11260 Roger Bacon Drive Suite 403 Reston, VA 20191 #: (703) 709-7218 x107 Fax: (703) 709-7219 From tgales at tgaconnect.com Thu May 13 08:56:26 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Thu, 13 May 2004 08:56:26 -0400 Subject: [nycphp-talk] NewsForge article on International PHP Conference Message-ID: <002401c438e9$b418b4f0$e98d3818@oberon1> Filip de Waard gives his take on attending the International PHP Conference at: http://programming.newsforge.com/programming/04/05/11/1352240.shtml?tid=10 5&tid=55 T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From csnyder at chxo.com Thu May 13 10:02:58 2004 From: csnyder at chxo.com (Chris Snyder) Date: Thu, 13 May 2004 10:02:58 -0400 Subject: [nycphp-talk] NewsForge article on International PHP Conference In-Reply-To: <002401c438e9$b418b4f0$e98d3818@oberon1> References: <002401c438e9$b418b4f0$e98d3818@oberon1> Message-ID: <40A38012.2090408@chxo.com> Last night, Hendry came up with three key ingredients to a successful conference that were woefully absent in Amsterdam: 1) Endless coffee 2) Good wireless (with enterprise bandwidth) 3) Abundant power outlets There should also be a mechanism (CMS? secretary?) for getting presentation slides and additional material onto the conference website in real time. Passively listening to speakers can be a chore (especially without caffeine!) -- but if you can code examples on your laptop, do research, run demos, and communicate with your peers at the same time, you become an active participant. From carlos at sprout.net Thu May 13 14:38:21 2004 From: carlos at sprout.net (Carlos G. Chiossone) Date: Thu, 13 May 2004 14:38:21 -0400 Subject: [nycphp-talk] reporting hosting fraud (off-topic) Message-ID: <49A9DEB886049242BA28C484A36C03F15A744F@email.sprout.net> I wish you luck! FBI requires that the victim has at least $5,000 on losses before they can make it a Federal case. I know that if you get the right person this can be put aside. But from experience, it will not be easy. You may want to talk to the Trade Commission and Commerce Commission in Washington. Also try to find out where this person is and contact the local PD for information about the person. But most of all, you need to find VICTIMS of this person to allow the FBI to build a case. Carlos -----Original Message----- From: Hans Zaunere [mailto:hans not junk at nyphp.com] Sent: Wednesday, May 12, 2004 12:01 PM To: NYPHP Talk Subject: RE: [nycphp-talk] reporting hosting fraud (off-topic) > http://www.moztips.com/index.php?id=229 > > To which authority (FBI, BBB) should I report this case of suspected > fraud? Should I also report it also to the press? I'd say probably FBI, but don't arrest me if I'm wrong! :) H _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From carlos at sprout.net Thu May 13 14:49:58 2004 From: carlos at sprout.net (Carlos G. Chiossone) Date: Thu, 13 May 2004 14:49:58 -0400 Subject: [nycphp-talk] Job posting board (off-topic) Message-ID: <49A9DEB886049242BA28C484A36C03F15A7451@email.sprout.net> Hi guys, any suggestions on where to place a PHP programmers job posting. I did on the jobs list here with almost no result, which is good it means you all are working. Any suggestions? Thanks, Carlos From nyphp at websapp.com Thu May 13 14:53:41 2004 From: nyphp at websapp.com (Daniel Kushner) Date: Thu, 13 May 2004 14:53:41 -0400 Subject: [nycphp-talk] Job posting board (off-topic) In-Reply-To: <49A9DEB886049242BA28C484A36C03F15A7451@email.sprout.net> Message-ID: <200405131853.i4DIriXu000241@ns5.oddcast.com> Hey Carlos, Give http://newyork.craigslist.org/ a shot. You'll get a ton of resumes ! -Daniel > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Carlos G. Chiossone > Sent: Thursday, May 13, 2004 14:50 > To: NYPHP Talk > Subject: [nycphp-talk] Job posting board (off-topic) > > Hi guys, any suggestions on where to place a PHP programmers > job posting. I did on the jobs list here with almost no > result, which is good it means you all are working. > > Any suggestions? > > Thanks, > Carlos > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > > From carlos at sprout.net Thu May 13 14:54:22 2004 From: carlos at sprout.net (Carlos G. Chiossone) Date: Thu, 13 May 2004 14:54:22 -0400 Subject: [nycphp-talk] PHP as EXE Message-ID: <49A9DEB886049242BA28C484A36C03F15A7452@email.sprout.net> Hi all, any of you have any good experience in creating and running PHP programs as a standalone applications? I think it can be done with the Zend Suite, but any other applications out there? Thanks, Carlos From carlos at sprout.net Thu May 13 14:54:48 2004 From: carlos at sprout.net (Carlos G. Chiossone) Date: Thu, 13 May 2004 14:54:48 -0400 Subject: [nycphp-talk] Job posting board (off-topic) Message-ID: <49A9DEB886049242BA28C484A36C03F15A7453@email.sprout.net> Thanks Daniel. c -----Original Message----- From: Daniel Kushner [mailto:nyphp at websapp.com] Sent: Thursday, May 13, 2004 2:54 PM To: 'NYPHP Talk' Subject: RE: [nycphp-talk] Job posting board (off-topic) Hey Carlos, Give http://newyork.craigslist.org/ a shot. You'll get a ton of resumes ! -Daniel > -----Original Message----- > From: talk-bounces at lists.nyphp.org > [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Carlos G. Chiossone > Sent: Thursday, May 13, 2004 14:50 > To: NYPHP Talk > Subject: [nycphp-talk] Job posting board (off-topic) > > Hi guys, any suggestions on where to place a PHP programmers job > posting. I did on the jobs list here with almost no result, which is > good it means you all are working. > > Any suggestions? > > Thanks, > Carlos > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > > > _______________________________________________ talk mailing list talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk From tgales at tgaconnect.com Thu May 13 14:57:03 2004 From: tgales at tgaconnect.com (Tim Gales) Date: Thu, 13 May 2004 14:57:03 -0400 Subject: [nycphp-talk] Job posting board (off-topic) In-Reply-To: <49A9DEB886049242BA28C484A36C03F15A7451@email.sprout.net> Message-ID: <004201c4391c$148a1e00$e98d3818@oberon1> > ....where to place a PHP programmers > job posting. I did on the jobs list here with almost no > result, which is good it means you all are working. > > Any suggestions? You could try http://listbid.com/ T. Gales & Associates 'Helping People Connect with Technology' http://www.tgaconnect.com From agfische at email.smith.edu Thu May 13 15:07:32 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 13 May 2004 15:07:32 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup Message-ID: Hi all, I would like to set up php locally on my laptop. Currently on PHundamentals I only see mention of local setups for Windows or Linux. I googled the archives and found a thread where it appears that the setup offered on entropy is a good way to go: http://www.entropy.ch/software/macosx/ I'd like to get this going on my powerbook. Would folks recommend this as the best way to go for a OS X powerbook setup or are there alternative methods that may be more desirable? Thanks, -Aaron From mitchy at spacemonkeylabs.com Thu May 13 15:17:28 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Thu, 13 May 2004 15:17:28 -0400 Subject: [nycphp-talk] PHP as EXE In-Reply-To: <49A9DEB886049242BA28C484A36C03F15A7452@email.sprout.net> References: <49A9DEB886049242BA28C484A36C03F15A7452@email.sprout.net> Message-ID: <40A3C9C8.3080208@spacemonkeylabs.com> Carlos G. Chiossone wrote: > Hi all, any of you have any good experience in creating and running PHP > programs as a standalone applications? I think it can be done with the > Zend Suite, but any other applications out there? I've been working with classes that are executed both within webpages and as cron jobs (cli). For this, I am pretty happy with PHP as a scripting language, especially when coupled with a database that supports stored procedures and triggers (like PostgreSQL). As for pure application programming though, I try to do most everything in python. I stay away from GUI applications, as that is not really my forte, so no experience working with phpGTK. (looks up from desk) So what is everyone else around here doing in this regard? -- Mitch From mitchy at spacemonkeylabs.com Thu May 13 15:19:03 2004 From: mitchy at spacemonkeylabs.com (Mitch Pirtle) Date: Thu, 13 May 2004 15:19:03 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: References: Message-ID: <40A3CA27.5040208@spacemonkeylabs.com> Aaron Fischer wrote: > Hi all, > > I would like to set up php locally on my laptop. Currently on > PHundamentals I only see mention of local setups for Windows or Linux. > I googled the archives and found a thread where it appears that the > setup offered on entropy is a good way to go: > http://www.entropy.ch/software/macosx/ Time to get FINKed! http://fink.sf.net/ They have packages for PHP and many other things that you may find useful. HTH, -- Mitch From csnyder at chxo.com Thu May 13 15:19:36 2004 From: csnyder at chxo.com (Chris Snyder) Date: Thu, 13 May 2004 15:19:36 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: References: Message-ID: <40A3CA48.6000803@chxo.com> You know that PHP is installed and ready to go by default on OSX, right? Turn on the webserver in the sharing control panel and you're set. It's installed as a shared object, too, so you can compile a newer / custom version if necessary. Just pick up the configure line from phpinfo(); and use that to configure a custom version from source. From weyrick at roadsend.com Thu May 13 15:21:37 2004 From: weyrick at roadsend.com (Shannon Weyrick) Date: Thu, 13 May 2004 15:21:37 -0400 Subject: [nycphp-talk] PHP as EXE In-Reply-To: <49A9DEB886049242BA28C484A36C03F15A7452@email.sprout.net> References: <49A9DEB886049242BA28C484A36C03F15A7452@email.sprout.net> Message-ID: <40A3CAC1.70600@roadsend.com> Carlos G. Chiossone wrote: > Hi all, any of you have any good experience in creating and running PHP > programs as a standalone applications? I think it can be done with the > Zend Suite, but any other applications out there? > > Thanks, > Carlos > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > Roadsend Compiler for PHP www.roadsend.com We are currently in public beta, everyone is encouraged to sign up and give it a go. We will be releasing the next beta very shortly, which will include performance improvements as well as bug fixes and further implementation of the standard library and extensions. Shannon From cderr at simons-rock.edu Thu May 13 15:22:15 2004 From: cderr at simons-rock.edu (charlie derr) Date: Thu, 13 May 2004 15:22:15 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: <40A3CA48.6000803@chxo.com> References: <40A3CA48.6000803@chxo.com> Message-ID: <40A3CAE7.5060306@simons-rock.edu> Chris Snyder wrote: > You know that PHP is installed and ready to go by default on OSX, right? > Turn on the webserver in the sharing control panel and you're set. Groovadelic. I'm not much of a mac person, but I never knew that -- I was all set to say what Mitch said (fink) when I read your response and tried it. To be completely pedantic, it wasn't "quite" ready to go. On my panther (osX 10.3) machine, I had to go into /etc/httpd.conf and uncomment these two lines: #LoadModule php4_module libexec/httpd/libphp4.so #AddModule mod_php4.c After restarting the Personal Web Sharing service, it is indeed all set. thanks for this, ~c > > It's installed as a shared object, too, so you can compile a newer / > custom version if necessary. Just pick up the configure line from > phpinfo(); and use that to configure a custom version from source. > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk From sklar at sklar.com Thu May 13 15:48:13 2004 From: sklar at sklar.com (David Sklar) Date: Thu, 13 May 2004 15:48:13 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: <40A3CAE7.5060306@simons-rock.edu> References: <40A3CA48.6000803@chxo.com> <40A3CAE7.5060306@simons-rock.edu> Message-ID: <40A3D0FD.1060609@sklar.com> Note, however, that the default PEAR installation that comes with Panther is broken. From a terminal prompt, do: curl http://go-pear.org | sudo php to install PEAR properly. David charlie derr wrote: > Chris Snyder wrote: > >> You know that PHP is installed and ready to go by default on OSX, right? >> Turn on the webserver in the sharing control panel and you're set. > > > > Groovadelic. I'm not much of a mac person, but I never knew that -- I > was all set to say what Mitch said (fink) when I read your response and > tried it. > > > To be completely pedantic, it wasn't "quite" ready to go. On my panther > (osX 10.3) machine, I had to go into /etc/httpd.conf and uncomment these > two lines: > > #LoadModule php4_module libexec/httpd/libphp4.so > #AddModule mod_php4.c > > > After restarting the Personal Web Sharing service, it is indeed all set. > > thanks for this, > ~c > >> >> It's installed as a shared object, too, so you can compile a newer / >> custom version if necessary. Just pick up the configure line from >> phpinfo(); and use that to configure a custom version from source. >> >> _______________________________________________ >> talk mailing list >> talk at lists.nyphp.org >> http://lists.nyphp.org/mailman/listinfo/talk > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From jeffknight at mac.com Thu May 13 15:54:50 2004 From: jeffknight at mac.com (putamare) Date: Thu, 13 May 2004 15:54:50 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: <40A3CA27.5040208@spacemonkeylabs.com> References: <40A3CA27.5040208@spacemonkeylabs.com> Message-ID: <64DF18D4-A517-11D8-8DDC-000393B9FB36@mac.com> On May 13, 2004, at 3:19 PM, Mitch Pirtle wrote: > Time to get FINKed! I prefer DarwinPorts http://darwinports.opendarwin.org/ more bsd-like although not as mature and without as many packages as fink jeff.knight not junkmail at nyphp.org From agfische at email.smith.edu Thu May 13 16:26:32 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 13 May 2004 16:26:32 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: <40A3CAE7.5060306@simons-rock.edu> References: <40A3CA48.6000803@chxo.com> <40A3CAE7.5060306@simons-rock.edu> Message-ID: I started Personal Web Sharing and successfully received the Apache start up page. However, after running phpinfo(); at it from the "Sites" folder, it doesn't appear to be running php by default. I searched my hard drive for "httpd.conf" and came up with no results. I'm running Panther as well, can you give me a little more detail where I can find the httpd.conf file? Thanks, -Aaron On May 13, 2004, at 3:22 PM, charlie derr wrote: > To be completely pedantic, it wasn't "quite" ready to go. On my > panther (osX 10.3) machine, I had to go into /etc/httpd.conf and > uncomment these two lines: > > #LoadModule php4_module libexec/httpd/libphp4.so > #AddModule mod_php4.c > > > After restarting the Personal Web Sharing service, it is indeed all > set. > > thanks for this, > ~c From Cbielanski at inta.org Thu May 13 16:33:02 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Thu, 13 May 2004 16:33:02 -0400 Subject: [ot] RE: [nycphp-talk] Mac OS X local laptop setup Message-ID: What, Panther doesn't have "find" eek!! ;) > -----Original Message----- > From: Aaron Fischer [mailto:agfische at email.smith.edu] > Sent: Thursday, May 13, 2004 4:27 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Mac OS X local laptop setup > > > I started Personal Web Sharing and successfully received the Apache > start up page. However, after running phpinfo(); at it from the > "Sites" folder, it doesn't appear to be running php by default. I > searched my hard drive for "httpd.conf" and came up with no results. > > I'm running Panther as well, can you give me a little more > detail where > I can find the httpd.conf file? > > Thanks, > > -Aaron > > On May 13, 2004, at 3:22 PM, charlie derr wrote: > > > To be completely pedantic, it wasn't "quite" ready to go. On my > > panther (osX 10.3) machine, I had to go into /etc/httpd.conf and > > uncomment these two lines: > > > > #LoadModule php4_module libexec/httpd/libphp4.so > > #AddModule mod_php4.c > > > > > > After restarting the Personal Web Sharing service, it is indeed all > > set. > > > > thanks for this, > > ~c > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From agfische at email.smith.edu Thu May 13 16:30:49 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 13 May 2004 16:30:49 -0400 Subject: [ot] RE: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: References: Message-ID: <6BAE5E2A-A51C-11D8-8E28-0003930D07F2@email.smith.edu> Wellll, apparently not a very good one, because I just selected the "Macintosh HD" and searched for "httpd.conf" and got nothing back! On May 13, 2004, at 4:33 PM, Chris Bielanski wrote: > What, Panther doesn't have "find" > > eek!! ;) > >> -----Original Message----- >> From: Aaron Fischer [mailto:agfische at email.smith.edu] >> Sent: Thursday, May 13, 2004 4:27 PM >> To: NYPHP Talk >> Subject: Re: [nycphp-talk] Mac OS X local laptop setup >> >> >> I started Personal Web Sharing and successfully received the Apache >> start up page. However, after running phpinfo(); at it from the >> "Sites" folder, it doesn't appear to be running php by default. I >> searched my hard drive for "httpd.conf" and came up with no results. >> >> I'm running Panther as well, can you give me a little more >> detail where >> I can find the httpd.conf file? >> >> Thanks, >> >> -Aaron From csnyder at chxo.com Thu May 13 16:34:21 2004 From: csnyder at chxo.com (Chris Snyder) Date: Thu, 13 May 2004 16:34:21 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: References: <40A3CA48.6000803@chxo.com> <40A3CAE7.5060306@simons-rock.edu> Message-ID: <40A3DBCD.7030501@chxo.com> Aaron Fischer wrote: > I'm running Panther as well, can you give me a little more detail > where I can find the httpd.conf file? > > On May 13, 2004, at 3:22 PM, charlie derr wrote: > >> On my panther (osX 10.3) machine, I had to go into /etc/httpd.conf > Should have been /etc/httpd/httpd.conf From csnyder at chxo.com Thu May 13 16:51:28 2004 From: csnyder at chxo.com (Chris Snyder) Date: Thu, 13 May 2004 16:51:28 -0400 Subject: [ot] RE: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: <6BAE5E2A-A51C-11D8-8E28-0003930D07F2@email.smith.edu> References: <6BAE5E2A-A51C-11D8-8E28-0003930D07F2@email.smith.edu> Message-ID: <40A3DFD0.3080406@chxo.com> Aaron Fischer wrote: > Wellll, apparently not a very good one, because I just selected the > "Macintosh HD" and searched for "httpd.conf" and got nothing back! Welcome to command line unix. :-) Aotearoa:~ csnyder$ which find /usr/bin/find You didn't turn up httpd.conf because the FreeBSD filesystem is loosely off-limits to Finder, one of the few barriers remaining to the unix-ification of the Mac desktop. BTW, I hear that the NYCBUG list is a good place to discuss the ins-and-outs of OSX as a server. There are also some excellent O'Reilly texts on the subject. From Cbielanski at inta.org Thu May 13 16:56:35 2004 From: Cbielanski at inta.org (Chris Bielanski) Date: Thu, 13 May 2004 16:56:35 -0400 Subject: [ot] RE: [nycphp-talk] Mac OS X local laptop setup Message-ID: Okay *whew* I was afraid something very odd had happened...This is what I expceted to see: >Welcome to command line unix. :-) > >Aotearoa:~ csnyder$ which find >/usr/bin/find From southwell at dneba.com Thu May 13 19:33:56 2004 From: southwell at dneba.com (Michael Southwell) Date: Thu, 13 May 2004 19:33:56 -0400 Subject: [nycphp-talk] OT: NYC area Mac repairs Message-ID: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> Sorry for this OT post but you guys are all so smart that.... My son's I-Mac G4 stopped connecting to the Internet. Tek-Serve says bad port, new motherboard, $400. Does anyone know anybody else who could diagnose/fix this and might be a bit less high-end expensive? Michael Southwell VP, Education Department NYPHP michael.southwell at nyphp.org From agfische at email.smith.edu Thu May 13 19:42:59 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Thu, 13 May 2004 19:42:59 -0400 Subject: [nycphp-talk] OT: NYC area Mac repairs In-Reply-To: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> References: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> Message-ID: <441E6C03-A537-11D8-93EE-000A95AF225A@email.smith.edu> Sorry if this seems too obvious, but you didn't happen to get AppleCare for it, did you? If so, that's probably covered. I have never had to bring my Mac in (yet), but the place I would probably feel most comfortable would be an Apple store, unless I had some good recommendations to use someone else. -Aaron On May 13, 2004, at 7:33 PM, Michael Southwell wrote: > Sorry for this OT post but you guys are all so smart that.... > > My son's I-Mac G4 stopped connecting to the Internet. Tek-Serve says > bad port, new motherboard, $400. Does anyone know anybody else who > could diagnose/fix this and might be a bit less high-end expensive? > > Michael Southwell > VP, Education Department > NYPHP > michael.southwell at nyphp.org From keith at keithjr.net Thu May 13 20:09:58 2004 From: keith at keithjr.net (keith at keithjr.net) Date: Thu, 13 May 2004 17:09:58 -0700 (PDT) Subject: [nycphp-talk] OT: NYC area Mac repairs In-Reply-To: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> References: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> Message-ID: <3158.24.169.80.131.1084493398.squirrel@www.keithjr.net> I agree with the apple store, and also comp-usa has mac-repairs, but I am unsure if they are apple-care certified... > Sorry for this OT post but you guys are all so smart that.... > > My son's I-Mac G4 stopped connecting to the Internet. Tek-Serve says bad > port, new motherboard, $400. Does anyone know anybody else who could > diagnose/fix this and might be a bit less high-end expensive? > > Michael Southwell > VP, Education Department > NYPHP > michael.southwell at nyphp.org > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > From leam at reuel.net Thu May 13 21:16:33 2004 From: leam at reuel.net (leam) Date: Thu, 13 May 2004 21:16:33 -0400 Subject: [nycphp-talk] OT: NYC area Mac repairs In-Reply-To: <3158.24.169.80.131.1084493398.squirrel@www.keithjr.net> References: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> <3158.24.169.80.131.1084493398.squirrel@www.keithjr.net> Message-ID: <40A41DF1.6020301@reuel.net> keith at keithjr.net wrote: > I agree with the apple store, and also comp-usa has mac-repairs, but I am > unsure if they are apple-care certified... Avoid CompUSA Apple, they promised us it'd be back in a week and when we went there over a week later it'd not even gone out. There's an apple store in NYC, I think. One in the King of Prussia (PA) mall. I'm in mid-Joisey and this person has been highly recommended: http://go2g2.com ciao! leam >From hans not junk at nyphp.com Thu May 13 21:26:28 2004 Return-Path: Received: from ehost011-1.intermedia.net (unknown [64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 9B5CAA8636 for ; Thu, 13 May 2004 21:26:28 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [nycphp-talk] PHP as EXE Date: Thu, 13 May 2004 18:26:26 -0700 Message-ID: <41EE526EC2D3C74286415780D3BA9F8701F3B665 at ehost011-1.exch011.intermedia.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [nycphp-talk] PHP as EXE Thread-Index: AcQyzGRaRHIDPu/zSvmKLL8MjgmFWAACCBMQAZG/ZGAADW9dcA== From: "Hans Zaunere" To: "NYPHP Talk" X-BeenThere: talk at lists.nyphp.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: NYPHP Talk List-Id: NYPHP Talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2004 01:26:29 -0000 > Hi all, any of you have any good experience in creating and=20 > running PHP programs as a standalone applications? I think it=20 > can be done with the Zend Suite, but any other applications out there? I run PHP CLI on a regular basis. This is usually by use of cronjobs. Basically, as a data mining method, PHP CLI scripts pull and process over 400K rows from Oracle, cooks them into about 100K rows and inserts into MySQL. There are about 5 such scripts running on a regular basis and run perfectly. Each script typically reaches 200mb in size - on a system with 256mb physical :) The other application-style use of PHP I've had great luck with is as a regular console application. The PHP CLI script talks to a card reader through a serial port (using a C extension), uses my own ncurses C extension to interface with the user, and uploads data to a MySQL database across the network. The application has run - without restart - for over 5 months on a throw-away Pentium-133 running RedHat 7.3. These scripts, however, still require a compiled PHP binary somewhere on the system. The Roadsend Compiler for PHP that Shannon spoke of eliminates this need by compiling a static binary (correct any details Shannon). This - among other features - is some very exciting stuff, and I hope we can get a presentation on it soon :) H From adam at trachtenberg.com Fri May 14 01:19:55 2004 From: adam at trachtenberg.com (Adam Maccabee Trachtenberg) Date: Fri, 14 May 2004 01:19:55 -0400 (EDT) Subject: [nycphp-talk] OT: NYC area Mac repairs In-Reply-To: <441E6C03-A537-11D8-93EE-000A95AF225A@email.smith.edu> References: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> <441E6C03-A537-11D8-93EE-000A95AF225A@email.smith.edu> Message-ID: > > My son's I-Mac G4 stopped connecting to the Internet. Tek-Serve says > > bad port, new motherboard, $400. Does anyone know anybody else who > > could diagnose/fix this and might be a bit less high-end expensive? I generally find that Tek-Serve have the reputation for being straight shooters and are cheaper than the Apple Store. I bet the hardware is the big cost here anyway. -adam -- adam at trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! From chubbard at next-online.net Fri May 14 12:35:59 2004 From: chubbard at next-online.net (Chris Hubbard) Date: Fri, 14 May 2004 09:35:59 -0700 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: References: <40A3CA48.6000803@chxo.com> <40A3CAE7.5060306@simons-rock.edu> Message-ID: Aaron, Open up Terminal type in: cd /etc/httpd/ then type ls -la you should see httpd.conf if you do, then type: sudo vi httpd.conf then search for php by typing /php remove the # sign in front of the two lines that contain php. you can remove a single character by typing x. x will remove the character under the cursor. when you're done type :wq then restart Personal Web Sharing Chris On May 13, 2004, at 1:26 PM, Aaron Fischer wrote: > I started Personal Web Sharing and successfully received the Apache > start up page. However, after running phpinfo(); at it from the > "Sites" folder, it doesn't appear to be running php by default. I > searched my hard drive for "httpd.conf" and came up with no results. > > I'm running Panther as well, can you give me a little more detail > where I can find the httpd.conf file? > > Thanks, > > -Aaron > > On May 13, 2004, at 3:22 PM, charlie derr wrote: > >> To be completely pedantic, it wasn't "quite" ready to go. On my >> panther (osX 10.3) machine, I had to go into /etc/httpd.conf and >> uncomment these two lines: >> >> #LoadModule php4_module libexec/httpd/libphp4.so >> #AddModule mod_php4.c >> >> >> After restarting the Personal Web Sharing service, it is indeed all >> set. >> >> thanks for this, >> ~c > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > Chris Hubbard chubbard at next-online.net 425 563 4153 From weyrick at roadsend.com Fri May 14 14:25:06 2004 From: weyrick at roadsend.com (Shannon Weyrick) Date: Fri, 14 May 2004 14:25:06 -0400 Subject: [nycphp-talk] PHP as EXE In-Reply-To: <41EE526EC2D3C74286415780D3BA9F8701F3B665@ehost011-1.exch011.intermedia.net> References: <41EE526EC2D3C74286415780D3BA9F8701F3B665@ehost011-1.exch011.intermedia.net> Message-ID: <40A50F02.7010304@roadsend.com> Hans Zaunere wrote: > These scripts, however, still require a compiled PHP binary somewhere on > the system. The Roadsend Compiler for PHP that Shannon spoke of > eliminates this need by compiling a static binary (correct any details > Shannon). This - among other features - is some very exciting stuff, > and I hope we can get a presentation on it soon :) > > H > It can compile to a "stand alone" binary (not requiring an interpreter or source). The actual executable can be linked either statically or dynamically to the various runtime libraries. It can also generate static and shared libraries, which can be used either with stand alone applications, or as compiled web applications run directly from apache. Also included is a complete interpreter for running code 'on the fly', just as Zend PHP does (from both command line and from the web). Hopefully once we've released the final product, we'll have time to schedule a presentation! Shannon www.roadsend.com From agfische at email.smith.edu Fri May 14 14:42:59 2004 From: agfische at email.smith.edu (Aaron Fischer) Date: Fri, 14 May 2004 14:42:59 -0400 Subject: [nycphp-talk] Mac OS X local laptop setup In-Reply-To: References: <40A3CA48.6000803@chxo.com> <40A3CAE7.5060306@simons-rock.edu> Message-ID: <85AC46E0-A5D6-11D8-96CA-0003930D07F2@email.smith.edu> Thanks Chris. I was able to get things going nicely last night by doing the following: In Terminal: "locate httpd.conf" bbedit /private/etc/httpd/httpd.conf and then made the necessary changes in bbedit to enable php. This page was a helpful resource: http://sanbeiji.com/tech/tutorials/php/ Thank to everyone for their suggestions, -Aaron On May 14, 2004, at 12:35 PM, Chris Hubbard wrote: > Aaron, > Open up Terminal > type in: > cd /etc/httpd/ > > then type > ls -la > > you should see httpd.conf > > if you do, then type: > sudo vi httpd.conf > > then search for php by typing /php > > remove the # sign in front of the two lines that contain php. > you can remove a single character by typing x. x will remove the > character under the cursor. > > when you're done type > :wq > > then restart Personal Web Sharing > > Chris > > On May 13, 2004, at 1:26 PM, Aaron Fischer wrote: > >> I started Personal Web Sharing and successfully received the Apache >> start up page. However, after running phpinfo(); at it from the >> "Sites" folder, it doesn't appear to be running php by default. I >> searched my hard drive for "httpd.conf" and came up with no results. >> >> I'm running Panther as well, can you give me a little more detail >> where I can find the httpd.conf file? >> >> Thanks, >> >> -Aaron >> >> On May 13, 2004, at 3:22 PM, charlie derr wrote: >> >>> To be completely pedantic, it wasn't "quite" ready to go. On my >>> panther (osX 10.3) machine, I had to go into /etc/httpd.conf and >>> uncomment these two lines: >>> >>> #LoadModule php4_module libexec/httpd/libphp4.so >>> #AddModule mod_php4.c >>> >>> >>> After restarting the Personal Web Sharing service, it is indeed all >>> set. >>> >>> thanks for this, >>> ~c From bowenr at baldwin.k12.ny.us Fri May 14 19:00:12 2004 From: bowenr at baldwin.k12.ny.us (Robert Bowen) Date: Fri, 14 May 2004 19:00:12 -0400 Subject: [nycphp-talk] OT: NYC area Mac repairs In-Reply-To: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> References: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> Message-ID: <40A54F7C.7090406@baldwin.k12.ny.us> Michael, If it is just the ethernet port, why not throw in an airport card and buy an inexpensive wireless access point? The access point can be purchased for under $40.00 and the airport card for under $100.00. Just my $.02 -Robert Bowen Michael Southwell wrote: > Sorry for this OT post but you guys are all so smart that.... > > My son's I-Mac G4 stopped connecting to the Internet. Tek-Serve says bad > port, new motherboard, $400. Does anyone know anybody else who could > diagnose/fix this and might be a bit less high-end expensive? > > Michael Southwell > VP, Education Department > NYPHP > michael.southwell at nyphp.org > > > _______________________________________________ > talk mailing list > talk at lists.nyphp.org > http://lists.nyphp.org/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From southwell at dneba.com Fri May 14 23:34:37 2004 From: southwell at dneba.com (Michael Southwell) Date: Fri, 14 May 2004 23:34:37 -0400 Subject: [nycphp-talk] OT: NYC area Mac repairs In-Reply-To: <40A54F7C.7090406@baldwin.k12.ny.us> References: <6.1.0.6.2.20040513193127.01f12878@mail.optonline.net> <40A54F7C.7090406@baldwin.k12.ny.us> Message-ID: <6.1.0.6.2.20040514233332.01f19050@mail.optonline.net> At 07:00 PM 5/14/2004, you wrote: >Michael, > > If it is just the ethernet port, why not throw in an airport card and > buy an inexpensive wireless access point? The access point can be > purchased for under $40.00 and the airport card for under $100.00. This is in fact exactly how we solved it. Many thanks to everybody who responded, and I promise never to ask such an OT question again (until the next time that I have to)....... Michael Southwell VP, Education Department NYPHP michael.southwell at nyphp.org From keremtuzemen at hotmail.com Tue May 18 10:57:42 2004 From: keremtuzemen at hotmail.com (Kerem Tuzemen) Date: Tue, 18 May 2004 10:57:42 -0400 Subject: [nycphp-talk] test- please discard References: <002801c43817$d422a4e0$e98d3818@oberon1> Message-ID: testing From phillip.powell at adnet-sys.com Tue May 18 12:13:47 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Tue, 18 May 2004 12:13:47 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? Message-ID: <40AA363B.3060303@adnet-sys.com> Is there a way to get an equivalent of $PHP_SELF for a PHP script that is not residing in the document root? Apparently if you have PHP 4.3.2 and Apache 2.0 in Red Hat Linux 7.3, at the very least, $PHP_SELF is only populated with content indicating the location of the PHP script calling $PHP_SELF if that PHP script resides in Apache's document root or below. But I have some PHP scripts that will be ultimately referenced via cron that have to reside outside of the document root. When I do [PHP]phpinfo();[/PHP] I get "no value" for the variable $PHP_SELF. This tells me apparently that it can only identify itself from within the document root. So this leaves me with a problem. How can I find $PHP_SELF, or something like $PHP_SELF, in a PHP script that's outside of the document root? I am looking for values within the path that I will need to dynamically populate portions of that same PHP script, otherwise, the user, upon inheriting these cron files, have to MANUALLY change values inside the PHP script every time! Thanx Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer BPX Technologies, Inc. #: (703) 709-7218 x107 Fax: (703) 709-7219 From andrew at digitalpulp.com Tue May 18 12:36:15 2004 From: andrew at digitalpulp.com (Andrew Yochum) Date: Tue, 18 May 2004 12:36:15 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? In-Reply-To: <40AA363B.3060303@adnet-sys.com> References: <40AA363B.3060303@adnet-sys.com> Message-ID: <20040518163606.GE2854@thighmaster.digitalpulp.com> On Tue, May 18, 2004 at 12:13:47PM -0400, Phillip Powell wrote: > Is there a way to get an equivalent of $PHP_SELF for a PHP script that > is not residing in the document root? Apparently if you have PHP 4.3.2 > and Apache 2.0 in Red Hat Linux 7.3, at the very least, $PHP_SELF is > only populated with content indicating the location of the PHP script > calling $PHP_SELF if that PHP script resides in Apache's document root > or below. > > But I have some PHP scripts that will be ultimately referenced via cron > that have to reside outside of the document root. When I do > > [PHP]phpinfo();[/PHP] > > I get "no value" for the variable $PHP_SELF. This tells me apparently > that it can only identify itself from within the document root. > > So this leaves me with a problem. How can I find $PHP_SELF, or > something like $PHP_SELF, in a PHP script that's outside of the document > root? I am looking for values within the path that I will need to > dynamically populate portions of that same PHP script, otherwise, the > user, upon inheriting these cron files, have to MANUALLY change values > inside the PHP script every time! Try the __FILE__ constant. Example: echo __FILE__; HTH, Andrew From joel at tagword.com Tue May 18 14:57:24 2004 From: joel at tagword.com (Joel De Gan) Date: Tue, 18 May 2004 14:57:24 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? In-Reply-To: <20040518163606.GE2854@thighmaster.digitalpulp.com> References: <40AA363B.3060303@adnet-sys.com> <20040518163606.GE2854@thighmaster.digitalpulp.com> Message-ID: <1084906643.9836.6.camel@bezel> On Tue, 2004-05-18 at 12:36, Andrew Yochum wrote: > Try the __FILE__ constant. Example: > echo __FILE__; > There is also getcwd() for the dir.. i.e. $dir = getcwd(); $file = $dir . "/" . $PHP_SELF; cheers -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From phillip.powell at adnet-sys.com Tue May 18 14:24:24 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Tue, 18 May 2004 14:24:24 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? In-Reply-To: <1084906643.9836.6.camel@bezel> References: <40AA363B.3060303@adnet-sys.com> <20040518163606.GE2854@thighmaster.digitalpulp.com> <1084906643.9836.6.camel@bezel> Message-ID: <40AA54D8.6090207@adnet-sys.com> Joel De Gan wrote: >On Tue, 2004-05-18 at 12:36, Andrew Yochum wrote: > > >>Try the __FILE__ constant. Example: >> echo __FILE__; >> >> >> > >There is also getcwd() for the dir.. i.e. >$dir = getcwd(); >$file = $dir . "/" . $PHP_SELF; > >cheers > > Thanx. This, however, opened up a rather annoying can-of-worms at this point. My company wants me to ensure that the application I built is thoroughly portable and scalable, of course, not unreasonable. Which means that all of the required code will be thoroughly portable from Client A thorugh Client Z and will work exactly the same for Client A through Client Z. This means that it needs to globally include two library scripts I wrote: one (client_globals.inc.php) that will set all of the client-related global variables/functions/classes/stuff, and one (project_globals.inc.php) that will set all of the client-related-project-related global stuff specific to that client's project. The code I wrote to do this is this and resides only in one file (index.php): [PHP] require(realpath($_SERVER['DOCUMENT_ROOT'] . '/acme/acme_globals/client_globals.inc.php')); // GET GLOBAL ACME - SCOPE ITEMS/CLASSES // GET PROJECT-SCOPE VARIABLES FOR I.C. require(realpath("$DOCUMENT_ROOT/$clientFolderName/image_catalog/image_catalog_globals/project_globals.inc.php")); [/PHP] Here's the problem. Suppose that my company wants to market this product out to another client, Foo Industries. That would mean that the folks that get my application will have to literally MANUALLY change the lines in index.php from 'acme' to 'foo' or whatever the folder name will be for that client. This is, of course, quite a major-league hassle to ask for. And frankly, I just can't think of any system I want to use that would be able to automate the process so that the code in index.php can remain fairly "static" and not needing to be physically altered from client to client. If anyone can think of how I might be able to approach this, I'm all ears. Thanx Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer BPX Technologies, Inc. #: (703) 709-7218 x107 Fax: (703) 709-7219 From joel at tagword.com Tue May 18 16:15:30 2004 From: joel at tagword.com (Joel De Gan) Date: Tue, 18 May 2004 16:15:30 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? In-Reply-To: <40AA54D8.6090207@adnet-sys.com> References: <40AA363B.3060303@adnet-sys.com> <20040518163606.GE2854@thighmaster.digitalpulp.com> <1084906643.9836.6.camel@bezel> <40AA54D8.6090207@adnet-sys.com> Message-ID: <1084911330.9840.11.camel@bezel> On Tue, 2004-05-18 at 14:24, Phillip Powell wrote: > Here's the problem. Suppose that my company wants to market this > product out to another client, Foo Industries. That would mean that the > folks that get my application will have to literally MANUALLY change the > lines in index.php from 'acme' to 'foo' or whatever the folder name will > be for that client. This is, of course, quite a major-league hassle to > ask for. And frankly, I just can't think of any system I want to use > that would be able to automate the process so that the code in index.php > can remain fairly "static" and not needing to be physically altered from > client to client. > > If anyone can think of how I might be able to approach this, I'm all ears. Well, how most generally do it is via a define, in a config. define("APPPATH", "/var/www/html/project"); Then in code that includes this file with this and other settings. You call defined vals like so include APPPATH ."/file.php"; Does that answer the question? getcwd() is what I usually use to set this all programmatically. -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From phillip.powell at adnet-sys.com Tue May 18 15:23:00 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Tue, 18 May 2004 15:23:00 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? In-Reply-To: <1084911330.9840.11.camel@bezel> References: <40AA363B.3060303@adnet-sys.com> <20040518163606.GE2854@thighmaster.digitalpulp.com> <1084906643.9836.6.camel@bezel> <40AA54D8.6090207@adnet-sys.com> <1084911330.9840.11.camel@bezel> Message-ID: <40AA6294.1010201@adnet-sys.com> Joel De Gan wrote: >On Tue, 2004-05-18 at 14:24, Phillip Powell wrote: > > >>Here's the problem. Suppose that my company wants to market this >>product out to another client, Foo Industries. That would mean that the >>folks that get my application will have to literally MANUALLY change the >>lines in index.php from 'acme' to 'foo' or whatever the folder name will >>be for that client. This is, of course, quite a major-league hassle to >>ask for. And frankly, I just can't think of any system I want to use >>that would be able to automate the process so that the code in index.php >>can remain fairly "static" and not needing to be physically altered from >>client to client. >> >>If anyone can think of how I might be able to approach this, I'm all ears. >> >> > >Well, how most generally do it is via a define, in a config. >define("APPPATH", "/var/www/html/project"); > >Then in code that includes this file with this and other settings. >You call defined vals like so > >include APPPATH ."/file.php"; > >Does that answer the question? >getcwd() is what I usually use to set this all programmatically. > > > Yes and no. Perhaps my understanding of "config" and "define" are a bit overcomplicated in my head for me to come up with a simplified version, so I came up with the complex one, as usual. I created a binary 0644 text CSV file that reads the required globals and sets them into $_SESSION variables one time shot only. Problem is that the CSV file is 0644, a huge security HOLE! It needs to be 0600, but then Apache can't read it and the application breaks. The CSV file is created via a command-line PHP scripts "install.php" which creates it in /home/me/scripts/cron and then you have to physically move it to the docroot, in the same place as index.php Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer BPX Technologies, Inc. #: (703) 709-7218 x107 Fax: (703) 709-7219 From joel at tagword.com Tue May 18 16:54:42 2004 From: joel at tagword.com (Joel De Gan) Date: Tue, 18 May 2004 16:54:42 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? In-Reply-To: <40AA6294.1010201@adnet-sys.com> References: <40AA363B.3060303@adnet-sys.com> <20040518163606.GE2854@thighmaster.digitalpulp.com> <1084906643.9836.6.camel@bezel> <40AA54D8.6090207@adnet-sys.com> <1084911330.9840.11.camel@bezel> <40AA6294.1010201@adnet-sys.com> Message-ID: <1084913682.9845.15.camel@bezel> On Tue, 2004-05-18 at 15:23, Phillip Powell wrote: > Yes and no. Perhaps my understanding of "config" and "define" are a bit > overcomplicated in my head for me to come up with a simplified version, > so I came up with the complex one, as usual. > > I created a binary 0644 text CSV file that reads the required globals > and sets them into $_SESSION variables one time shot only. Problem is > that the CSV file is 0644, a huge security HOLE! It needs to be 0600, > but then Apache can't read it and the application breaks. The CSV file > is created via a command-line PHP scripts "install.php" which creates it > in /home/me/scripts/cron and then you have to physically move it to the > docroot, in the same place as index.php like so.. why are you messing around with csv files? file config.php file app.php bash-2.05b$ php app.php /var/www/html/project -- joeldg - developer, Intercosmos media group. http://lucifer.intercosmos.net From phillip.powell at adnet-sys.com Tue May 18 15:43:17 2004 From: phillip.powell at adnet-sys.com (Phillip Powell) Date: Tue, 18 May 2004 15:43:17 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? In-Reply-To: <1084913682.9845.15.camel@bezel> References: <40AA363B.3060303@adnet-sys.com> <20040518163606.GE2854@thighmaster.digitalpulp.com> <1084906643.9836.6.camel@bezel> <40AA54D8.6090207@adnet-sys.com> <1084911330.9840.11.camel@bezel> <40AA6294.1010201@adnet-sys.com> <1084913682.9845.15.camel@bezel> Message-ID: <40AA6755.9090702@adnet-sys.com> Joel De Gan wrote: >On Tue, 2004-05-18 at 15:23, Phillip Powell wrote: > > >>Yes and no. Perhaps my understanding of "config" and "define" are a bit >>overcomplicated in my head for me to come up with a simplified version, >>so I came up with the complex one, as usual. >> >>I created a binary 0644 text CSV file that reads the required globals >>and sets them into $_SESSION variables one time shot only. Problem is >>that the CSV file is 0644, a huge security HOLE! It needs to be 0600, >>but then Apache can't read it and the application breaks. The CSV file >>is created via a command-line PHP scripts "install.php" which creates it >>in /home/me/scripts/cron and then you have to physically move it to the >>docroot, in the same place as index.php >> >> > >like so.. why are you messing around with csv files? > > The client wants the easiest means possible of inputting necessary data (I didn't say the most secure, the easiest), and CSV files can be opened up in Excel and edited. >file config.php > define("APPPATH", "/var/www/html/project"); >?> > >file app.php > include 'config.php'; > echo APPPATH ."\n"; >?> > >bash-2.05b$ php app.php >/var/www/html/project > > > > I can easily write config.php, however, my knowledge of "define" comes from the PHP manual, and I see nowhere where it states that anything in define() is in a persistent state. If I run "config.php", I lose all of my defined constants, don't I? And when I go to "index.php" via browser, how would it know how to go to config.php if config.php would have to reside outside of the docroot? Again I'm probably overcomplicating this but I can't honestly follow your train of logic, though I want to. Phil -- --------------------------------------------------------------------------------- Phil Powell Multimedia Programmer BPX Technologies, Inc. #: (703) 709-7218 x107 Fax: (703) 709-7219 From joel at tagword.com Tue May 18 17:31:15 2004 From: joel at tagword.com (Joel De Gan) Date: Tue, 18 May 2004 17:31:15 -0400 Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP scripts not in docroot? In-Reply-To: <40AA6755.9090702@adnet-sys.com> References: <40AA363B.3060303@adnet-sys.com> <20040518163606.GE2854@thighmaster.digitalpulp.com> <1084906643.9836.6.camel@bezel> <40AA54D8.6090207@adnet-sys.com> <1084911330.9840.11.camel@bezel> <40AA6294.1010201@adnet-sys.com> <1084913682.9845.15.camel@bezel> <40AA6755.9090702@adnet-sys.com> Message-ID: <1084915875.9834.18.camel@bezel> On Tue, 2004-05-18 at 15:43, Phillip Powell wrote: > I can easily write config.php, however, my knowledge of "define" comes > from the PHP manual, and I see nowhere where it states that anything in > define() is in a persistent state. If I run "config.php", I lose all of > my defined constants, don't I? And when I go to "index.php" via > browser, how would it know how to go to config.php if config.php would > have to reside outside of the docroot? > > Again I'm probably overcomplicating this but I can't honestly follow > your train of logic, though I want to. just try it. if you want to know all your defined constants try the following in a script. echo "
\n";
print_r($GLOBALS);


joeldg - developer, Intercosmos media group.
http://lucifer.intercosmos.net



From phillip.powell at adnet-sys.com  Tue May 18 16:28:16 2004
From: phillip.powell at adnet-sys.com (Phillip Powell)
Date: Tue, 18 May 2004 16:28:16 -0400
Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP
	scripts not in docroot?
In-Reply-To: <1084915875.9834.18.camel@bezel>
References: <40AA363B.3060303@adnet-sys.com>	<20040518163606.GE2854@thighmaster.digitalpulp.com>	<1084906643.9836.6.camel@bezel>
	<40AA54D8.6090207@adnet-sys.com>	<1084911330.9840.11.camel@bezel>
	<40AA6294.1010201@adnet-sys.com>	<1084913682.9845.15.camel@bezel>
	<40AA6755.9090702@adnet-sys.com> <1084915875.9834.18.camel@bezel>
Message-ID: <40AA71E0.7050202@adnet-sys.com>

Joel De Gan wrote:

>On Tue, 2004-05-18 at 15:43, Phillip Powell wrote:
>  
>
>>I can easily write config.php, however, my knowledge of "define" comes 
>>from the PHP manual, and I see nowhere where it states that anything in 
>>define() is in a persistent state.  If I run "config.php", I lose all of 
>>my defined constants, don't I?  And when I go to "index.php" via 
>>browser, how would it know how to go to config.php if config.php would 
>>have to reside outside of the docroot?
>>
>>Again I'm probably overcomplicating this but I can't honestly follow 
>>your train of logic, though I want to.
>>    
>>
>
>just try it.
>
>if you want to know all your defined constants try the following in a
>script.
>
>echo "
\n";
>print_r($GLOBALS);
>  
>

I tried it, and here are the steps I would have to take to ensure that 
it would work.

The admin guy will do this:

php -q ../install.php

Here is install.php:



And again, I'm not at all following your train of logic.  In 
"index.php", on the docroot, I have this line:

[PHP]
list($clientFolderName, $projectFolderName) = array(CLIENT_FOLDER_NAME, 
PROJECT_FOLDER_NAME);
require(realpath($_SERVER['DOCUMENT_ROOT'] . 
"/$clientFolderName/${clientFolderName}_globals/client_globals.inc.php"));
[/PHP]

You go to your browser, open up "index.php" and this is what you see:

[Quote]
*Fatal error*: main(): Failed opening required '' 
(include_path='.:/usr/share/pear') in */www/html/index.php* on line *64
[/Quote]

Phil
*

>
>joeldg - developer, Intercosmos media group.
>http://lucifer.intercosmos.net
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>


-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	



From webmaster at localnotion.com  Tue May 18 17:30:25 2004
From: webmaster at localnotion.com (Matthew Terenzio)
Date: Tue, 18 May 2004 17:30:25 -0400
Subject: [nycphp-talk] Smarty
Message-ID: <935AEE3C-A912-11D8-A2AE-0003938BDF32@localnotion.com>

Just read David Sklar's  "Essential PHP tools". It serves as a great 
reference for Pear DB, Auth,HTML_Quickform etc.. I don't even know him, 
so I'm not being biased.

But I was curious about people's feelings of Smarty. Do most think this 
extra processing is worth it? A conscientious job of keeping logic and 
presentation separate would accomplish this as well. Any feelings?

Also, any feelings about DB and whether there is a big performance hit? 
Also, does it work well with stored procedures and other RBDMS specific 
goodies?

Matt Terenzio



From phillip.powell at adnet-sys.com  Tue May 18 17:38:25 2004
From: phillip.powell at adnet-sys.com (Phillip Powell)
Date: Tue, 18 May 2004 17:38:25 -0400
Subject: [nycphp-talk] How do you do the equivalent of $PHP_SELF for PHP
	scripts not in docroot?
In-Reply-To: <1084915875.9834.18.camel@bezel>
References: <40AA363B.3060303@adnet-sys.com>	<20040518163606.GE2854@thighmaster.digitalpulp.com>	<1084906643.9836.6.camel@bezel>
	<40AA54D8.6090207@adnet-sys.com>	<1084911330.9840.11.camel@bezel>
	<40AA6294.1010201@adnet-sys.com>	<1084913682.9845.15.camel@bezel>
	<40AA6755.9090702@adnet-sys.com> <1084915875.9834.18.camel@bezel>
Message-ID: <40AA8251.8020104@adnet-sys.com>

Joel De Gan wrote:

>On Tue, 2004-05-18 at 15:43, Phillip Powell wrote:
>  
>
>>I can easily write config.php, however, my knowledge of "define" comes 
>>from the PHP manual, and I see nowhere where it states that anything in 
>>define() is in a persistent state.  If I run "config.php", I lose all of 
>>my defined constants, don't I?  And when I go to "index.php" via 
>>browser, how would it know how to go to config.php if config.php would 
>>have to reside outside of the docroot?
>>
>>Again I'm probably overcomplicating this but I can't honestly follow 
>>your train of logic, though I want to.
>>    
>>
>
>just try it.
>
>if you want to know all your defined constants try the following in a
>script.
>
>echo "
\n";
>print_r($GLOBALS);
>
>
>joeldg - developer, Intercosmos media group.
>http://lucifer.intercosmos.net
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>
Wow, ok I did overcomplicate it, the solution was so simple it escaped 
me altogether.

Here is my install.php, I just run this from command line:

[PHP]
';
   $fileID = 
@fopen("$docRoot/$clientFolderName/$projectFolderName/include/constants.inc.php", 
'w');
   @fputs($fileID, $includeCode); @fflush($fileID); @fclose($fileID);
  }
?>
[/PHP]

Then once this runs it creates a PHP script within the docroot called 
"constants.inc.php" that is included by "index.php" to, you guessed it, 
define constants.

[from index.php:]
[PHP]
 /*---------------------------------------------------------------------------------------------------------------------------------
    This script will now look for a file called 'constants.inc.php' in 
the /include folder.  This script had to have
    already been generated by the user/admin running "install.php" from 
the command line.
  
----------------------------------------------------------------------------------------------------------------------------------*/ 

  if (!defined('CLIENT_FOLDER_NAME') || !defined('PROJECT_FOLDER_NAME')) 
@include('./include/constants.inc.php');
  if (!defined('CLIENT_FOLDER_NAME') || !defined('PROJECT_FOLDER_NAME')) 
die('You must first run "install.php" from the command line - please see 
admin');
  // BOTH CONSTANTS EXIST AS SET BY install.php - SET TO LOCAL VARIABLES
  list($clientFolderName, $projectFolderName) = 
array(CLIENT_FOLDER_NAME, PROJECT_FOLDER_NAME);
  
  //---END OF CONSTANTS RETRIEVAL 
BLOCK--------------------------------------------------------------------------------------------------------------------------------------------
[/PHP]

*whew* so simple it naturally escaped me.  Thanx
Phil

-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	



From jeffknight at mac.com  Tue May 18 17:38:34 2004
From: jeffknight at mac.com (putamare)
Date: Tue, 18 May 2004 17:38:34 -0400
Subject: [nycphp-talk] Smarty
In-Reply-To: <935AEE3C-A912-11D8-A2AE-0003938BDF32@localnotion.com>
References: <935AEE3C-A912-11D8-A2AE-0003938BDF32@localnotion.com>
Message-ID: 

On May 18, 2004, at 5:30 PM, Matthew Terenzio wrote:
> But I was curious about people's feelings of Smarty. Do most think 
> this extra processing is worth it? A conscientious job of keeping 
> logic and presentation separate would accomplish this as well. Any 
> feelings?

Be sure and check out:
http://nyphp.org/content/presentations/3templates/
For several perspectives on this issue.


jeff.knight not junkmail at nyphp.org



From shiflett at php.net  Tue May 18 21:02:21 2004
From: shiflett at php.net (Chris Shiflett)
Date: Tue, 18 May 2004 18:02:21 -0700 (PDT)
Subject: [nycphp-talk] Smarty
In-Reply-To: <935AEE3C-A912-11D8-A2AE-0003938BDF32@localnotion.com>
Message-ID: <20040519010221.85982.qmail@web14310.mail.yahoo.com>

--- Matthew Terenzio  wrote:
> I was curious about people's feelings of Smarty.

Deja Vu. :-)

This question sparked the largest thread I've ever seen on PHP-General:

http://marc.theaimsgroup.com/?l=php-general&m=108126501502164&w=2

It always makes for a nice debate between three groups of people:

1. Smarty rocks.
2. PHP is a templating system. Why learn another?
3. Templating is good, but Foo is better than Smarty.

This was also the focus of a NYPHP presentation. I encourage you to read
the 100 or so messages sent to PHP-General on the topic and read through
the slides from the NYPHP presentation. You should at least get an idea of
all of the perspectives. :-)

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/


From sklar at sklar.com  Wed May 19 09:31:55 2004
From: sklar at sklar.com (David Sklar)
Date: Wed, 19 May 2004 09:31:55 -0400
Subject: [nycphp-talk] Smarty
In-Reply-To: <935AEE3C-A912-11D8-A2AE-0003938BDF32@localnotion.com>
References: <935AEE3C-A912-11D8-A2AE-0003938BDF32@localnotion.com>
Message-ID: <40AB61CB.6080100@sklar.com>

> Just read David Sklar's  "Essential PHP tools". It serves as a great 
> reference for Pear DB, Auth,HTML_Quickform etc.. I don't even know him, 
> so I'm not being biased.

Thanks!

> But I was curious about people's feelings of Smarty. Do most think this 
> extra processing is worth it? A conscientious job of keeping logic and 
> presentation separate would accomplish this as well. Any feelings?

I think Smarty is a helper in that "conscientiousness" department. If 
that help, for your project or company or whatever, is worth the 
performance tradeoff, then Smarty is a good idea.

There are plenty of ways to boost Smarty's performance (caching, using 
an accelerator), so you can minimize the performance hit. And, to be 
completely honest, most web sites aren't running at the level where 
every last bit of performance is so crucial.

A legitimate downside to Smarty is that you need to learn, essentially, 
another programming language -- Smarty's syntax for variable 
interpolation, its function names, etc. But if that syntax is easier to 
grok for your site designers, then that's a good thing.

See also Adam's spot-on mini-rant a little while ago about including 
human time spent and programmer convenience in your calculations of cost 
and performance. Smarty's advantages definitely fit into that category.

> Also, any feelings about DB and whether there is a big performance hit? 
> Also, does it work well with stored procedures and other RBDMS specific 
> goodies?

I think the big win of DB is that it provides a unified API for database 
access, not so much that it abstracts SQL features whose implementations 
vary across databases. Whatever database program you're using, 
DB::query() sends a query off to the database and (perhaps) returns a 
result handle. The contents of that query can be standard SQL, 
vendor-specific SQL, a stored procedure, whatever you want.

David



From southwell at dneba.com  Wed May 19 12:28:41 2004
From: southwell at dneba.com (Michael Southwell)
Date: Wed, 19 May 2004 12:28:41 -0400
Subject: [nycphp-talk] can PHP4 and 5 co-exist?
Message-ID: <6.1.0.6.2.20040519122752.01efa9d0@mail.optonline.net>

Is there a way to run both PHP4.x and 5 on one machine?

Michael G. Southwell =================================
DNEBA Enterprises
81 South Road
Bloomingdale, NJ 07403-1419
973/492-7873 (voice and fax)
southwell at dneba.com
http://www.dneba.com
======================================================



From jonbaer at jonbaer.net  Wed May 19 12:45:00 2004
From: jonbaer at jonbaer.net (Jon Baer)
Date: Wed, 19 May 2004 12:45:00 -0400
Subject: [nycphp-talk] can PHP4 and 5 co-exist?
In-Reply-To: <6.1.0.6.2.20040519122752.01efa9d0@mail.optonline.net>
References: <6.1.0.6.2.20040519122752.01efa9d0@mail.optonline.net>
Message-ID: <40AB8F0C.6060209@jonbaer.net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yes ...

It involves using a .php5 extension and starting Apache w/ LoadModule
php5_module c:\php5\php5apache2.dll + map x-httpd-php5

More info:

http://www.phpdiscuss.com/article.php?id=69114&group=php.notes

- - Jon

Michael Southwell wrote:
| Is there a way to run both PHP4.x and 5 on one machine?
|
| Michael G. Southwell =================================
| DNEBA Enterprises
| 81 South Road
| Bloomingdale, NJ 07403-1419
| 973/492-7873 (voice and fax)
| southwell at dneba.com
| http://www.dneba.com
| ======================================================
|
| _______________________________________________
| talk mailing list
| talk at lists.nyphp.org
| http://lists.nyphp.org/mailman/listinfo/talk
|
|

- --

pgp key: http://www.jonbaer.net/jonbaer.asc
fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAq48LQdvbi5oMr0cRAkzZAKDZ3vEYUTBW8SvJ3f/DONQNVMoClwCfS1v/
T6NGCdfGfwK1l4UDjAN25m8=
=yAPQ
-----END PGP SIGNATURE-----


From tgales at tgaconnect.com  Wed May 19 12:46:43 2004
From: tgales at tgaconnect.com (Tim Gales)
Date: Wed, 19 May 2004 12:46:43 -0400
Subject: [nycphp-talk] can PHP4 and 5 co-exist?
In-Reply-To: <6.1.0.6.2.20040519122752.01efa9d0@mail.optonline.net>
Message-ID: <000f01c43dc0$dfc03f70$e98d3818@oberon1>

> 
> Is there a way to run both PHP4.x and 5 on one machine?
> 
I have Apache 2.0 something running php 4 and Apache 1.3x 
running rc1 of php 5. I think theoretically both web 
servers could run (listening on different ports) -- 
I never tried it.

T. Gales & Associates
'Helping People Connect with Technology'

http://www.tgaconnect.com



From jonbaer at jonbaer.net  Wed May 19 12:54:01 2004
From: jonbaer at jonbaer.net (Jon Baer)
Date: Wed, 19 May 2004 12:54:01 -0400
Subject: [nycphp-talk] can PHP4 and 5 co-exist?
In-Reply-To: <000f01c43dc0$dfc03f70$e98d3818@oberon1>
References: <000f01c43dc0$dfc03f70$e98d3818@oberon1>
Message-ID: <40AB9129.6010304@jonbaer.net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

An interesting method to try is to proxy:

http://wiki.coggeshall.org/37.html

- -snip-
To solve this problem, I used Apache's mod_proxy module and two apache
servers... My primary server runs PHP 5 as an Apache module and a second
apache server runs PHP 4.3.5 as a module. My configuration requires that
you can setup multiple virtual servers and run Apache to listen on
localhost on port 8080.
- -snip-

- - Jon

Tim Gales wrote:

|>Is there a way to run both PHP4.x and 5 on one machine?
|>
|
| I have Apache 2.0 something running php 4 and Apache 1.3x
| running rc1 of php 5. I think theoretically both web
| servers could run (listening on different ports) --
| I never tried it.

- --

pgp key: http://www.jonbaer.net/jonbaer.asc
fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAq5EoQdvbi5oMr0cRAqI9AKD+mXF0vRcgviz7qV3zRBTStLwFLwCbB0RH
rESLR3oPQG+w6pjbliaAegI=
=+LTJ
-----END PGP SIGNATURE-----


From tgales at tgaconnect.com  Wed May 19 13:07:54 2004
From: tgales at tgaconnect.com (Tim Gales)
Date: Wed, 19 May 2004 13:07:54 -0400
Subject: [nycphp-talk] can PHP4 and 5 co-exist?
In-Reply-To: <40AB9129.6010304@jonbaer.net>
Message-ID: <001001c43dc3$d40a7a30$e98d3818@oberon1>

> -----Original Message-----
> From: talk-bounces at lists.nyphp.org 
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Jon Baer
> Sent: Wednesday, May 19, 2004 12:54 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] can PHP4 and 5 co-exist?
> 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> An interesting method to try is to proxy:
> 
> http://wiki.coggeshall.org/37.html
> 
> - -snip-
> To solve this problem, I used Apache's mod_proxy module and 
> two apache servers... My primary server runs PHP 5 as an 
> Apache module and a second apache server runs PHP 4.3.5 as a 
> module. My configuration requires that you can setup multiple 
> virtual servers and run Apache to listen on localhost on port 8080.
> - -snip-
> 
> - - Jon
> 
Hmmm...
"The magic here is in the _ProxyPass_ directive. This directive basically
passes the request directly through to another host, in this case the
other Apache server running PHP 4 on localhost!"

very interesting --

Thanks Jon,

T. Gales & Associates
'Helping People Connect with Technology'

http://www.tgaconnect.com




From steven at sohh.com  Wed May 19 13:26:30 2004
From: steven at sohh.com (Steven Samuel)
Date: Wed, 19 May 2004 13:26:30 -0400
Subject: [nycphp-talk] Smarty
In-Reply-To: <40AB61CB.6080100@sklar.com>
Message-ID: <022e01c43dc6$72ae6ff0$0300a8c0@STEVEN>

I'm not super techincal when it comes to installing applications on my
Linux server. I'm co-located at Rackspace, and they do a good job of
installing programs when I need it at $75 per hour. The one thing that I
didn't like about Smarty was the installation, which is why I haven't
used it yet.

Right now, I use phpLib's phpCache v1.4 - PHP caching engine. I just
uploaded the templating file and that's it. Any page I want to use the
template on, I just call it via the include and call the object.

Right now, I'd like to get more into XSLT and see if this would be
better.

Steven

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of David Sklar
Sent: Wednesday, May 19, 2004 9:32 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Smarty


> Just read David Sklar's  "Essential PHP tools". It serves as a great
> reference for Pear DB, Auth,HTML_Quickform etc.. I don't even know
him, 
> so I'm not being biased.

Thanks!

> But I was curious about people's feelings of Smarty. Do most think 
> this
> extra processing is worth it? A conscientious job of keeping logic and

> presentation separate would accomplish this as well. Any feelings?

I think Smarty is a helper in that "conscientiousness" department. If 
that help, for your project or company or whatever, is worth the 
performance tradeoff, then Smarty is a good idea.

There are plenty of ways to boost Smarty's performance (caching, using 
an accelerator), so you can minimize the performance hit. And, to be 
completely honest, most web sites aren't running at the level where 
every last bit of performance is so crucial.

A legitimate downside to Smarty is that you need to learn, essentially, 
another programming language -- Smarty's syntax for variable 
interpolation, its function names, etc. But if that syntax is easier to 
grok for your site designers, then that's a good thing.

See also Adam's spot-on mini-rant a little while ago about including 
human time spent and programmer convenience in your calculations of cost

and performance. Smarty's advantages definitely fit into that category.

> Also, any feelings about DB and whether there is a big performance 
> hit?
> Also, does it work well with stored procedures and other RBDMS
specific 
> goodies?

I think the big win of DB is that it provides a unified API for database

access, not so much that it abstracts SQL features whose implementations

vary across databases. Whatever database program you're using, 
DB::query() sends a query off to the database and (perhaps) returns a 
result handle. The contents of that query can be standard SQL, 
vendor-specific SQL, a stored procedure, whatever you want.

David

_______________________________________________
talk mailing list
talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk




From max.goldberg at gmail.com  Wed May 19 13:46:37 2004
From: max.goldberg at gmail.com (max goldberg)
Date: Wed, 19 May 2004 13:46:37 -0400
Subject: [nycphp-talk] Smarty
In-Reply-To: <022e01c43dc6$72ae6ff0$0300a8c0@STEVEN>
References: <022e01c43dc6$72ae6ff0$0300a8c0@STEVEN>
Message-ID: <87e6ded3040519104654af138e@mail.gmail.com>

I find that you take less of a performance hit dealing with templates
than you do with things like large db results that require a lot of
post-processing. While I usually use something a lot smaller and less
involved than Smarty, I feel with a cache/optimizer such as
Turck-MMCache, it almost makes templating a moot point if you cache
the heavy things correctly. For instance, on a site I made, I have
roughly 10 join queries on the front page. I use Turck to cache the
processed query results in shared memory (although you don't need to
use turck, it provides a really simple interface) for five minutes,
and that way, when 1000 people hit my page in 5 minutes I'm doing 10
queries/template calls instead of 10,000.

Something that I've been playing with recently is XDebug (
http://www.xdebug.com/ ), it's pretty useful for code profiling and it
lets you know pretty quick where your slowdowns are.


On Wed, 19 May 2004 13:26:30 -0400, Steven Samuel  wrote:
> 
> I'm not super techincal when it comes to installing applications on my
> Linux server. I'm co-located at Rackspace, and they do a good job of
> installing programs when I need it at $75 per hour. The one thing that I
> didn't like about Smarty was the installation, which is why I haven't
> used it yet.
> 
> Right now, I use phpLib's phpCache v1.4 - PHP caching engine. I just
> uploaded the templating file and that's it. Any page I want to use the
> template on, I just call it via the include and call the object.
> 
> Right now, I'd like to get more into XSLT and see if this would be
> better.
> 
> Steven
> 
> 
> 
> -----Original Message-----
> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
> On Behalf Of David Sklar
> Sent: Wednesday, May 19, 2004 9:32 AM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Smarty
> 
> > Just read David Sklar's  "Essential PHP tools". It serves as a great
> > reference for Pear DB, Auth,HTML_Quickform etc.. I don't even know
> him,
> > so I'm not being biased.
> 
> Thanks!
> 
> > But I was curious about people's feelings of Smarty. Do most think
> > this
> > extra processing is worth it? A conscientious job of keeping logic and
> 
> > presentation separate would accomplish this as well. Any feelings?
> 
> I think Smarty is a helper in that "conscientiousness" department. If
> that help, for your project or company or whatever, is worth the
> performance tradeoff, then Smarty is a good idea.
> 
> There are plenty of ways to boost Smarty's performance (caching, using
> an accelerator), so you can minimize the performance hit. And, to be
> completely honest, most web sites aren't running at the level where
> every last bit of performance is so crucial.
> 
> A legitimate downside to Smarty is that you need to learn, essentially,
> another programming language -- Smarty's syntax for variable
> interpolation, its function names, etc. But if that syntax is easier to
> grok for your site designers, then that's a good thing.
> 
> See also Adam's spot-on mini-rant a little while ago about including
> human time spent and programmer convenience in your calculations of cost
> 
> and performance. Smarty's advantages definitely fit into that category.
> 
> > Also, any feelings about DB and whether there is a big performance
> > hit?
> > Also, does it work well with stored procedures and other RBDMS
> specific
> > goodies?
> 
> I think the big win of DB is that it provides a unified API for database
> 
> access, not so much that it abstracts SQL features whose implementations
> 
> vary across databases. Whatever database program you're using,
> DB::query() sends a query off to the database and (perhaps) returns a
> result handle. The contents of that query can be standard SQL,
> vendor-specific SQL, a stored procedure, whatever you want.
> 
> David
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org http://lists.nyphp.org/mailman/listinfo/talk
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>


From dcech at phpwerx.net  Thu May 20 13:06:14 2004
From: dcech at phpwerx.net (Dan Cech)
Date: Thu, 20 May 2004 13:06:14 -0400
Subject: [nycphp-talk] PHP License Management
Message-ID: <40ACE586.2030408@phpwerx.net>

Hi all,

I've been asked to come up with a licensing solutions for a 
closed-source php application, and wondered if anyone had any advice.

The application will be licensed either in perpetuity or on a 
subscription basis, and each license will be tied to a particular server 
to make unauthorised distribution more difficult.

The idea I came up with was to create a server app where the user could 
log in and view/purchase/extend licenses and manage the IP address(es) 
each license is tied to.

The 'license' itself would be an encrypted token containing the client 
id, expiry date, ip address(es) etc signed with a private key.

The actual software would then be encoded to protect the source from 
(casual) prying eyes (I was thinking of using the Turck MMCache encoder 
for this) and include code to check the license validity and take 
appropriate action.

The most obvious (to me) attack on the system is to reverse-engineer the 
code and remove the license check, which could be mitigated somewhat be 
encoding the entire app and 'hiding' the check within the code.

It seems to me like a viable solution, but I'm no security expert and 
would appreciate any and all comments or pointers to existing solutions.

Dan



From sklar at sklar.com  Thu May 20 13:09:31 2004
From: sklar at sklar.com (David Sklar)
Date: Thu, 20 May 2004 13:09:31 -0400
Subject: [nycphp-talk] PHP License Management
In-Reply-To: <40ACE586.2030408@phpwerx.net>
References: <40ACE586.2030408@phpwerx.net>
Message-ID: <40ACE64B.4030806@sklar.com>

> The actual software would then be encoded to protect the source from 
> (casual) prying eyes (I was thinking of using the Turck MMCache encoder 
> for this) and include code to check the license validity and take 
> appropriate action.
> 
> The most obvious (to me) attack on the system is to reverse-engineer the 
> code and remove the license check, which could be mitigated somewhat be 
> encoding the entire app and 'hiding' the check within the code.

There's no perfect solution here, you just want to be sufficiently ahead 
of likely attackers in the arms race. One thing that might help (but 
will cost you more $) is to use a closed-source encoder like Zend 
Encoder or the ionCube Encoder. Reversing the encoded code is much 
easier when you have the source code to the encoder.

The ionCube encoder offers some protections similar to your licensing 
scheme (but users can't change things), so that might be helpful, too.

David



From jlacey at att.net  Thu May 20 13:10:15 2004
From: jlacey at att.net (John Lacey)
Date: Thu, 20 May 2004 11:10:15 -0600
Subject: [nycphp-talk] PHP License Management
In-Reply-To: <40ACE586.2030408@phpwerx.net>
References: <40ACE586.2030408@phpwerx.net>
Message-ID: <40ACE677.2010201@att.net>



Dan Cech wrote:
> Hi all,
> 
> I've been asked to come up with a licensing solutions for a 
> closed-source php application, and wondered if anyone had any advice.
> 
> The application will be licensed either in perpetuity or on a 
> subscription basis, and each license will be tied to a particular server 
> to make unauthorised distribution more difficult.
> 
> The idea I came up with was to create a server app where the user could 
> log in and view/purchase/extend licenses and manage the IP address(es) 
> each license is tied to.

I'd look for a way other than IP addys since they're a moving 
target, especially if the customer is running a NATed network.

> 
> The 'license' itself would be an encrypted token containing the client 
> id, expiry date, ip address(es) etc signed with a private key.
> 
> The actual software would then be encoded to protect the source from 
> (casual) prying eyes (I was thinking of using the Turck MMCache encoder 
> for this) and include code to check the license validity and take 
> appropriate action.
> 
> The most obvious (to me) attack on the system is to reverse-engineer the 
> code and remove the license check, which could be mitigated somewhat be 
> encoding the entire app and 'hiding' the check within the code.
> 
> It seems to me like a viable solution, but I'm no security expert and 
> would appreciate any and all comments or pointers to existing solutions.
> 
> Dan
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 



From dcech at phpwerx.net  Thu May 20 13:18:01 2004
From: dcech at phpwerx.net (Dan Cech)
Date: Thu, 20 May 2004 13:18:01 -0400
Subject: [nycphp-talk] PHP License Management
In-Reply-To: <40ACE64B.4030806@sklar.com>
References: <40ACE586.2030408@phpwerx.net> <40ACE64B.4030806@sklar.com>
Message-ID: <40ACE849.605@phpwerx.net>

David Sklar wrote:

>> The actual software would then be encoded to protect the source from 
>> (casual) prying eyes (I was thinking of using the Turck MMCache 
>> encoder for this) and include code to check the license validity and 
>> take appropriate action.
>>
>> The most obvious (to me) attack on the system is to reverse-engineer 
>> the code and remove the license check, which could be mitigated 
>> somewhat be encoding the entire app and 'hiding' the check within the 
>> code.
> 
> There's no perfect solution here, you just want to be sufficiently ahead 
> of likely attackers in the arms race. One thing that might help (but 
> will cost you more $) is to use a closed-source encoder like Zend 
> Encoder or the ionCube Encoder. Reversing the encoded code is much 
> easier when you have the source code to the encoder.
> 
> The ionCube encoder offers some protections similar to your licensing 
> scheme (but users can't change things), so that might be helpful, too.

You are right, the closed source nature of ionCube may make it more 
resistant to reverse engineering...in fact I think the company may 
already have a license for it...

ionCube seems to be a lot cheaper than the Zend solutions...and they 
claim it's faster too.

Dan



From nyphp at websapp.com  Thu May 20 13:16:25 2004
From: nyphp at websapp.com (Daniel Kushner)
Date: Thu, 20 May 2004 13:16:25 -0400
Subject: [nycphp-talk] PHP License Management
In-Reply-To: <40ACE586.2030408@phpwerx.net>
Message-ID: <200405201716.i4KHGR2P001460@ns5.oddcast.com>

Warning: I work for Zend Technologies !


The Zend SafeGuard Suite includes the Encoder and licensing software
all-in-one.

http://www.zend.com/store/products/zend-safeguard-suite.php

Zend enjoys giving New York PHP discounts. You can contact me off list if
you're interested ;)

Best,
Daniel Kushner


> -----Original Message-----
> From: talk-bounces at lists.nyphp.org 
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Dan Cech
> Sent: Thursday, May 20, 2004 13:06
> To: NYPHP Talk
> Subject: [nycphp-talk] PHP License Management
> 
> Hi all,
> 
> I've been asked to come up with a licensing solutions for a 
> closed-source php application, and wondered if anyone had any advice.
> 
> The application will be licensed either in perpetuity or on a 
> subscription basis, and each license will be tied to a 
> particular server to make unauthorised distribution more difficult.
> 
> The idea I came up with was to create a server app where the 
> user could log in and view/purchase/extend licenses and 
> manage the IP address(es) each license is tied to.
> 
> The 'license' itself would be an encrypted token containing 
> the client id, expiry date, ip address(es) etc signed with a 
> private key.
> 
> The actual software would then be encoded to protect the source from
> (casual) prying eyes (I was thinking of using the Turck 
> MMCache encoder for this) and include code to check the 
> license validity and take appropriate action.
> 
> The most obvious (to me) attack on the system is to 
> reverse-engineer the code and remove the license check, which 
> could be mitigated somewhat be encoding the entire app and 
> 'hiding' the check within the code.
> 
> It seems to me like a viable solution, but I'm no security 
> expert and would appreciate any and all comments or pointers 
> to existing solutions.
> 
> Dan
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> 
> 




From Rafi.Sheikh at Ingenix.com  Thu May 20 13:31:02 2004
From: Rafi.Sheikh at Ingenix.com (Rafi Sheikh)
Date: Thu, 20 May 2004 12:31:02 -0500
Subject: [nycphp-talk] Change key values in array
Message-ID: 

Hi folks.  Is it possible to change the key value type in an array?  I have
an array that has string key values, for my purposes I need it to have int
index

NOW LOOKS LIKE:
array(6) { ["04-01"]=> int(0) ["04-02"]=> string(2) "32" ["04-03"]=> int(0)
["04-04"]=> int(0) ["04-05"]=> int(0) ["04-06"]=> int(0) }

I NEED IT TO LOOK LIKE:
array(6) { [0]=> int(0) [1]=> string(2) "32" [2]=> int(0) [3]=> int(0) [4]=>
int(0) [5]=> int(0) }

REASON:
I am getting date value from a DB, and than doing an array_merge with
another template to ensure that any missing month for a category get a zero
in the correct sequence.  Problem is that, the resulting array needs to have
int index for the graphing utility to work.

TIA


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.


From phillip.powell at adnet-sys.com  Thu May 20 13:39:28 2004
From: phillip.powell at adnet-sys.com (Phillip Powell)
Date: Thu, 20 May 2004 13:39:28 -0400
Subject: [nycphp-talk] Change key values in array
In-Reply-To: 
References: 
Message-ID: <40ACED50.5080108@adnet-sys.com>

Rafi Sheikh wrote:

>Hi folks.  Is it possible to change the key value type in an array?  I have
>an array that has string key values, for my purposes I need it to have int
>index
>
>NOW LOOKS LIKE:
>array(6) { ["04-01"]=> int(0) ["04-02"]=> string(2) "32" ["04-03"]=> int(0)
>["04-04"]=> int(0) ["04-05"]=> int(0) ["04-06"]=> int(0) }
>
>I NEED IT TO LOOK LIKE:
>array(6) { [0]=> int(0) [1]=> string(2) "32" [2]=> int(0) [3]=> int(0) [4]=>
>int(0) [5]=> int(0) }
>
>  
>

 From first glance I would say just use array_values(), that creates the 
enumerative array you want from the original array with the values in 
the same order.

Phil

>REASON:
>I am getting date value from a DB, and than doing an array_merge with
>another template to ensure that any missing month for a category get a zero
>in the correct sequence.  Problem is that, the resulting array needs to have
>int index for the graphing utility to work.
>
>TIA
>
>
>This e-mail, including attachments, may include confidential and/or
>proprietary information, and may be used only by the person or entity to
>which it is addressed. If the reader of this e-mail is not the intended
>recipient or his or her authorized agent, the reader is hereby notified that
>any dissemination, distribution or copying of this e-mail is prohibited. If
>you have received this e-mail in error, please notify the sender by replying
>to this message and delete this e-mail immediately.
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>


-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	



From nyphp at websapp.com  Thu May 20 13:36:06 2004
From: nyphp at websapp.com (Daniel Kushner)
Date: Thu, 20 May 2004 13:36:06 -0400
Subject: [nycphp-talk] Change key values in array
In-Reply-To: 
Message-ID: <200405201736.i4KHa9wH007583@ns5.oddcast.com>

array_values()

-Daniel


> -----Original Message-----
> From: talk-bounces at lists.nyphp.org 
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Rafi Sheikh
> Sent: Thursday, May 20, 2004 13:31
> To: 'talk at lists.nyphp.org'
> Subject: [nycphp-talk] Change key values in array
> 
> Hi folks.  Is it possible to change the key value type in an 
> array?  I have an array that has string key values, for my 
> purposes I need it to have int index
> 
> NOW LOOKS LIKE:
> array(6) { ["04-01"]=> int(0) ["04-02"]=> string(2) "32" 
> ["04-03"]=> int(0) ["04-04"]=> int(0) ["04-05"]=> int(0) 
> ["04-06"]=> int(0) }
> 
> I NEED IT TO LOOK LIKE:
> array(6) { [0]=> int(0) [1]=> string(2) "32" [2]=> int(0) 
> [3]=> int(0) [4]=>
> int(0) [5]=> int(0) }
> 
> REASON:
> I am getting date value from a DB, and than doing an 
> array_merge with another template to ensure that any missing 
> month for a category get a zero in the correct sequence.  
> Problem is that, the resulting array needs to have int index 
> for the graphing utility to work.
> 
> TIA
> 
> 
> This e-mail, including attachments, may include confidential 
> and/or proprietary information, and may be used only by the 
> person or entity to which it is addressed. If the reader of 
> this e-mail is not the intended recipient or his or her 
> authorized agent, the reader is hereby notified that any 
> dissemination, distribution or copying of this e-mail is 
> prohibited. If you have received this e-mail in error, please 
> notify the sender by replying to this message and delete this 
> e-mail immediately.
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> 
> 




From sm11szw02 at sneakemail.com  Thu May 20 14:09:50 2004
From: sm11szw02 at sneakemail.com (inforequest)
Date: Thu, 20 May 2004 14:09:50 -0400
Subject: [nycphp-talk] PHP License Management
In-Reply-To: <200405201716.i4KHGR2P001460@ns5.oddcast.com>
References: <200405201716.i4KHGR2P001460@ns5.oddcast.com>
Message-ID: <28355-34786@sneakemail.com>

I have used Zen and ionCube on small-scale projects, and I can add:

Consider your vendor in light of your support needs - how much do you 
provide and how much do your customers need. If you will be doing the 
server setup/config then maybe there's no issue, but if the customer has 
to accomodate your use of Zend or ionCube then you may want to consider 
how each of those vendors handles inquiries (since they now become a 
contributor to your companies customer satisfaction quotient). Last 
thing you need is a great product that gets a bad rep because your 
encoder vendor had some compatibility issues.

When I was using ionCube there were some issues with the order in which 
ionCube and Zend extensions were to be installed, and when I used Zend 
there were some additional issues as well related to other products in 
use on the same server. It got messy when the customer moved from dev to 
production servers, especially.  I handled the Zend issues with Zend 
support (they responded very well) and handled the ionCube stuff via 
Internet searches. In then end my solution was dependent on end-user 
server configuration -- something to be aware of. That was a year ago.

I would recommend tying the product to domain name instead of IP. Makes 
for fewer support calls and customer inquiries (change of DNS doesn't 
require support), and perhaps most importantly ties integrity to a 
brand. IMHO companies are less inclined to try beating it  when their 
brand name may be compromised/banned. There may be security issues of 
which I am not attuned that make IP a better choice.

I would also recommend you encode only choice parts using a modular 
approach, perhaps only encoding parts that tie to IP or domain, and then 
a few random bits for obfuscation. This deters the casual cracker, and 
occupies the  determined infringer. Not sure how it plays into 
performance though.

IMHO the  Zend  solution is more likely to need an update when the Zend 
suite is updated, while the ionCube product is more stand-alone (and 
perhaps may be a better value if you only need a perpetual license for 
the encoder).

Finally I have noticed alot of back and forth banter in vendor pre-sale 
forums when encoding is part of the solution, related to how it is used, 
how it effects portability (the IP vs. Domain name thing), who supports 
the server config, etc. If you make it clear that you use encoding, 
perhaps provide sufficient info up front about how it is used or you may 
end up increasing your pre-sale support costs.

-=john

Daniel Kushner nyphp-at-websapp.com |nyphp 04/2004| wrote:

>Warning: I work for Zend Technologies !
>
>
>The Zend SafeGuard Suite includes the Encoder and licensing software
>all-in-one.
>
>http://www.zend.com/store/products/zend-safeguard-suite.php
>
>Zend enjoys giving New York PHP discounts. You can contact me off list if
>you're interested ;)
>
>Best,
>Daniel Kushner
>
>
>  
>
>>-----Original Message-----
>>From: talk-bounces at lists.nyphp.org 
>>[mailto:talk-bounces at lists.nyphp.org] On Behalf Of Dan Cech
>>Sent: Thursday, May 20, 2004 13:06
>>To: NYPHP Talk
>>Subject: [nycphp-talk] PHP License Management
>>
>>Hi all,
>>
>>I've been asked to come up with a licensing solutions for a 
>>closed-source php application, and wondered if anyone had any advice.
>>
>>The application will be licensed either in perpetuity or on a 
>>subscription basis, and each license will be tied to a 
>>particular server to make unauthorised distribution more difficult.
>>
>>The idea I came up with was to create a server app where the 
>>user could log in and view/purchase/extend licenses and 
>>manage the IP address(es) each license is tied to.
>>
>>The 'license' itself would be an encrypted token containing 
>>the client id, expiry date, ip address(es) etc signed with a 
>>private key.
>>
>>The actual software would then be encoded to protect the source from
>>(casual) prying eyes (I was thinking of using the Turck 
>>MMCache encoder for this) and include code to check the 
>>license validity and take appropriate action.
>>
>>The most obvious (to me) attack on the system is to 
>>reverse-engineer the code and remove the license check, which 
>>could be mitigated somewhat be encoding the entire app and 
>>'hiding' the check within the code.
>>
>>It seems to me like a viable solution, but I'm no security 
>>expert and would appreciate any and all comments or pointers 
>>to existing solutions.
>>
>>Dan
>>
>>_______________________________________________
>>talk mailing list
>>talk at lists.nyphp.org
>>http://lists.nyphp.org/mailman/listinfo/talk
>>
>>
>>
>>    
>>
>
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>



From Rafi.Sheikh at Ingenix.com  Thu May 20 15:28:57 2004
From: Rafi.Sheikh at Ingenix.com (Rafi Sheikh)
Date: Thu, 20 May 2004 14:28:57 -0500
Subject: [nycphp-talk] RE: talk Digest, Vol 12, Issue 26
Message-ID: 

Thank you.  I used array_values and worked like a dream.  Thx again!

-----Original Message-----
From: talk-request at lists.nyphp.org [mailto:talk-request at lists.nyphp.org]
Sent: Thursday, May 20, 2004 1:10 PM
To: talk at lists.nyphp.org
Subject: talk Digest, Vol 12, Issue 26


Send talk mailing list submissions to
	talk at lists.nyphp.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.nyphp.org/mailman/listinfo/talk
or, via email, send a message with subject or body 'help' to
	talk-request at lists.nyphp.org

You can reach the person managing the list at
	talk-owner at lists.nyphp.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of talk digest..."


Today's Topics:

   1. PHP License Management (Dan Cech)
   2. Re: PHP License Management (David Sklar)
   3. Re: PHP License Management (John Lacey)
   4. Re: PHP License Management (Dan Cech)
   5. RE: PHP License Management (Daniel Kushner)
   6. Change key values in array (Rafi Sheikh)
   7. Re: Change key values in array (Phillip Powell)
   8. RE: Change key values in array (Daniel Kushner)
   9. Re: PHP License Management (inforequest)


----------------------------------------------------------------------

Message: 1
Date: Thu, 20 May 2004 13:06:14 -0400
From: Dan Cech 
Subject: [nycphp-talk] PHP License Management
To: NYPHP Talk 
Message-ID: <40ACE586.2030408 at phpwerx.net>
Content-Type: text/plain; charset=us-ascii; format=flowed

Hi all,

I've been asked to come up with a licensing solutions for a 
closed-source php application, and wondered if anyone had any advice.

The application will be licensed either in perpetuity or on a 
subscription basis, and each license will be tied to a particular server 
to make unauthorised distribution more difficult.

The idea I came up with was to create a server app where the user could 
log in and view/purchase/extend licenses and manage the IP address(es) 
each license is tied to.

The 'license' itself would be an encrypted token containing the client 
id, expiry date, ip address(es) etc signed with a private key.

The actual software would then be encoded to protect the source from 
(casual) prying eyes (I was thinking of using the Turck MMCache encoder 
for this) and include code to check the license validity and take 
appropriate action.

The most obvious (to me) attack on the system is to reverse-engineer the 
code and remove the license check, which could be mitigated somewhat be 
encoding the entire app and 'hiding' the check within the code.

It seems to me like a viable solution, but I'm no security expert and 
would appreciate any and all comments or pointers to existing solutions.

Dan



------------------------------

Message: 2
Date: Thu, 20 May 2004 13:09:31 -0400
From: David Sklar 
Subject: Re: [nycphp-talk] PHP License Management
To: NYPHP Talk 
Message-ID: <40ACE64B.4030806 at sklar.com>
Content-Type: text/plain; charset=us-ascii; format=flowed

> The actual software would then be encoded to protect the source from 
> (casual) prying eyes (I was thinking of using the Turck MMCache encoder 
> for this) and include code to check the license validity and take 
> appropriate action.
> 
> The most obvious (to me) attack on the system is to reverse-engineer the 
> code and remove the license check, which could be mitigated somewhat be 
> encoding the entire app and 'hiding' the check within the code.

There's no perfect solution here, you just want to be sufficiently ahead 
of likely attackers in the arms race. One thing that might help (but 
will cost you more $) is to use a closed-source encoder like Zend 
Encoder or the ionCube Encoder. Reversing the encoded code is much 
easier when you have the source code to the encoder.

The ionCube encoder offers some protections similar to your licensing 
scheme (but users can't change things), so that might be helpful, too.

David



------------------------------

Message: 3
Date: Thu, 20 May 2004 11:10:15 -0600
From: John Lacey 
Subject: Re: [nycphp-talk] PHP License Management
To: NYPHP Talk 
Message-ID: <40ACE677.2010201 at att.net>
Content-Type: text/plain; charset=us-ascii; format=flowed



Dan Cech wrote:
> Hi all,
> 
> I've been asked to come up with a licensing solutions for a 
> closed-source php application, and wondered if anyone had any advice.
> 
> The application will be licensed either in perpetuity or on a 
> subscription basis, and each license will be tied to a particular server 
> to make unauthorised distribution more difficult.
> 
> The idea I came up with was to create a server app where the user could 
> log in and view/purchase/extend licenses and manage the IP address(es) 
> each license is tied to.

I'd look for a way other than IP addys since they're a moving 
target, especially if the customer is running a NATed network.

> 
> The 'license' itself would be an encrypted token containing the client 
> id, expiry date, ip address(es) etc signed with a private key.
> 
> The actual software would then be encoded to protect the source from 
> (casual) prying eyes (I was thinking of using the Turck MMCache encoder 
> for this) and include code to check the license validity and take 
> appropriate action.
> 
> The most obvious (to me) attack on the system is to reverse-engineer the 
> code and remove the license check, which could be mitigated somewhat be 
> encoding the entire app and 'hiding' the check within the code.
> 
> It seems to me like a viable solution, but I'm no security expert and 
> would appreciate any and all comments or pointers to existing solutions.
> 
> Dan
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 



------------------------------

Message: 4
Date: Thu, 20 May 2004 13:18:01 -0400
From: Dan Cech 
Subject: Re: [nycphp-talk] PHP License Management
To: NYPHP Talk 
Message-ID: <40ACE849.605 at phpwerx.net>
Content-Type: text/plain; charset=us-ascii; format=flowed

David Sklar wrote:

>> The actual software would then be encoded to protect the source from 
>> (casual) prying eyes (I was thinking of using the Turck MMCache 
>> encoder for this) and include code to check the license validity and 
>> take appropriate action.
>>
>> The most obvious (to me) attack on the system is to reverse-engineer 
>> the code and remove the license check, which could be mitigated 
>> somewhat be encoding the entire app and 'hiding' the check within the 
>> code.
> 
> There's no perfect solution here, you just want to be sufficiently ahead 
> of likely attackers in the arms race. One thing that might help (but 
> will cost you more $) is to use a closed-source encoder like Zend 
> Encoder or the ionCube Encoder. Reversing the encoded code is much 
> easier when you have the source code to the encoder.
> 
> The ionCube encoder offers some protections similar to your licensing 
> scheme (but users can't change things), so that might be helpful, too.

You are right, the closed source nature of ionCube may make it more 
resistant to reverse engineering...in fact I think the company may 
already have a license for it...

ionCube seems to be a lot cheaper than the Zend solutions...and they 
claim it's faster too.

Dan



------------------------------

Message: 5
Date: Thu, 20 May 2004 13:16:25 -0400
From: "Daniel Kushner" 
Subject: RE: [nycphp-talk] PHP License Management
To: "'NYPHP Talk'" 
Message-ID: <200405201716.i4KHGR2P001460 at ns5.oddcast.com>
Content-Type: text/plain;	charset="us-ascii"

Warning: I work for Zend Technologies !


The Zend SafeGuard Suite includes the Encoder and licensing software
all-in-one.

http://www.zend.com/store/products/zend-safeguard-suite.php

Zend enjoys giving New York PHP discounts. You can contact me off list if
you're interested ;)

Best,
Daniel Kushner


> -----Original Message-----
> From: talk-bounces at lists.nyphp.org 
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Dan Cech
> Sent: Thursday, May 20, 2004 13:06
> To: NYPHP Talk
> Subject: [nycphp-talk] PHP License Management
> 
> Hi all,
> 
> I've been asked to come up with a licensing solutions for a 
> closed-source php application, and wondered if anyone had any advice.
> 
> The application will be licensed either in perpetuity or on a 
> subscription basis, and each license will be tied to a 
> particular server to make unauthorised distribution more difficult.
> 
> The idea I came up with was to create a server app where the 
> user could log in and view/purchase/extend licenses and 
> manage the IP address(es) each license is tied to.
> 
> The 'license' itself would be an encrypted token containing 
> the client id, expiry date, ip address(es) etc signed with a 
> private key.
> 
> The actual software would then be encoded to protect the source from
> (casual) prying eyes (I was thinking of using the Turck 
> MMCache encoder for this) and include code to check the 
> license validity and take appropriate action.
> 
> The most obvious (to me) attack on the system is to 
> reverse-engineer the code and remove the license check, which 
> could be mitigated somewhat be encoding the entire app and 
> 'hiding' the check within the code.
> 
> It seems to me like a viable solution, but I'm no security 
> expert and would appreciate any and all comments or pointers 
> to existing solutions.
> 
> Dan
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> 
> 




------------------------------

Message: 6
Date: Thu, 20 May 2004 12:31:02 -0500
From: Rafi Sheikh 
Subject: [nycphp-talk] Change key values in array
To: "'talk at lists.nyphp.org'" 
Message-ID:
	
Content-Type: text/plain;	charset="iso-8859-1"

Hi folks.  Is it possible to change the key value type in an array?  I have
an array that has string key values, for my purposes I need it to have int
index

NOW LOOKS LIKE:
array(6) { ["04-01"]=> int(0) ["04-02"]=> string(2) "32" ["04-03"]=> int(0)
["04-04"]=> int(0) ["04-05"]=> int(0) ["04-06"]=> int(0) }

I NEED IT TO LOOK LIKE:
array(6) { [0]=> int(0) [1]=> string(2) "32" [2]=> int(0) [3]=> int(0) [4]=>
int(0) [5]=> int(0) }

REASON:
I am getting date value from a DB, and than doing an array_merge with
another template to ensure that any missing month for a category get a zero
in the correct sequence.  Problem is that, the resulting array needs to have
int index for the graphing utility to work.

TIA


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.


------------------------------

Message: 7
Date: Thu, 20 May 2004 13:39:28 -0400
From: Phillip Powell 
Subject: Re: [nycphp-talk] Change key values in array
To: NYPHP Talk 
Message-ID: <40ACED50.5080108 at adnet-sys.com>
Content-Type: text/plain; charset=us-ascii; format=flowed

Rafi Sheikh wrote:

>Hi folks.  Is it possible to change the key value type in an array?  I have
>an array that has string key values, for my purposes I need it to have int
>index
>
>NOW LOOKS LIKE:
>array(6) { ["04-01"]=> int(0) ["04-02"]=> string(2) "32" ["04-03"]=> int(0)
>["04-04"]=> int(0) ["04-05"]=> int(0) ["04-06"]=> int(0) }
>
>I NEED IT TO LOOK LIKE:
>array(6) { [0]=> int(0) [1]=> string(2) "32" [2]=> int(0) [3]=> int(0)
[4]=>
>int(0) [5]=> int(0) }
>
>  
>

 From first glance I would say just use array_values(), that creates the 
enumerative array you want from the original array with the values in 
the same order.

Phil

>REASON:
>I am getting date value from a DB, and than doing an array_merge with
>another template to ensure that any missing month for a category get a zero
>in the correct sequence.  Problem is that, the resulting array needs to
have
>int index for the graphing utility to work.
>
>TIA
>
>
>This e-mail, including attachments, may include confidential and/or
>proprietary information, and may be used only by the person or entity to
>which it is addressed. If the reader of this e-mail is not the intended
>recipient or his or her authorized agent, the reader is hereby notified
that
>any dissemination, distribution or copying of this e-mail is prohibited. If
>you have received this e-mail in error, please notify the sender by
replying
>to this message and delete this e-mail immediately.
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>


-- 
----------------------------------------------------------------------------
-----
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	



------------------------------

Message: 8
Date: Thu, 20 May 2004 13:36:06 -0400
From: "Daniel Kushner" 
Subject: RE: [nycphp-talk] Change key values in array
To: "'NYPHP Talk'" 
Message-ID: <200405201736.i4KHa9wH007583 at ns5.oddcast.com>
Content-Type: text/plain;	charset="us-ascii"

array_values()

-Daniel


> -----Original Message-----
> From: talk-bounces at lists.nyphp.org 
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Rafi Sheikh
> Sent: Thursday, May 20, 2004 13:31
> To: 'talk at lists.nyphp.org'
> Subject: [nycphp-talk] Change key values in array
> 
> Hi folks.  Is it possible to change the key value type in an 
> array?  I have an array that has string key values, for my 
> purposes I need it to have int index
> 
> NOW LOOKS LIKE:
> array(6) { ["04-01"]=> int(0) ["04-02"]=> string(2) "32" 
> ["04-03"]=> int(0) ["04-04"]=> int(0) ["04-05"]=> int(0) 
> ["04-06"]=> int(0) }
> 
> I NEED IT TO LOOK LIKE:
> array(6) { [0]=> int(0) [1]=> string(2) "32" [2]=> int(0) 
> [3]=> int(0) [4]=>
> int(0) [5]=> int(0) }
> 
> REASON:
> I am getting date value from a DB, and than doing an 
> array_merge with another template to ensure that any missing 
> month for a category get a zero in the correct sequence.  
> Problem is that, the resulting array needs to have int index 
> for the graphing utility to work.
> 
> TIA
> 
> 
> This e-mail, including attachments, may include confidential 
> and/or proprietary information, and may be used only by the 
> person or entity to which it is addressed. If the reader of 
> this e-mail is not the intended recipient or his or her 
> authorized agent, the reader is hereby notified that any 
> dissemination, distribution or copying of this e-mail is 
> prohibited. If you have received this e-mail in error, please 
> notify the sender by replying to this message and delete this 
> e-mail immediately.
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> 
> 




------------------------------

Message: 9
Date: Thu, 20 May 2004 14:09:50 -0400
From: "inforequest" 
Subject: Re: [nycphp-talk] PHP License Management
To: talk at lists.nyphp.org
Message-ID: <28355-34786 at sneakemail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I have used Zen and ionCube on small-scale projects, and I can add:

Consider your vendor in light of your support needs - how much do you 
provide and how much do your customers need. If you will be doing the 
server setup/config then maybe there's no issue, but if the customer has 
to accomodate your use of Zend or ionCube then you may want to consider 
how each of those vendors handles inquiries (since they now become a 
contributor to your companies customer satisfaction quotient). Last 
thing you need is a great product that gets a bad rep because your 
encoder vendor had some compatibility issues.

When I was using ionCube there were some issues with the order in which 
ionCube and Zend extensions were to be installed, and when I used Zend 
there were some additional issues as well related to other products in 
use on the same server. It got messy when the customer moved from dev to 
production servers, especially.  I handled the Zend issues with Zend 
support (they responded very well) and handled the ionCube stuff via 
Internet searches. In then end my solution was dependent on end-user 
server configuration -- something to be aware of. That was a year ago.

I would recommend tying the product to domain name instead of IP. Makes 
for fewer support calls and customer inquiries (change of DNS doesn't 
require support), and perhaps most importantly ties integrity to a 
brand. IMHO companies are less inclined to try beating it  when their 
brand name may be compromised/banned. There may be security issues of 
which I am not attuned that make IP a better choice.

I would also recommend you encode only choice parts using a modular 
approach, perhaps only encoding parts that tie to IP or domain, and then 
a few random bits for obfuscation. This deters the casual cracker, and 
occupies the  determined infringer. Not sure how it plays into 
performance though.

IMHO the  Zend  solution is more likely to need an update when the Zend 
suite is updated, while the ionCube product is more stand-alone (and 
perhaps may be a better value if you only need a perpetual license for 
the encoder).

Finally I have noticed alot of back and forth banter in vendor pre-sale 
forums when encoding is part of the solution, related to how it is used, 
how it effects portability (the IP vs. Domain name thing), who supports 
the server config, etc. If you make it clear that you use encoding, 
perhaps provide sufficient info up front about how it is used or you may 
end up increasing your pre-sale support costs.

-=john

Daniel Kushner nyphp-at-websapp.com |nyphp 04/2004| wrote:

>Warning: I work for Zend Technologies !
>
>
>The Zend SafeGuard Suite includes the Encoder and licensing software
>all-in-one.
>
>http://www.zend.com/store/products/zend-safeguard-suite.php
>
>Zend enjoys giving New York PHP discounts. You can contact me off list if
>you're interested ;)
>
>Best,
>Daniel Kushner
>
>
>  
>
>>-----Original Message-----
>>From: talk-bounces at lists.nyphp.org 
>>[mailto:talk-bounces at lists.nyphp.org] On Behalf Of Dan Cech
>>Sent: Thursday, May 20, 2004 13:06
>>To: NYPHP Talk
>>Subject: [nycphp-talk] PHP License Management
>>
>>Hi all,
>>
>>I've been asked to come up with a licensing solutions for a 
>>closed-source php application, and wondered if anyone had any advice.
>>
>>The application will be licensed either in perpetuity or on a 
>>subscription basis, and each license will be tied to a 
>>particular server to make unauthorised distribution more difficult.
>>
>>The idea I came up with was to create a server app where the 
>>user could log in and view/purchase/extend licenses and 
>>manage the IP address(es) each license is tied to.
>>
>>The 'license' itself would be an encrypted token containing 
>>the client id, expiry date, ip address(es) etc signed with a 
>>private key.
>>
>>The actual software would then be encoded to protect the source from
>>(casual) prying eyes (I was thinking of using the Turck 
>>MMCache encoder for this) and include code to check the 
>>license validity and take appropriate action.
>>
>>The most obvious (to me) attack on the system is to 
>>reverse-engineer the code and remove the license check, which 
>>could be mitigated somewhat be encoding the entire app and 
>>'hiding' the check within the code.
>>
>>It seems to me like a viable solution, but I'm no security 
>>expert and would appreciate any and all comments or pointers 
>>to existing solutions.
>>
>>Dan
>>
>>_______________________________________________
>>talk mailing list
>>talk at lists.nyphp.org
>>http://lists.nyphp.org/mailman/listinfo/talk
>>
>>
>>
>>    
>>
>
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>



------------------------------

_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk


End of talk Digest, Vol 12, Issue 26
************************************


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.


From tom at supertom.com  Thu May 20 22:20:17 2004
From: tom at supertom.com (Tom)
Date: Thu, 20 May 2004 22:20:17 -0400
Subject: [nycphp-talk] pear makerpm
Message-ID: <0HY100MMEKIOL2@mta5.srv.hcvlny.cv.net>

Hey folks,
 
Anyone have experience with the makerpm option in PEAR?  I can generate the
SPEC file just fine, but I can't build the rpm with rpmbuild -bb, as it says
in the manual.  I have the source tarball in the SOURCES directory, and the
SPEC file in the SPECS directory.  The error that I receive is:
 
error: Bad exit status from /var/tmp/rpm-tmp.31347 (%prep)
 
I get a similar error for any of the packages that I try to build.
 
I also have some questions about the pear format in general.  I'm going
through the developer's guide at pear.php.net to learn more about the pear
package format.  What I don't see is where the package is "registered", so
the system knows what version you are running.
 
Can anyone shed some light on these?
 
Thanks,
 
Tom
www.liphp.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From leam at reuel.net  Fri May 21 04:35:17 2004
From: leam at reuel.net (leam)
Date: Fri, 21 May 2004 04:35:17 -0400
Subject: [nycphp-talk] pear makerpm
In-Reply-To: <0HY100MMEKIOL2@mta5.srv.hcvlny.cv.net>
References: <0HY100MMEKIOL2@mta5.srv.hcvlny.cv.net>
Message-ID: <40ADBF45.8010506@reuel.net>

Tom wrote:
> Hey folks,
>  
> Anyone have experience with the makerpm option in PEAR?  I can generate the
> SPEC file just fine, but I can't build the rpm with rpmbuild -bb, as it says
> in the manual.  I have the source tarball in the SOURCES directory, and the
> SPEC file in the SPECS directory.  The error that I receive is:
>  
> error: Bad exit status from /var/tmp/rpm-tmp.31347 (%prep)
>  
> I get a similar error for any of the packages that I try to build.

> Can anyone shed some light on these?
>  
> Thanks,
>  
> Tom
> www.liphp.org

I don't know that much, but can you send the spec file? The (%prep) 
stanza may need looking at.

ciao!

leam



From tom at supertom.com  Fri May 21 08:10:44 2004
From: tom at supertom.com (Tom)
Date: Fri, 21 May 2004 08:10:44 -0400
Subject: [nycphp-talk] pear makerpm
In-Reply-To: <40ADBF45.8010506@reuel.net>
Message-ID: <0HY200AHEBU99U@mta2.srv.hcvlny.cv.net>

I guess I should have included that - here it is below - generated from
PEAR:

In one of the PEAR directories, there template.spec file, and this just gets
the specific values swapped in.


Summary: PEAR: Framework to benchmark PHP scripts or function calls.
Name: PEAR::Benchmark
Version: 1.2.1
Release: 1
License: PHP License
Group: Development/Libraries
Source: http://pear.php.net/get/Benchmark-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-root
URL: http://pear.php.net/
Prefix: %{_prefix}
#Docdir: /usr/share/pear/docs/Benchmark
BuildArchitectures: noarch


%description
Framework to benchmark PHP scripts or function calls.

%prep
rm -rf %{buildroot}/*
# XXX Source files location is missing here in pear cmd
pear -v -c %{buildroot}/pearrc \
        -d php_dir=%{_libdir}/php/pear \
        -d doc_dir=/docs \
        -d bin_dir=%{_bindir} \
        -d data_dir=%{_libdir}/php/pear/data \
        -d test_dir=%{_libdir}/php/pear/tests \
        -d ext_dir=%{_libdir} \
        -s

%build
echo BuildRoot=%{buildroot}

%postun
pear uninstall --nodeps -r Benchmark
rm /var/lib/pear/Benchmark.xml

%post
pear install --nodeps -r /var/lib/pear/Benchmark.xml

%install
pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \
        $RPM_SOURCE_DIR/Benchmark-%{version}.tgz
rm %{buildroot}/pearrc
rm %{buildroot}/%{_libdir}/php/pear/.filemap
rm %{buildroot}/%{_libdir}/php/pear/.lock
rm -rf %{buildroot}/%{_libdir}/php/pear/.registry
if [ -d "%{buildroot}/docs/Benchmark/doc" ]; then
    rm -rf $RPM_BUILD_DIR/doc
    mv %{buildroot}/docs/Benchmark/doc $RPM_BUILD_DIR
    rm -rf %{buildroot}/docs
fi
mkdir -p %{buildroot}/var/lib/pear
tar -xzf $RPM_SOURCE_DIR/Benchmark-%{version}.tgz package.xml
cp -p package.xml %{buildroot}/var/lib/pear/Benchmark.xml

#rm -rf %{buildroot}/*
#pear -q install -R %{buildroot} -n package.xml
#mkdir -p %{buildroot}/var/lib/pear
#cp -p package.xml %{buildroot}/var/lib/pear/Benchmark.xml

%files
    %defattr(-,root,root)
    %doc  doc/timer_example.php
    /


 

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of leam
Sent: Friday, May 21, 2004 4:35 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] pear makerpm

Tom wrote:
> Hey folks,
>  
> Anyone have experience with the makerpm option in PEAR?  I can 
> generate the SPEC file just fine, but I can't build the rpm with 
> rpmbuild -bb, as it says in the manual.  I have the source tarball in 
> the SOURCES directory, and the SPEC file in the SPECS directory.  The
error that I receive is:
>  
> error: Bad exit status from /var/tmp/rpm-tmp.31347 (%prep)
>  
> I get a similar error for any of the packages that I try to build.

> Can anyone shed some light on these?
>  
> Thanks,
>  
> Tom
> www.liphp.org

I don't know that much, but can you send the spec file? The (%prep) stanza
may need looking at.

ciao!

leam

_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk





From jkelly at sussex.edu  Fri May 21 10:15:28 2004
From: jkelly at sussex.edu (jessica kelly)
Date: Fri, 21 May 2004 10:15:28 -0400
Subject: [nycphp-talk] New Functions on old PHP
Message-ID: 

Hi,

I have an script that was written after PHP 4.0.5 and wish to figure out what functions need to be worked around to get it to work on the 4.0.5 server. 

Other than checking the functions one by one on the function / PHP version table at php.net, is there a tool out there that would do it for me?

TIA,

Jessica





From phillip.powell at adnet-sys.com  Fri May 21 10:25:13 2004
From: phillip.powell at adnet-sys.com (Phillip Powell)
Date: Fri, 21 May 2004 10:25:13 -0400
Subject: [nycphp-talk] MySQL 4.0.10 Fulltext Search Relevancy Problem
Message-ID: <40AE1149.6060609@adnet-sys.com>

Apologies in advance if this is off-topic but this has been a perplexing 
issue now for weeks and found no resolution on several PHP and MySQL 
boards and forums.

Environment: PHP 4.3.2, MySQL 4.0.10, Apache 2.0, Linux Red Hat 7.3


I have a rather complicated query that is dynamically created via PHP 
class method, with a combination of LEFT JOINs and two MATCHES where the 
first match is non-boolean to get the accurate score, the second to 
search as boolean:

    quote:
    ------------------------------------------------------------------------

    SELECT
    image.id, image.image_name,
    (MATCH (image_name, image_alt, image_location_city,
    image_location_state, image_location_country) AGAINST ('test')
    OR MATCH (first_name, last_name) AGAINST ('test')
    OR MATCH (keyword_name) AGAINST ('test')
    OR MATCH (event_name) AGAINST ('test')
    OR MATCH (placement_name) AGAINST ('test')
    ) as score,
    image.image_path, image.image_creation_date
    FROM image

    LEFT JOIN image_person_assoc ON image_person_assoc.image_id = image.id
    LEFT JOIN person ON person.id = image_person_assoc.person_id
    LEFT JOIN image_keyword_assoc ON image_keyword_assoc.image_id =
    image.id
    LEFT JOIN keyword ON keyword.id = image_keyword_assoc.keyword_id
    LEFT JOIN image_event_assoc ON image_event_assoc.image_id = image.id
    LEFT JOIN event ON event.id = image_event_assoc.event_id
    LEFT JOIN image_placement_assoc ON image_placement_assoc.image_id =
    image.id
    LEFT JOIN placement ON placement.id =
    image_placement_assoc.placement_id

    WHERE MATCH (image_name, image_alt, image_location_city,
    image_location_state, image_location_country) AGAINST ('+test+' IN
    BOOLEAN MODE)
    OR MATCH (first_name, last_name) AGAINST ('+test+' IN BOOLEAN MODE)
    OR MATCH (keyword_name) AGAINST ('+test+' IN BOOLEAN MODE)
    OR MATCH (event_name) AGAINST ('+test+' IN BOOLEAN MODE)
    OR MATCH (placement_name) AGAINST ('+test+' IN BOOLEAN MODE)

    GROUP BY image.id
    ORDER BY score DESC, upper(image.image_name) ASC
    ------------------------------------------------------------------------



Sample Results:

    quote:
    ------------------------------------------------------------------------

    +-----+----------------------------+-------+-------------------------------------------------------------------------+---------------------+

    | id | image_name             | score |
    image_path                                     | image_creation_date |
    +-----+----------------------------+-------+-------------------------------------------------------------------------+---------------------+

    | 100 |blah.jpg                   | 1        |
    /html/images/blah.jpg                  | 2003-01-01 |
    | 101 | mysql-81x42.png | 1        | /html/images/mysql-81x42.png |
    0000-00-00 |
    +-----+----------------------------+-------+-------------------------------------------------------------------------+---------------------+

    ------------------------------------------------------------------------



Using this query I always get a relevancy score of 1 every time; I do 
not actually get the floating-point decimal number that I was seeking 
(the accurate relevancy); this based on information I found at 
http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html . The SQL query 
is correct, though (I receive no SQl-related nor MySQL-related errors), 
just not numerically accurate in its relevancy.

Anything I might need to do to finetune this?

Thanx
Phil

-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	



From nyphp at websapp.com  Fri May 21 10:21:57 2004
From: nyphp at websapp.com (Daniel Kushner)
Date: Fri, 21 May 2004 10:21:57 -0400
Subject: [nycphp-talk] New Functions on old PHP
In-Reply-To: 
Message-ID: <200405211422.i4LEM13S013920@ns5.oddcast.com>

http://www.zend.com/phpfunc/a.php

-Daniel
 

> -----Original Message-----
> From: talk-bounces at lists.nyphp.org 
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of jessica kelly
> Sent: Friday, May 21, 2004 10:15
> To: talk at lists.nyphp.org
> Subject: [nycphp-talk] New Functions on old PHP
> 
> Hi,
> 
> I have an script that was written after PHP 4.0.5 and wish to 
> figure out what functions need to be worked around to get it 
> to work on the 4.0.5 server. 
> 
> Other than checking the functions one by one on the function 
> / PHP version table at php.net, is there a tool out there 
> that would do it for me?
> 
> TIA,
> 
> Jessica
> 
> 
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> 
> 



>From hans not junk at nyphp.com  Fri May 21 13:18:50 2004
Return-Path: 
Received: from ehost011-1.intermedia.net (ehost011-1.intermedia.net
	[64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id A24FDA860A
	for ; Fri, 21 May 2004 13:18:50 -0400 (EDT)
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] MySQL 4.0.10 Fulltext Search Relevancy Problem
Date: Fri, 21 May 2004 10:18:46 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F8702108DE6 at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] MySQL 4.0.10 Fulltext Search Relevancy Problem
Thread-Index: AcQ/Pub97CCcoYWTScuBbjz/KvDR1wAGFOUw
From: "Hans Zaunere" 
To: "NYPHP Talk" 
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk 
List-Id: NYPHP Talk 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 21 May 2004 17:18:51 -0000


>     SELECT
>     image.id, image.image_name,
>     (MATCH (image_name, image_alt, image_location_city,
>     image_location_state, image_location_country) AGAINST ('test')
>     OR MATCH (first_name, last_name) AGAINST ('test')
>     OR MATCH (keyword_name) AGAINST ('test')
>     OR MATCH (event_name) AGAINST ('test')
>     OR MATCH (placement_name) AGAINST ('test')
>     ) as score,
>     image.image_path, image.image_creation_date
>     FROM image

...

> Using this query I always get a relevancy score of 1 every=20
> time; I do not actually get the floating-point decimal number=20
> that I was seeking (the accurate relevancy); this based on=20

This is because of your MATCH statements.  Because you are doing OR,
it's a logical operator, and thus:

1 OR 1 OR 1 =3D 1

I think you need to revisit your query and possibly break it into
multiple queries.

H


From phillip.powell at adnet-sys.com  Fri May 21 13:37:09 2004
From: phillip.powell at adnet-sys.com (Phillip Powell)
Date: Fri, 21 May 2004 13:37:09 -0400
Subject: [nycphp-talk] MySQL 4.0.10 Fulltext Search Relevancy Problem
In-Reply-To: <41EE526EC2D3C74286415780D3BA9F8702108DE6@ehost011-1.exch011.intermedia.net>
References: <41EE526EC2D3C74286415780D3BA9F8702108DE6@ehost011-1.exch011.intermedia.net>
Message-ID: <40AE3E45.4070600@adnet-sys.com>

Hans Zaunere wrote:

>>    SELECT
>>    image.id, image.image_name,
>>    (MATCH (image_name, image_alt, image_location_city,
>>    image_location_state, image_location_country) AGAINST ('test')
>>    OR MATCH (first_name, last_name) AGAINST ('test')
>>    OR MATCH (keyword_name) AGAINST ('test')
>>    OR MATCH (event_name) AGAINST ('test')
>>    OR MATCH (placement_name) AGAINST ('test')
>>    ) as score,
>>    image.image_path, image.image_creation_date
>>    FROM image
>>    
>>
>
>...
>
>  
>
>>Using this query I always get a relevancy score of 1 every 
>>time; I do not actually get the floating-point decimal number 
>>that I was seeking (the accurate relevancy); this based on 
>>    
>>
>
>This is because of your MATCH statements.  Because you are doing OR,
>it's a logical operator, and thus:
>
>1 OR 1 OR 1 = 1
>
>I think you need to revisit your query and possibly break it into
>multiple queries.
>
>H
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>
That does make sense.. hmm.. will have to revisit that.. next week Beer 
time!

Thanx though!
Phil

-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	



From tommyo at gmail.com  Fri May 21 14:37:58 2004
From: tommyo at gmail.com (Thomas O'Neill)
Date: Fri, 21 May 2004 13:37:58 -0500
Subject: [nycphp-talk] Output Buffering and Blank Page
Message-ID: 

Hey Everyone!

I have a problem that is about half solved and I am looking for some
input from the group.

The site I work for has a large member base (~1000 - 3000 members
online at any given time)

We have output buffering turned on to improve performance.  It seems
to work great but on scripts that have large queries the user will see
a blank white page until the script finishes. Sometimes this can be
annoying when the script takes more then a few seconds to execute.

In order to avoid this I have come up with a scheme that works very
well but I would really appreciate some criticism/tips to improve it.

The Scheme is comprised of three parts the loading script, the process
script and the display script.

Loading Script
-----------------------------
Displays a cute loading icon and forwards GETS/POSTS to an embedded image.
When the page/image finishes loading (javascript onload) the page is
forwarded on to the display script.

Process Script (embedded image in the Loading Script)
-----------------------------
The process Script will do all the work and create the output that
normally is shot out to the screen after waiting for the white/blank
screen to go away.  When the script is finished the output is stored
to a session variable and the buffer cleared.  Finally a one pixal png
will be output so the Loading Script will know its done.

Display Script
-----------------------------
The user will be directed here after the process script is done.  If
the output of the process script is in the session variable it is
displayed and the session variable is unset.  The user sees the
results.

So at this point this little hack is working great in my staging area.
How will this scale to all of our users?  Is it safe to put the html
(about 1k) into the sessions for that many people at the same time? Am
I going at this problem all wrong?

Thanks in advance everyone!

TOM O'NEILL


From nyphp at newslogic.com  Fri May 21 15:48:51 2004
From: nyphp at newslogic.com (Andy Crain)
Date: Fri, 21 May 2004 15:48:51 -0400
Subject: [nycphp-talk] New Functions on old PHP
In-Reply-To: 
Message-ID: <004801c43f6c$a77a3b40$650aa8c0@newslogiyn65wg>


> I have an script that was written after PHP 4.0.5 and wish to figure out
> what functions need to be worked around to get it to work on the 4.0.5
> server.
> 
> Other than checking the functions one by one on the function / PHP version
> table at php.net, is there a tool out there that would do it for me?

Try the PEAR PHP_Compatibility package
(http://pear.php.net/pepr/pepr-proposal-show.php?id=27): "Finds the lowest
version of PHP needed to run a PHP file/PHP files in a folder. Will soon
parse a script and check all includes and find the lowest common version.
Additionally, it finds all extensions needed to run the code. This could
easily be used in PEAR_PackageFileManager, say you set a PHP dependency of
"auto" and it'll detect it. Also could be used to find all extension
dependencys."
Very alpha but probably better than doing it by hand.

Andy




From jkelly at sussex.edu  Fri May 21 16:41:28 2004
From: jkelly at sussex.edu (jessica kelly)
Date: Fri, 21 May 2004 16:41:28 -0400
Subject: [nycphp-talk] New Functions on old PHP
Message-ID: 

Thank's,

Exactly what I was looking for. Much better than looking up things on the Function/Version table.

Jessica

>>> nyphp at newslogic.com 5/21/04 3:48:51 PM >>>

> I have an script that was written after PHP 4.0.5 and wish to figure out
> what functions need to be worked around to get it to work on the 4.0.5
> server.
> 
> Other than checking the functions one by one on the function / PHP version
> table at php.net, is there a tool out there that would do it for me?

Try the PEAR PHP_Compatibility package
(http://pear.php.net/pepr/pepr-proposal-show.php?id=27): "Finds the lowest
version of PHP needed to run a PHP file/PHP files in a folder. Will soon
parse a script and check all includes and find the lowest common version.
Additionally, it finds all extensions needed to run the code. This could
easily be used in PEAR_PackageFileManager, say you set a PHP dependency of
"auto" and it'll detect it. Also could be used to find all extension
dependencys."
Very alpha but probably better than doing it by hand.

Andy


_______________________________________________
talk mailing list
talk at lists.nyphp.org 
http://lists.nyphp.org/mailman/listinfo/talk



From nyphp at newslogic.com  Fri May 21 17:00:10 2004
From: nyphp at newslogic.com (Andy Crain)
Date: Fri, 21 May 2004 17:00:10 -0400
Subject: [nycphp-talk] New Functions on old PHP
In-Reply-To: 
Message-ID: <006001c43f76$9dc63540$650aa8c0@newslogiyn65wg>

> Thank's,
> 
> Exactly what I was looking for. Much better than looking up things on the
> Function/Version table.

No problem. Maybe you could report back on how well it works. I'd be
interested in hearing.
Andy




From list at harveyk.com  Sun May 23 17:42:10 2004
From: list at harveyk.com (harvey)
Date: Sun, 23 May 2004 17:42:10 -0400
Subject: [nycphp-talk] SQL statement question
Message-ID: <04c501c4410e$d11e54b0$0200a8c0@desktop>

Hello,

I'm going to create a MySql table that looks something like the following (I think). It's a history of courses taken by students.

History_ID Student_FID Course_FID
1          34          2
2          17          7
3          21          5
4          02          5
5          34          5
6          17          4
...        ...         ...

I'd like to be able to say which students have met the requirements of certain programs. So, I need a statement that will produce a list of Student_FID's that are matched with a particular set of Course_FID's. For instance, which students took both course 5 and course 2? 

So, I'm trying subqueries to find students who have taken courses 1,2,and 3:

"SELECT *
 FROM
 (SELECT *
  FROM
  (SELECT *
   FROM history
   WHERE course_fid = 3)
   AS id3
  WHERE course_fid = 2)
  AS id2
 WHERE course_fid = 1"

I get an error that my sql syntax is wrong. Maybe it is. Or maybe my host's version of MySQL is too old? Is there a better SQL statement? Any help is appreciated...

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

From robyn at nyu.edu  Sun May 23 17:53:13 2004
From: robyn at nyu.edu (Robyn Overstreet)
Date: Sun, 23 May 2004 17:53:13 -0400
Subject: [nycphp-talk] SQL statement question
In-Reply-To: <04c501c4410e$d11e54b0$0200a8c0@desktop>
Message-ID: <96FA1CD0-AD03-11D8-B070-0003931CACB0@nyu.edu>

Did you try:

SELECT * FROM history WHERE (course_fid=1 AND course_fid=2 AND 
course_fid=3);

You could also use OR instead of AND, depending on the results you want.


On Sunday, May 23, 2004, at 05:42  PM, harvey wrote:

> Hello,
> ?
> I'm going to create a MySql table that looks something like the 
> following (I think). It's a history of courses taken by students.
> ?
> History_ID?Student_FID?Course_FID
> 1????? ??? 34????? ??? 2
> 2????? ??? 17????? ??? 7
> 3????? ??? 21????? ??? 5
> 4????? ??? 02????? ??? 5
> 5????? ??? 34????? ??? 5
> 6????? ??? 17????? ??? 4
> ...????????...?????????...
> ?
> I'd like to be able to say which students have met the requirements of 
> certain programs. So, I need a statement that will produce a list of 
> Student_FID's that are matched with a particular set of Course_FID's. 
> For instance, which students took both course 5 and course 2?
> ?
> So, I'm trying subqueries to find students who have taken courses 
> 1,2,and 3:
> ?
> "SELECT *
> ?FROM
> ?(SELECT *
> ??FROM
> ??(SELECT *
> ???FROM history
> ???WHERE course_fid = 3)
> ???AS id3
> ??WHERE course_fid = 2)
> ??AS id2
> ?WHERE course_fid = 1"
> ?
> I get an error that my sql syntax is wrong. Maybe it is. Or maybe my 
> host's version of MySQL is too old? Is there a better SQL statement? 
> Any help is appreciated...
> ?
> Thanks!
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2114 bytes
Desc: not available
URL: 

From patterson at computer.org  Sun May 23 18:04:43 2004
From: patterson at computer.org (Bill Patterson)
Date: Sun, 23 May 2004 18:04:43 -0400
Subject: [nycphp-talk] SQL statement question
In-Reply-To: <04c501c4410e$d11e54b0$0200a8c0@desktop>
References: <04c501c4410e$d11e54b0$0200a8c0@desktop>
Message-ID: <40B11FFB.2010700@computer.org>

*mysql> select a.Student_FID from TMPhistory a, TMPhistory b
    -> where a.Student_FID = b.Student_FID
    -> and a.Course_FID = 5 and b.Course_FID = 2;
+-------------+
| Student_FID |
+-------------+
|          34 |
+-------------+*

to find out about 3 courses just add another alias for your table

Bill


harvey wrote:

> Hello,
>  
> I'm going to create a MySql table that looks something like the 
> following (I think). It's a history of courses taken by students.
>  
> History_ID Student_FID Course_FID
> 1          34          2
> 2          17          7
> 3          21          5
> 4          02          5
> 5          34          5
> 6          17          4
> ...        ...         ...
>  
> I'd like to be able to say which students have met the requirements of 
> certain programs. So, I need a statement that will produce a list of 
> Student_FID's that are matched with a particular set of Course_FID's. 
> For instance, which students took both course 5 and course 2?
>  
> So, I'm trying subqueries to find students who have taken courses 
> 1,2,and 3:
>  
> "SELECT *
>  FROM
>  (SELECT *
>   FROM
>   (SELECT *
>    FROM history
>    WHERE course_fid = 3)
>    AS id3
>   WHERE course_fid = 2)
>   AS id2
>  WHERE course_fid = 1"
>  
> I get an error that my sql syntax is wrong. Maybe it is. Or maybe my 
> host's version of MySQL is too old? Is there a better SQL statement? 
> Any help is appreciated...
>  
> Thanks!
>
>------------------------------------------------------------------------
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>  
>



>From hans not junk at nyphp.com  Sun May 23 18:59:05 2004
Return-Path: 
Received: from ehost011-1.intermedia.net (ehost011-1.intermedia.net
	[64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 10B55A85EA
	for ; Sun, 23 May 2004 18:59:05 -0400 (EDT)
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] SQL statement question
Date: Sun, 23 May 2004 15:59:01 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F870221406B at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] SQL statement question
Thread-Index: AcRBDovpUA2oBRwbTISP1/4/K1jgUQAAjh9g
From: "Hans Zaunere" 
To: "NYPHP Talk" 
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk 
List-Id: NYPHP Talk 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 23 May 2004 22:59:05 -0000


> Hello,
> =20
> I'm going to create a MySql table that looks something like=20
> the following (I think). It's a history of courses taken by students.
> =20
> History_ID Student_FID Course_FID
> 1          34          2
> 2          17          7
> 3          21          5
> 4          02          5
> 5          34          5
> 6          17          4
> ...        ...         ...
> =20
> I'd like to be able to say which students have met the=20
> requirements of certain programs. So, I need a statement that=20
> will produce a list of Student_FID's that are matched with a=20
> particular set of Course_FID's. For instance, which students=20
> took both course 5 and course 2?=20
> =20
> So, I'm trying subqueries to find students who have taken=20
> courses 1,2,and 3:
> =20
> "SELECT *
>  FROM
>  (SELECT *
>   FROM
>   (SELECT *
>    FROM history
>    WHERE course_fid =3D 3)
>    AS id3
>   WHERE course_fid =3D 2)
>   AS id2
>  WHERE course_fid =3D 1"
> =20
> I get an error that my sql syntax is wrong. Maybe it is. Or=20
> maybe my host's version of MySQL is too old? Is there a=20
> better SQL statement? Any help is appreciated...

Unless you're using MySQL 4.1 or later (which I doubt, since it's not
production level yet) sub-queries are not supported.

To answer your question "which students took both course 5 and course
2?" I'd recommend a query like this (assuming History_FID is unique):

SELECT H1.Student_FID
FROM history H1 LEFT JOIN history H2 ON H2.History_ID=3DH1.History_ID
WHERE H1.Course_FID =3D '5' AND H2.Course_FID =3D '2'

H



>From hans not junk at nyphp.com  Sun May 23 19:00:51 2004
Return-Path: 
Received: from ehost011-1.intermedia.net (ehost011-1.intermedia.net
	[64.78.21.3]) by virtu.nyphp.org (Postfix) with ESMTP id 0CEE8A85EA
	for ; Sun, 23 May 2004 19:00:51 -0400 (EDT)
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] Output Buffering and Blank Page
Date: Sun, 23 May 2004 16:00:47 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F870221406D at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] Output Buffering and Blank Page
Thread-Index: AcQ/YsC9rAc7NbeqQNmvr5wsOvSy/QBtueEg
From: "Hans Zaunere" 
To: "NYPHP Talk" 
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk 
List-Id: NYPHP Talk 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sun, 23 May 2004 23:00:51 -0000


> I have a problem that is about half solved and I am looking=20
> for some input from the group.
>=20
> The site I work for has a large member base (~1000 - 3000=20
> members online at any given time)
>=20
> We have output buffering turned on to improve performance. =20
> It seems to work great but on scripts that have large queries=20
> the user will see a blank white page until the script=20
> finishes. Sometimes this can be annoying when the script=20
> takes more then a few seconds to execute.
>=20
> In order to avoid this I have come up with a scheme that=20
> works very well but I would really appreciate some=20
> criticism/tips to improve it.
>=20
> The Scheme is comprised of three parts the loading script,=20
> the process script and the display script.
>=20
> Loading Script
> -----------------------------
> Displays a cute loading icon and forwards GETS/POSTS to an=20
> embedded image.
> When the page/image finishes loading (javascript onload) the=20
> page is forwarded on to the display script.
>=20
> Process Script (embedded image in the Loading Script)
> -----------------------------
> The process Script will do all the work and create the output=20
> that normally is shot out to the screen after waiting for the=20
> white/blank screen to go away.  When the script is finished=20
> the output is stored to a session variable and the buffer=20
> cleared.  Finally a one pixal png will be output so the=20
> Loading Script will know its done.
>=20
> Display Script
> -----------------------------
> The user will be directed here after the process script is=20
> done.  If the output of the process script is in the session=20
> variable it is displayed and the session variable is unset. =20
> The user sees the results.
>=20
> So at this point this little hack is working great in my staging area.
> How will this scale to all of our users?  Is it safe to put=20
> the html (about 1k) into the sessions for that many people at=20
> the same time? Am I going at this problem all wrong?

I'm by no means an expert is browser and JS tricks, but it sounds like a
clever way of doing it.  Clever enough even for a presentation?  :)  It
seems to be a common issue people need to resolve.

H



From list at harveyk.com  Sun May 23 19:21:10 2004
From: list at harveyk.com (harvey)
Date: Sun, 23 May 2004 19:21:10 -0400
Subject: [nycphp-talk] SQL statement question
References: <04c501c4410e$d11e54b0$0200a8c0@desktop>
	<40B11FFB.2010700@computer.org>
Message-ID: <054601c4411c$a5e14470$0200a8c0@desktop>

Thanks, Bill.

I tried the following, but I get an error that table TMPhistory does not
exist. Do I have to somehow create the temporary tables first?

SELECT a.student_fid from TMPhistory a, TMPhistory b, TMPhistory c
WHERE a.student_fid = b.student_fid = c.student_fid
AND a.course_fid = 1 AND b.course_fid = 2 AND c.course_fid = 3

Also, I tried the following and it works, sort of:

select * from history
inner join history as t1 using (student_fid)
inner join history as t2 using (student_fid)
inner join history as t3 using (student_fid)
where (t1.course_fid = 1)
and (t2.course_fid = 2)
and (t3.course_fid = 3)

I get the correct student_fid, but I get it 3 times, I guess because it
shows up 3 times (once in each of the tables). Is there any way to just get
unique student_fid's?

Thanks for your help.




----- Original Message ----- 
From: "Bill Patterson" 
To: "NYPHP Talk" 
Sent: Sunday, May 23, 2004 6:04 PM
Subject: Re: [nycphp-talk] SQL statement question


> *mysql> select a.Student_FID from TMPhistory a, TMPhistory b
>     -> where a.Student_FID = b.Student_FID
>     -> and a.Course_FID = 5 and b.Course_FID = 2;
> +-------------+
> | Student_FID |
> +-------------+
> |          34 |
> +-------------+*
>
> to find out about 3 courses just add another alias for your table
>
> Bill
>
>
> harvey wrote:
>
> > Hello,
> >
> > I'm going to create a MySql table that looks something like the
> > following (I think). It's a history of courses taken by students.
> >
> > History_ID Student_FID Course_FID
> > 1          34          2
> > 2          17          7
> > 3          21          5
> > 4          02          5
> > 5          34          5
> > 6          17          4
> > ...        ...         ...
> >
> > I'd like to be able to say which students have met the requirements of
> > certain programs. So, I need a statement that will produce a list of
> > Student_FID's that are matched with a particular set of Course_FID's.
> > For instance, which students took both course 5 and course 2?
> >
> > So, I'm trying subqueries to find students who have taken courses
> > 1,2,and 3:
> >
> > "SELECT *
> >  FROM
> >  (SELECT *
> >   FROM
> >   (SELECT *
> >    FROM history
> >    WHERE course_fid = 3)
> >    AS id3
> >   WHERE course_fid = 2)
> >   AS id2
> >  WHERE course_fid = 1"
> >
> > I get an error that my sql syntax is wrong. Maybe it is. Or maybe my
> > host's version of MySQL is too old? Is there a better SQL statement?
> > Any help is appreciated...
> >
> > Thanks!
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >talk mailing list
> >talk at lists.nyphp.org
> >http://lists.nyphp.org/mailman/listinfo/talk
> >
> >
>
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>




From danielc at analysisandsolutions.com  Sun May 23 19:57:45 2004
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Sun, 23 May 2004 19:57:45 -0400
Subject: [nycphp-talk] Output Buffering and Blank Page
In-Reply-To: 
References: 
Message-ID: <20040523235745.GA6591@panix.com>

On Fri, May 21, 2004 at 01:37:58PM -0500, Thomas O'Neill wrote:

> When the page/image finishes loading (javascript onload) the page is
> forwarded on to the display script.

And, of course, you'll have a regular link in the