Re: [nyphp-talk] Passing info entered into HTML FORMS into SESSIONvariables.

2007-11-28 Thread PaulCheung
Hi David, Please re-email me your last email to me as the last one went straight into my junk folder and was deleted without being read Ta! Paul ___ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Greg Rundlett
On Nov 28, 2007 8:53 PM, Daniel Convissor <[EMAIL PROTECTED]> wrote: > Hi Ben: > > On Wed, Nov 28, 2007 at 01:33:42PM -0500, Ben Sgro (ProjectSkyLine) wrote: > > > > Which allows to me handle Exceptions two ways, one for internal logging > > and one for display to the user. I'll read the link you p

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Daniel Convissor
Hi Ben: On Wed, Nov 28, 2007 at 01:33:42PM -0500, Ben Sgro (ProjectSkyLine) wrote: > > Which allows to me handle Exceptions two ways, one for internal logging > and one for display to the user. I'll read the link you posted as well. Or you can do what we do on my job. We use one exception class

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Daniel Convissor
On Wed, Nov 28, 2007 at 12:53:21PM -0500, Kenneth Downs wrote: > > function try_include($filename) { >try { > include($filename); >} >catch Exception(e) { > echo "Problem trying to include file!"; > return false; >} >return true; > } Huh? include(), and most

Re: [nyphp-talk] RESTful PHP Frameworks/Libs

2007-11-28 Thread Ben Sgro (ProjectSkyLine)
All, Let me be more vague. I'm looking for php code for routing, request handling, response generation that I can use to see how others have done REST in php. Something, somewhere in the app I'm working on has to route incomming requests to the appropriate place. I've seen sample code in ruby a

Re: [nyphp-talk] Passing info entered into HTML FORMS into SESSIONvariables.

2007-11-28 Thread David Krings
PaulCheung wrote: I am have a real problem with HTML FORMS and I cannot see where I am going wrong. I make a MySQL call and bring back the required data and echo("$prv"); if ($cps == $nr0) { echo " | Next - 135"; } else { if ($nr0 > 1) { echo(" | href='help_tp_update.php?cps=$cps&l

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread David Krings
csnyder wrote: > Error handling doesn't need to be part of your program logic anymore. I agree, it must be an integral part of the entire design and not just some logic. I suffer every day from crappy error messages, especially from .NET applications. But also browser based apps come along wit

Re: [nyphp-talk] Passing info entered into HTML FORMS into SESSIONvariables.

2007-11-28 Thread Michael Southwell
PaulCheung wrote: I am have a real problem with HTML FORMS and I cannot see where I am going wrong. I make a MySQL call and bring back the required data and populate a HTML page (all working OK) At the bottom of the page I open an HTML FORM the idea being the user may enter what they want and w

Re: [nyphp-talk] RESTful PHP Frameworks/Libs

2007-11-28 Thread csnyder
On Nov 28, 2007 4:54 PM, Rob Marscher <[EMAIL PROTECTED]> wrote: > The webserver handles implementing most of what's required for a RESTful > interface. So... you don't exactly need a framework. Just do the > appropriate thing on GET/POST/PUT/DELETE requests (which you can determine > from php's

Re: [nyphp-talk] Passing info entered into HTML FORMS into SESSIONvariables.

2007-11-28 Thread PaulCheung
I am have a real problem with HTML FORMS and I cannot see where I am going wrong. I make a MySQL call and bring back the required data and populate a HTML page (all working OK) At the bottom of the page I open an HTML FORM the idea being the user may enter what they want and when they hit "SUBMI

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread A.
John Zabroski wrote: > --- csnyder <[EMAIL PROTECTED]> wrote: >> Error handling doesn't need to be part of your >> program logic anymore. >> >> -- >> Chris Snyder >> http://chxo.com/ > > Be careful saying that, especially to a newbie. While > experienced programmers presumably understand > state

Re: [nyphp-talk] RESTful PHP Frameworks/Libs

2007-11-28 Thread Rob Marscher
On Nov 28, 2007, at 4:32 PM, Ben Sgro (ProjectSkyLine) wrote: I'm going to be building a RESTful php application and wanted to know if anyone has done so and what frameworks or library's they have used. This is purely a web service, no UI at all, so I don't think a full blown framework w/ vie

Re: [nyphp-talk] PHP on Nokia

2007-11-28 Thread Tim Sailer
On Wed, Nov 28, 2007 at 04:23:39PM -0500, Ajai Khattri wrote: > On Wed, 28 Nov 2007, Tim Sailer wrote: > > > http://maemo.org/downloads/product/OS2007/apache/ > > Cool! > > A casual search for PHP didn't find anything but maybe its on a different > catalog? When I get home, I'll look up what r

[nyphp-talk] RESTful PHP Frameworks/Libs

2007-11-28 Thread Ben Sgro (ProjectSkyLine)
Hello, I'm going to be building a RESTful php application and wanted to know if anyone has done so and what frameworks or library's they have used. This is purely a web service, no UI at all, so I don't think a full blown framework w/views is necessary. A nice REST library for handling HTTP re

Re: [nyphp-talk] PHP on Nokia

2007-11-28 Thread Ajai Khattri
On Wed, 28 Nov 2007, Tim Sailer wrote: > http://maemo.org/downloads/product/OS2007/apache/ Cool! A casual search for PHP didn't find anything but maybe its on a different catalog? -- Aj. ___ New York PHP Community Talk Mailing List http://lists.n

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Ben Sgro (ProjectSkyLine)
Hello John, Good point. I started realize that this method pushes the responsilibty for error handling up the chain, which is something I sometimes struggle with with if/else. Once I really start writing some code, I'll be able to see the benefits, as I'm sure I'll be happy with these technique

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread John Zabroski
--- csnyder <[EMAIL PROTECTED]> wrote: > > Error handling doesn't need to be part of your > program logic anymore. > > -- > Chris Snyder > http://chxo.com/ Be careful saying that, especially to a newbie. While experienced programmers presumably understand statements other experienced programm

Re: [nyphp-talk] PHP on Nokia

2007-11-28 Thread Tim Sailer
On Wed, Nov 28, 2007 at 11:39:43AM -0500, Ajai Khattri wrote: > On Wed, 28 Nov 2007, csnyder wrote: > > > On Nov 28, 2007 10:51 AM, Ajai Khattri <[EMAIL PROTECTED]> wrote: > > > > > > I was looking for something similar for the Nokia N8xx tablets... > > > > Those run S60, right? > > Naa.. Linux.

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Ben Sgro (ProjectSkyLine)
Hello Brian, Great points. I've been playing with some code examples to get a feel for it. One thing I've stumbled upon that might be nice is the following: Which allows to me handle Exceptions two ways, one for internal logging and one for display to the user. I'll read the link you posted a

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Michael Southwell
csnyder wrote: ... then try/catch is the way out of your nightmare. try { $obj->process1(); $obj->process2(); $obj->process3(); } catch Exception( e ) { exit( "An error occurred: ".$e->message() ); } Error handling doesn't need to be part of your program logic anymore. Note that proce

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Brian D.
Ben, Chris Snyder gave a good example of why you want to use error handling, but one other thing you may want to look at is the built-in PHP Exception class. This article had some code samples: http://www.phpbuilder.com/manual/en/language.exceptions.php The example you gave with try_include() doe

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Ben Sgro (ProjectSkyLine)
Hello Kenneth, I saw an example similiar to this on PHP.net. I don't really see why try/catch is better ... Not trying to start a war here. -= ] function try_include( $filename ) { if( include($filename) != 1 ) { echo "Problem trying to include file!"; return false; }

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Kenneth Downs
Picture this example also: function try_include($filename) { try { include($filename); } catch Exception(e) { echo "Problem trying to include file!"; return false; } return true; } Ben Sgro (ProjectSkyLine) wrote: Hello Chris, Good points again. I've been doing

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Ben Sgro (ProjectSkyLine)
Hello Chris, Good points again. I've been doing some reading to get a better grasp on it. http://www.w3schools.com/php/php_exception.asp Seems to be a good explanation. Thanks. - Ben - Original Message - From: "csnyder" <[EMAIL PROTECTED]> To: "NYPHP Talk" Sent: Wednesday, Novemb

Re: [nyphp-talk] PHP on Nokia

2007-11-28 Thread Ajai Khattri
On Wed, 28 Nov 2007, csnyder wrote: > On Nov 28, 2007 10:51 AM, Ajai Khattri <[EMAIL PROTECTED]> wrote: > > > > I was looking for something similar for the Nokia N8xx tablets... > > Those run S60, right? Naa.. Linux... (funny, you would think LAMP would be readily available as a package to inst

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread csnyder
On Nov 28, 2007 11:25 AM, Ben Sgro (ProjectSkyLine) <[EMAIL PROTECTED]> wrote: > Thanks. I'll read up on it now...and post my thoughts. Trying to explain the benefits of try/catch is like trying to explain the benefits of OO code: you don't need it to get the job done, but it really helps if you w

Re: [nyphp-talk] PHP on Nokia

2007-11-28 Thread csnyder
On Nov 28, 2007 10:51 AM, Ajai Khattri <[EMAIL PROTECTED]> wrote: > > I was looking for something similar for the Nokia N8xx tablets... Those run S60, right? I've been trying to get up to speed on these devices after ignoring mobile for the last few years, because the inclusion of "real" web brow

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Ben Sgro (ProjectSkyLine)
Hello Scott, Thanks. I'll read up on it now...and post my thoughts. Before I read I'll ask this question. What's the difference between this example below and what you just explained? [EMAIL PROTECTED]:~/webdev$ php test.php Gotcha! [EMAIL PROTECTED]:~/webdev$ cat test.php = 0 ) return TRUE; }

Re: [nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Scott Mattocks
Ben Sgro (ProjectSkyLine) wrote: I see ample use of try/catch. Why? Why is it better/different than if/else? You are talking about two completely different things here. If/else is for testing a condition. Try/catch is for handling exceptions. If an exception is thrown within a try/catch block

[nyphp-talk] If/else vs Try/catch

2007-11-28 Thread Ben Sgro (ProjectSkyLine)
Hello, I've inherited some legacy code in CF that I'll be porting to PHP. I see ample use of try/catch. Why? Why is it better/different than if/else? I've never really used it in procedural coding and I'm still somewhat new to OOP overall. - Ben I googled and found a couple discussions. Mayb

Re: [nyphp-talk] PHP on Nokia

2007-11-28 Thread Ajai Khattri
On Wed, 28 Nov 2007, csnyder wrote: > Apparently you can install a Personal Apache-MySQL-PHP stack on your > Nokia smart phone. > http://devphone.com/pamp-stack-on-s60-brings-you-php > > "there will be PHP extension modules that provide access to the core > functionality of the phone" Nice! I w

RE: [nyphp-talk] PHP on Nokia

2007-11-28 Thread Anthony Wlodarski
Speaking of mobile devices I Just picked up an HTC Mogul, quite an interesting phone (besides that it only has a JVM to do development in as I wouldn't touch native C++ for it). Would you know of any supporting PHP environments for Windows Mobile 6 devices? Anthony Wlodarski [EMAIL PROTECTED]

[nyphp-talk] PHP on Nokia

2007-11-28 Thread csnyder
Apparently you can install a Personal Apache-MySQL-PHP stack on your Nokia smart phone. http://devphone.com/pamp-stack-on-s60-brings-you-php "there will be PHP extension modules that provide access to the core functionality of the phone" Mmm, phone glue. -- Chris Snyder http://chxo.com/ ___