[PHP] Re: PHP delete confirmation
On Friday, April 29, 2011, ad...@buskirkgraphics.com wrote: > Personally I would use the javascript page navigation is senseless if they > miss click. > Javascript: Small and simple javascript. > onclick="return confirm('Are you sure you want to delete?')" Personally, I'd use Javascript and also check that the form was submitted after the client-side check. So something like a hidden field ('jstest') in the client-side form that is set to 1 by the onClick event prior to showing the confirmation box. Then in the handling PHP: if ($_POST['jstest'] == 1){ // the client called us via Javascript::confirm, so we know the // use really wants to delete } else { // We weren't called via Javascript::confirm, so we need to // handle the confirmation in PHP } HTH, -- Geoff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RelaxNG parser in PHP?
Hello List! Currently I am using a pear package in one of my projects to parse and query XML DTD files. The package is called XML_DTD 0.5.2 and includes the so called XML_DTD_Parser. One of the purposes of this class is to parse a given DTD file and return that file as a tree like object. With the help of that object, I can find out valid children (and valid attributes) for a given tag (which is what I am using the XML_DTD class for). Now I am looking for a similar class in order to parse RelaxNG (alternatively Schematron) files. I have search Google high and low but was not able to find anything suitable. Any hints are more than welcome! Regards, /frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What's faster using if else or arrays?
On Thu, 2011-04-28 at 19:19 -0400, Robert Cummings wrote: > On 11-04-28 06:37 PM, dholmes1...@gmail.com wrote: > > Thanks switch and case seems to be more faster for the job and a lot cleaner > > --Original Message-- > > From: Andre Polykanine > > To: dholmes1...@gmail.com > > Cc: php-general@lists.php.net > > Subject: Re: [PHP] What's faster using if else or arrays? > > Sent: Apr 28, 2011 6:17 PM > > > > Hello Dholmes1031, > > > > I would write it like this: > > switch($foo) { > > case 5: $dothis; break; > > case 3: $dothat; break; > > default: $donothing; break; > > } > > This sounds like a job for *dun dun dun* GOTO! > > Kidding, of course ;) > > Cheers, > Rob. > -- you should be removed and banned from this list for even just THINKING about using a GOTO! :P (yes, there are still *SOME* (and i use that loosely) benefits to the GOTO command, but in reality, no.) Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] question about Pear Auth and Pear MDB2
Hi, I'm a bit of a newbie at PHP and programming in general. Reading a PHP book by Larry Ullman, I was given instructions to install Pear Auth package and also Pear DB. As the Pear website said that DB has been deprecated in favor of MDB2, I installed this latter package. However, I am getting this error message when I require Auth.php... *Fatal error*: Class 'DB' not found in * /Users/michaelmitchell/pear/share/pear/Auth/Container/DB.php* on line *150* * * I'm not sure if this means I have done something wrong (if so, what?) or if this is somehow indicating that the Auth package is referring to the deprecated Pear DB package? or something else Thank you if you can help. * *
Re: [PHP] What's faster using if else or arrays?
On 11-04-29 08:04 AM, Steve Staples wrote: On Thu, 2011-04-28 at 19:19 -0400, Robert Cummings wrote: On 11-04-28 06:37 PM, dholmes1...@gmail.com wrote: Thanks switch and case seems to be more faster for the job and a lot cleaner --Original Message-- From: Andre Polykanine To: dholmes1...@gmail.com Cc: php-general@lists.php.net Subject: Re: [PHP] What's faster using if else or arrays? Sent: Apr 28, 2011 6:17 PM Hello Dholmes1031, I would write it like this: switch($foo) { case 5: $dothis; break; case 3: $dothat; break; default: $donothing; break; } This sounds like a job for *dun dun dun* GOTO! Kidding, of course ;) Cheers, Rob. -- you should be removed and banned from this list for even just THINKING about using a GOTO! :P (yes, there are still *SOME* (and i use that loosely) benefits to the GOTO command, but in reality, no.) I've written parsers in the past that would have benefited greatly from GOTO. So, in reality (for me anyways), yes. Also, tracking state variables or using break with level parameter to escape from multi level loops isn't any clearer than a goto, so sometimes its succinctness adds clarity to the code making maintenance simpler. But obviously the above was in jest :) Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gd Graphics Library Question (EXIF)
Hi Mitch, you could try with http://www.php.net/manual/en/function.exif-read-data.php I did a test with image jpg and this was the result: FILE . FileName: bruce_lee_black_white.jpg FILE . FileDateTime: 1304086298 FILE . FileSize: 33464 FILE . FileType: 2 FILE . MimeType: image/jpeg FILE . SectionsFound: COMMENT COMPUTED . html: width="353" height="450" COMPUTED . Height: 450 COMPUTED . Width: 353 COMPUTED . IsColor: 1 COMMENT . 0: LEAD Technologies Inc. V1.01 Anyway taking account *EXIF headers tend to be present in JPEG/TIFF images generated by digital cameras, but unfortunately each digital camera maker has a different idea of how to actually tag their images, so you can't always rely on a specific Exif header being present. * Regards. Gerardo. On Thu, Apr 28, 2011 at 11:33 PM, Mitch wrote: > I have written a lightweight, easy to use photo album "system" in > HTML/PHP/MySQL.In addition to the Photo Album side I have written a series > of Admin Utilities to manage it with. One of the administrative utilities > uploads photos from my local drive, resizes them to be more efficient on > disk space, creates thumbnails and populates the database with as much > "default" data as can be deduced. > > After all of this was written, I decided to see if I could pull EXIF data > to supply some of the technical data for the DB. To my surprise, the only > EXIF data in the JPEG files was data in the File, Computed and Comments > sections. > > Why don't the gd utilities retain the original EXIF data? Is there any way > to do so? I use the following gd utilities to resize and create the new JPEG > image files: > > imagecreatefromjpeg > imagesx > imagesy > imagercreatetruecolor > imagecopyresized > imagejpeg > > Thanks in advance, > Mitch > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Gerardo Benitez - www.webseficientes.com.ar Diseño web, programación, Seo
Re: [PHP] gd Graphics Library Question (EXIF)
On Friday, 29 April 2011 at 03:33, Mitch wrote: I have written a lightweight, easy to use photo album "system" in > HTML/PHP/MySQL.In addition to the Photo Album side I have written a > series of Admin Utilities to manage it with. One of the administrative > utilities uploads photos from my local drive, resizes them to be more > efficient on disk space, creates thumbnails and populates the database > with as much "default" data as can be deduced. > > After all of this was written, I decided to see if I could pull EXIF > data to supply some of the technical data for the DB. To my surprise, > the only EXIF data in the JPEG files was data in the File, Computed and > Comments sections. > > Why don't the gd utilities retain the original EXIF data? Is there any > way to do so? I use the following gd utilities to resize and create the > new JPEG image files: > > imagecreatefromjpeg > imagesx > imagesy > imagercreatetruecolor > imagecopyresized > imagejpeg This is a known shortcoming of the GD library. You won't have that issue with ImageMagick: http://php.net/book.imagick -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP delete confirmation
On 4/29/2011 12:06 AM, Geoff Lane wrote: > On Friday, April 29, 2011, ad...@buskirkgraphics.com wrote: > >> Personally I would use the javascript page navigation is senseless if they >> miss click. > >> Javascript: Small and simple javascript. > >> onclick="return confirm('Are you sure you want to delete?')" > > Personally, I'd use Javascript and also check that the form was > submitted after the client-side check. So something like a hidden > field ('jstest') in the client-side form that is set to 1 by the > onClick event prior to showing the confirmation box. Then in the > handling PHP: > > if ($_POST['jstest'] == 1){ > // the client called us via Javascript::confirm, so we know the > // use really wants to delete > } else { > // We weren't called via Javascript::confirm, so we need to > // handle the confirmation in PHP > } > > HTH, > It wasn't a form, it was an HTML tag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP delete confirmation
"Jim Lucas" wrote: >On 4/29/2011 12:06 AM, Geoff Lane wrote: >> On Friday, April 29, 2011, ad...@buskirkgraphics.com wrote: >> >>> Personally I would use the javascript page navigation is senseless >if they >>> miss click. >> >>> Javascript: Small and simple javascript. >> >>> onclick="return confirm('Are you sure you want to delete?')" >> >> Personally, I'd use Javascript and also check that the form was >> submitted after the client-side check. So something like a hidden >> field ('jstest') in the client-side form that is set to 1 by the >> onClick event prior to showing the confirmation box. Then in the >> handling PHP: >> >> if ($_POST['jstest'] == 1){ >> // the client called us via Javascript::confirm, so we know the >> // use really wants to delete >> } else { >> // We weren't called via Javascript::confirm, so we need to >> // handle the confirmation in PHP >> } >> >> HTH, >> > >It wasn't a form, it was an HTML tag > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php I sure hope that's behind something a search engine can't find, otherwise you could find yourself without a lot of things that it deleted as it follows all the links. I think I read a couple of things similar to this on daily wtf... Thanks Ash -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Flattery will get you nowhere
At 7:18 PM -0400 4/28/11, Robert Cummings wrote: Flirting will get you everywhere *bats eyelids* That'll hurt. http://php1.net/clients/molemen/ Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What's faster using if else or arrays?
At 7:19 PM -0400 4/28/11, Robert Cummings wrote: On 11-04-28 06:37 PM, dholmes1...@gmail.com wrote: Thanks switch and case seems to be more faster for the job and a lot cleaner Hello Dholmes1031, I would write it like this: switch($foo) { case 5: $dothis; break; case 3: $dothat; break; default: $donothing; break; } This sounds like a job for *dun dun dun* GOTO! Kidding, of course ;) Cheers, Rob. Rob: Actually, goto could be used for this -- but I would rather use switch. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Wiki formatting class or something similar
Hi everyone, I allow my users to put some Html into their blogs. I filter it using a great tool called HtmLawed and written by Dr. Santosh Patnaik (if you're reading this, many thanks to you!). However, I would like to give them a possibility to mark-up their text in a more convenient way for beginners (such as Wiki or something similar). I searched through http://phpclasses.org/ but didn't find anything. Could you suggest me something? And one more question: maybe some of you already have a handy solution to process smilies? Say, a user writes ":)" and this is replaced by an image in my directory. Thanks in advance! -- With best regards from Ukraine, Andre Skype: Francophile Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Flattery will get you nowhere
On Thu, 28 Apr 2011 19:18:29 -0400, Robert Cummings wrote: > Flirting will get you everywhere *bats eyelids* Dinna know bats even _had_ eyelids -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What's faster using if else or arrays?
On Apr 29, 2011, at 8:32 AM, Robert Cummings wrote: On 11-04-29 08:04 AM, Steve Staples wrote: On Thu, 2011-04-28 at 19:19 -0400, Robert Cummings wrote: On 11-04-28 06:37 PM, dholmes1...@gmail.com wrote: Thanks switch and case seems to be more faster for the job and a lot cleaner --Original Message-- From: Andre Polykanine To: dholmes1...@gmail.com Cc: php-general@lists.php.net Subject: Re: [PHP] What's faster using if else or arrays? Sent: Apr 28, 2011 6:17 PM Hello Dholmes1031, I would write it like this: switch($foo) { case 5: $dothis; break; case 3: $dothat; break; default: $donothing; break; } This sounds like a job for *dun dun dun* GOTO! Kidding, of course ;) Cheers, Rob. -- you should be removed and banned from this list for even just THINKING about using a GOTO! :P (yes, there are still *SOME* (and i use that loosely) benefits to the GOTO command, but in reality, no.) People, people, don't you realize that break IS a goto?? It's just one of limited scope. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] gd Graphics Library Question (EXIF)
I was wondering about that. Since I am not actually hosting my ISP would have to have it loaded (or compiled into their PHP implementation), right? I'll have to do some legwork with my ISP and ImageMagic On 4/29/2011 9:26 AM, Stuart Dallas wrote: On Friday, 29 April 2011 at 03:33, Mitch wrote: I have written a lightweight, easy to use photo album "system" in HTML/PHP/MySQL.In addition to the Photo Album side I have written a series of Admin Utilities to manage it with. One of the administrative utilities uploads photos from my local drive, resizes them to be more efficient on disk space, creates thumbnails and populates the database with as much "default" data as can be deduced. After all of this was written, I decided to see if I could pull EXIF data to supply some of the technical data for the DB. To my surprise, the only EXIF data in the JPEG files was data in the File, Computed and Comments sections. Why don't the gd utilities retain the original EXIF data? Is there any way to do so? I use the following gd utilities to resize and create the new JPEG image files: imagecreatefromjpeg imagesx imagesy imagercreatetruecolor imagecopyresized imagejpeg This is a known shortcoming of the GD library. You won't have that issue with ImageMagick: http://php.net/book.imagick -Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wiki formatting class or something similar
Hi Andre, I did a intranet with TextWiki ( http://pear.php.net/package/Text_Wiki/redirected ) TextWiki is a reliable Class to create Wiki using Php. Regards. Gerardo. On Fri, Apr 29, 2011 at 6:04 PM, Andre Polykanine wrote: > Hi everyone, > I allow my users to put some Html into their blogs. I filter it using > a great tool called HtmLawed and written by Dr. Santosh Patnaik (if > you're reading this, many thanks to you!). > However, I would like to give them a possibility to mark-up their text > in a more convenient way for beginners (such as Wiki or something > similar). > I searched through http://phpclasses.org/ but didn't find anything. > Could you suggest me something? > And one more question: maybe some of you already have a handy solution > to process smilies? Say, a user writes ":)" and this is replaced by an > image in my directory. > Thanks in advance! > > > > -- > With best regards from Ukraine, > Andre > Skype: Francophile > Twitter: http://twitter.com/m_elensule > Facebook: http://facebook.com/menelion > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Gerardo Benitez - www.webseficientes.com.ar Diseño web, programación, Seo