RE: [PHP] I'm new
-Original Message- From: doctortomor...@gmail.com [mailto:doctortomor...@gmail.com] On Behalf Of 9el Sent: Sábado, 04 de Abril de 2009 12:52 p.m. To: Andrés Robinet; php-general@lists.php.net Subject: Re: [PHP] I'm new snip Hi Roly, As previously advised, the best you can do to get started is to install a bundle http://www.apachefriends.org/en/xampp-windows.html If you are a native Spanish speaker (I'm guessing, because of your salu2) check the PHP-MySQL tutorials here http://www.illasaron.com/, you can find single lessons or full courses on the left sidebar here http://www.illasaron.com/html/ and a supporting forum here http://www.illasaron.com/phpBB2/viewforum.php?f=24. You'll need to register for accessing the direct downloads, registering is free (there are also .torrent downloads for the illasaron courses at thepiratebay.org) Regards, Rob /snip Rob, please keep the mail to the list. It came to me individually only! where as I didn't ask for the solution :)\ Well, yes ApacheFriend's XAMPP is one of the best suites ever with lots of things in there. And www.nettuts.com just last month released really nice tutorials for beginners on PHP so thats really recommended if anyone wants to start learning PHP + MySQL Regards Lenin www.twitter.com/nine_L Ooops! I forgot the reply to all trick ;) I pointed out illasaron.com because it's Spanish and there's a Spanish community around. I thought Roly is a Spanish speaker, because salu2 is a short for saludos (=greetings/regards) and he said he's also learning English. Illasaron PHP+MySQL course starts from basic HTML all the way up to session handling, OOP, XML Processing in PHP, building a shopping cart and creating a small CMS. You can download single lessons (there are about 50 I think) or the whole DVD as an ISO. I have nothing against nettuts.com, It's just that I prefer facing one challenge at a time rather than three at once (learning English, installing apache+php+mysql, learning PHP). By the time I started with English PHP courses I could understand written and oral English already, and by the time I learnt to install and set up a WAMP or LAMP suite from scratch, I already knew enough PHP to do more than hello world. It's just that he can learn English by reading eBooks and listening to the BBC (http://www.bbc.co.uk/worldservice/meta/tx/nb/live/www15.asx). He can learn to manually install and set up a full Apache+PHP+MySQL suite later. One challenge at a time avoids frustration, that's just my experience and point of view. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4296 | FAX 954-337-2695 | Email: i...@bestplace.net | MSN Chat: b...@bestplace.net | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Thank you everyone, What a wonderful world
-Original Message- From: Behzad [mailto:behzad.esl...@gmail.com] Sent: Thursday, January 01, 2009 12:43 PM To: Zend Framework General; PHP General Mailing List; IxDA Subject: [PHP] Thank you everyone, What a wonderful world Hi List, I would like to appreciate from you all. I hope that you enjoy your holidays. Children (yes! children) are dying in Gaza, and we're safe! We're happy. Happy Christmas!! Thank you for supporting Israel, and for being so quite. The God is with you! How Palestinians defend(!) themselves with stones, and how Zionist are performing a new holocaust using the American weapons in a prison, named Gaza strip. But you now what... this is really good. At least this could bring democracy, and freedom to middle east. PEACE! HUMAN RIGHTS! YEAH! a lot of bullshit !!. We're all responsible for this event. What a shame for mankind in 21th century. Forget this. This is SPAM and/or PROPAGANDA! CHEERS! -behzad First off, I don't think this is the place to get involved into a political discussion. No matter how much blood is spread, or who's the devil, this is all about politics, and power, and we are not politicians but programmers. This is a Zend Framework mailing list, not a human rights forum or an office of the UN. So, yes, what you are saying is SPAM and PROPAGANDA, since it was unsolicited and has arrived to the wrong place. If you want us to support your cause, it is not the place to ask for it. Nobody is going to add a banner to his website saying Long live Hamas just because you post a message in the Zend Framework list, on the contrary, you'll generate just the opposite feeling. Second, if peace and human rights are bullshit for you, I don't know what you are asking for: WAR and HUMAN RIGHTS VIOLATION? Peace and human rights are not bullshit just because a bullshitter speaks about them. It is precisely that kind of speech (Mr X is a bullshitter, Mr X speaks about peace, ergo, peace is bullshit) which leads to more war, more harm and more bullshitters talking about peace and human rights. About democracy and freedom, that is precisely why you can post a message like this without being tortured and killed (you are not even being sent off this list). Try that in Iran or Cuba (if you can get an internet connection there). You don't need to believe in democracy and freedom, go and praise dictators and build a prison in your country for the ones who don't agree with you, but don't come to me saying that it's democracy's fault or freedom's fault that children are being killed... it is a bit more complex than that, and without democracy and freedom, there would be hundreds of thousands instead of just hundreds dead. Thanks to democracy and freedom I can say that Bush is an idiot son of a bitch, write it on a billboard, make a t-shirt with that slogan and say it to his face if I ever see him nearby. That won't solve world hunger, but at least I can complain and do something without being killed. I can say the same about my president, I'm not an American citizen, I don't live in the US, but my country has a democracy, a very corrupt democracy, and I prefer that to the dictatorship we had twenty five years ago. Some principles, such as freedom, are not tradable. Third, you are confusing Palestinians with Hamas, not every Palestinian is a Hamas member. And NO, we are NOT RESPONSIBLE for this event, Hamas and the Israel government are, NOT US. Hamas decided to end the truce and start launching rockets and the Israel government decided to bombard them, that's how history is written. And it has nothing to do with the average Palestinian or Israeli citizen. I didn't decide to invade Falkland in 1982, the dictatorship we had took that decision, and thousands of young Argentine soldiers died because of a wimp. And yes, I believe Falkland is Argentine, but I will never support a military invasion to the islands just because of that belief. And fourth, I've not seen the same protests worldwide every time a terrorist attack kills hundreds of people... I didn't see the left wing parties of my country complaining on September 11th when 3000 people died, they were actually drinking to celebrate, the same happened when a car bomb destroyed Israeli embassy in my country (detonated by Iranian terrorists)... How come now they are protesting at the same Israeli embassy? What kind of coherence is that? Are they supporting peace or just violence when it occurs from one side alone? Now, THAT IS BULLSHIT and I'm tired of it. Regards, Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and #if
-Original Message- From: Eric Gorr [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2008 3:22 PM To: PHP General Subject: Re: [PHP] PHP and #if On Mar 14, 2008, at 3:15 PM, Eric Gorr wrote: On Mar 14, 2008, at 3:10 PM, Stut wrote: On 14 Mar 2008, at 19:03, Eric Gorr wrote: Unfortunately, such things cannot be used to wrap functions. Erm, yes they can. Try it. ?php if (rand(0,1) == 0) { function arse() { echo arse 1\n; } } else { function arse() { echo arse 2\n; } } arse(); ? Gives: Parse error: syntax error, unexpected T_STRING in /Users/Eric/Sites/ ifWrapping.php on line 3 Oh, sorry, apparently there are some invisible characters in the text you pasted which I had to zap first. Yes, this does work as expected. However, try wrapping the arse function in a class. ?php class TestClass { if ( rand(0,1) == 0 ) { function arse() { echo arse 1\n; } } else { function arse() { echo arse 2\n; } } } $myVar = new TestClass; $myVar-arse(); ? That fails with: Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in / Users/Eric/Sites/ifWrapping.php on line 4 Mmmm... why would you want to use a different class definition on some conditions? Yes, there might be reasons, but it's usually just a matter of realizing that you can use inheritance, containment or some design patterns (say, the Adapter pattern). There are other ways to solve the problem which are not yet available in PHP. Some of them are being discussed nowadays (http://wiki.php.net/rfc/nonbreakabletraits). Now, if you want something weird... I believe this would work: ?php ob_start(); ? class TestClass { ?php if ( rand(0,1) == 0 ) { ? function arse() { echo arse 1\n; } ?php } else { ? function arse() { echo arse 2\n; } ?php } ? } ?php // Fetch class definition in the output buffer; $classDef = ob_get_clean(); // Define class eval($classDef); $myVar = new TestClass; $myVar-arse(); ? I didn't test this, but it should work I think... I remember nuSoap doing something similar for soap proxys (though not using output buffering). There are alternatives that are way better (and smarter about performance) than this, but... you see... everything can be done in PHP. If you look for build-like tools, that is, generate code at deployment-time, you may try phing http://phing.info. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4296 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What's wrong the __autoload()?
-Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 4:17 PM To: php-general@lists.php.net Subject: Re: [PHP] What's wrong the __autoload()? On 3/13/08, Robert Cummings [EMAIL PROTECTED] wrote: So... there we have it everyone... Greg has admitted that Ruby is as smart as a cat. Hahaha.. yeah, you really got me on that one. /me slaps his knee. I like something a little more edgy personally. Something closer to human... something with personality, something that evolves, something not afraid to be itself. PHP fits the bill. PHP is anything but itself. Before it was actually written in C it was first written in Perl. And although it may be written in C and may look like C and Perl right now, it's clearly evolving into something very similar to Java. PHP has a long, long history with identity crisis, ongoing even today. Meanwhile Ruby was written as a full-on OO language from the start. The OO layer didn't get strapped on at version 3 like with PHP. OO was the main idea from the very start with Ruby. As a result Ruby's OO model makes PHP's OO model look like a steaming pile of shit out in the pasture. Hell, Perl's OO even makes PHP's OO look bad syntax-wise. -- Greg Donald http://destiney.com/ Sorry dude, RoR is still an academic toy. And not the most successful one, since I've heard people talking like you back in 2005. Ruby on Rails is not new and has not proved anything yet. It's an arrogant language, so much arrogant that its community pretend it can fix the world. Back in 2005 I was very enthusiastic and thought it could have a future, but after confirming what other poster said the RoR community is insane, I didn't give a f... anymore. I believe it will become some piece of *enterprise-class* piece of dust in the best of scenarios. In the meantime, the web moves towards PHP more and more. And if they need a fat cat... they don't use RoR, just the Tom Cat. Look at it this way, in 2001 M$ released the .Net Framework. It's been 7 YEARS since PHP is STILL the leader and will be so for many more years. And .Net has the glorious Visual Studio IDE, compiled code, built-in caching, and idiot-proof tools, and has the BIGGEST software company behind. Do you think that the work of a man can do much more than that? Specially, a man that has the arrogance of a big Co.? In March 2007 David Heinemeier Hansson filed three Rails related trademark applications to the USPTO. These applications regard the phrase RUBY ON RAILS, the word RAILS and the official Rails logo. As a consequence, in the summer of 2007 Hansson denied to Apress the permission to use the Rails logo on the cover of a new Rails book written by some authoritative community members. The episode gave rise to a polite protest in the Rails community. In response to this criticism, Hansson made the following claims: quote I only grant promotional use [of the Rails logo] for products I'm directly involved with. Such as books that I've been part of the development process for or conferences where I have a say in the execution. I would most definitely seek to enforce all the trademarks of Rails /quote Sorry, even if it was the ONE AND ONLY programming language... I will dismiss it until it becomes a business need, as I don't even trust its creator. PHP is easy to deal with, it's free... and IT GETS THE JOB DONE. You mentioned something about projects done on RoR you can share... why don't you show us your PHP work instead? Maybe you like RoR more because you suck at PHP. Regards, Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Last Friday of every month
-Original Message- From: VamVan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2008 9:13 PM To: php-general@lists.php.net Subject: [PHP] Last Friday of every month Can you tell me how to do this ? suppose I have a date variable = '02/23/2008' i need to know if this is the last friday of february let me know. My view... $strDate = '02/23/2008'; // $intDate = strtotime($strDate); $numDaysInMonth = date('t', $intDate); $dayOfWeek = date('w', $intDate); $dayOfMonth = date('j', $intDate); If ($dayOfWeek == 5 $numDaysInMonth - $dayOfMonth 7) { echo Friday Party!; } else { echo Sorry dude, you missed it; } Btw, read the manual (and don't think to be so lucky to not found any bugs in my code). Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4296 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Comparing files
-Original Message- From: Edward Kay [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 7:13 AM To: mathieu leddet; php-general@lists.php.net Subject: RE: [PHP] Comparing files -Original Message- From: mathieu leddet [mailto:[EMAIL PROTECTED] Sent: 12 March 2008 11:04 To: php-general@lists.php.net Subject: [PHP] Comparing files Hi all, I have a simple question : how can I ensure that 2 files are identical ? How about this ? 8-- function files_identical($path1, $path2) { return (file_get_contents($path1) == file_get_contents($path2)); } 8-- Note that I would like to compare any type of files (text and binary). Thanks for any help, Depending upon the size of the files, I would expect it would be quicker to compare a hash of each file. Edward I don't understand how comparing hashes can be faster than comparing contents, except for big files for which you will likely hit the memory limit first and for files who only differ from each other at the very end of them, so the comparison will only be halted then. If the file sizes vary too much, however, a mixed strategy would be the winner; and certainly, you will want to store path names and calculated hashes in a database of some kind to save yourself from hogging the server each time (yeah, CPU and RAM are cheap, but not unlimited resources). Comparing hashes means that a hash must be calculated for files A and B and the related overhead will increase according to the file size (right or wrong?). Comparing the file contents will have an associated overhead for buffering and moving the file contents into memory, and it's also a linear operation (strings are compared byte to byte till there's a difference). So... why not doing the following? 1 - Compare file sizes (this is just a property stored in the file system structures, right?). If sizes are different, the files are different. Otherwise move to step 2. 2 - If the file sizes are smaller than certain size (up to you to find the optimal file size), just compare contents through, say, file_get_contents. Otherwise move to step 3. 3 - Grab some random bytes at the beginning, at the middle and at the end of both files and compare them. If they are different, the files are different. Otherwise move to step 4. 4 - If you reach this point, you are doomed. You have 2 big files that you must compare and they are apparently equal so far. Comparing contents will be over killing if at all possible, so you will want to generate hashes and compare them. Run md5_file on both files (it would be great if you have, say, file A's hash already calculated and stored in a DB or data file) and compare results. It is always up to what kind of files you are dealing with, if the files are often different only at the end of the stream, you may want to skip step 2. But this is what I would generally do. By the way, md5 is a great hashing function, but it is not bullet-proof, collisions may happen (though it's much better than crc32, for example). So, you may also think of how critical is to you to have some false positives (some files that are considered equal by md5_file and they are not) and probably use some diff-like solution instead of md5_file. Anyway, having compared sizes and random bytes (steps 1 through 3), it's very likely that md5_file will catch it if two files are different in just a few bytes. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A Quick Reminder....
I don't know... but... -Original Message- From: Wolf [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 11:30 AM To: Jason Pruim Cc: TG; Daniel Brown; PHP General List Subject: Re: [PHP] A Quick Reminder Jason Pruim [EMAIL PROTECTED] wrote: On Mar 12, 2008, at 11:06 AM, Daniel Brown wrote: On Wed, Mar 12, 2008 at 11:01 AM, TG [EMAIL PROTECTED] wrote: How about something OT that we can argue about... driving on the left side of the road versus the right side. How does your country compare? How about when someone middle-posts like this... such as some kind of quoting attempt... Here in Pennsyltucky, a lot of people drive on the left, despite the fact that the whole US is supposed to drive on the right. It usually doesn't turn out very good. .:shakes head, solemnly:. Not very good at all. Up here in the great big hand (Michigan for those who don't know) during the winter we have so much snow on the ground that you just kind of drive where ever looks like road... Even if it means you have people passing on your right going the opposite way. Or even worse... tries to quote several of the previous posters in several places? When I lived in South Dakota, we did the same thing... Here in the state of North Carolina (otherwise known as confusion central during ANY type of weather) they drive anywhere between the 2 white lines, generally as slow as humanly possible with their blinkers on and tieing up all lanes... Even during a 85 degree, 0% overcast, 0% humidity day... *grumble* So in the end everything is screwed up... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ... and he/she still ends with a Regards, Mr X ..as if he/she did no wrong? That's the bad thing :D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What's wrong the __autoload()?
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 1:51 PM To: Zoltán Németh Cc: Greg Donald; php-general@lists.php.net Subject: Re: [PHP] What's wrong the __autoload()? On Wed, 2008-03-12 at 18:21 +0100, Zoltán Németh wrote: 2008. 03. 12, szerda keltezéssel 12.12-kor Greg Donald ezt írta: On 3/12/08, Zoltán Németh [EMAIL PROTECTED] wrote: but I strongly think that Ruby as a language just plain sucks ;) And exactly how many projects do you have under your belt to allow you to develop this opinion? What's the url to any one of them? Unlike you I actually have thousands of lines of Ruby code under my belt that allows me to properly develop an opinion of Ruby and Rails and how they both compare to every other programming language and framework I know and have developed in. Need a URL? ok, I admit I don't have experience with Ruby but I have experience with php. and I don't have experience with Ruby because I read some manuals and example codes and whatnot and I just could not get to like it at all. it's just so strange and different from anything I know (php, c, java) - and I could not find out any good reasons for most of the differences... e.g. how come function definitions are between 'def' and 'end'? Because they didn't follow convention... *HAHAHA* oh my, I think I just pee'd myself. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP I think __autoload would make much more sense if it worked like an event registration feature. Such as: function myAutoloadCallback($className) { if ($className == 'ShakeItBaby') { require_once 'ShakeItBaby.class.php'; return true; } return false; } . __autoloadRegisterCallback('myAutoloadCallback'); . $shaker = new ShakeItBaby(); This way, multiple frameworks and project requirements for autoload wouldn't clash. If one of the autoload callbacks returns true that would be it. Otherwise the next autoload callback would be called, and so on. The problem with the current implementation is that if you get some piece of code that uses __autoload and you are using __autoload too, you'll have to either patch that piece of code (if the piece of code is a framework, things will get much more complicated when updating to the next version) or patch your own code, or just make a promise not to use __autoload (my current choice... just in case) or not to use pieces of code that use __autoload. Bottom line, I hate it. Something similar applies to the set_error_handling function, anyone can overwrite your error handling and you can overwrite the error handling of anyone. I hate it also, so I rather check the return value of functions, and/or use exceptions for custom error handling. I don't see why autoload and error handling can't be implemented in a stack-like way, returning false from the callback moves to the next error handler / autoloader, returning true ends the handler search process... though this is more of a question to be made to the interlals list (b... can't face their karma yet). Anyway... the more PHP approaches OOP and gets OOP features, the more it can be done through design patterns such as the Registry/Singleton/etc... and the more Exceptions are used for PECL extensions, and this seems the trend for the future of PHP. Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4296 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What's wrong the __autoload()?
-Original Message- From: Nathan Nobbe [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 3:08 PM To: Andrés Robinet Cc: Robert Cummings; Zoltán Németh; Greg Donald; php-general@lists.php.net Subject: Re: [PHP] What's wrong the __autoload()? On Wed, Mar 12, 2008 at 2:53 PM, Andrés Robinet [EMAIL PROTECTED] wrote: I think __autoload would make much more sense if it worked like an event registration feature. Such as: function myAutoloadCallback($className) { if ($className == 'ShakeItBaby') { require_once 'ShakeItBaby.class.php'; return true; } return false; } . __autoloadRegisterCallback('myAutoloadCallback'); . $shaker = new ShakeItBaby(); This way, multiple frameworks and project requirements for autoload wouldn't clash. If one of the autoload callbacks returns true that would be it. Otherwise the next autoload callback would be called, and so on. The problem with the current implementation is that if you get some piece of code that uses __autoload and you are using __autoload too, you'll have to either patch that piece of code (if the piece of code is a framework, things will get much more complicated when updating to the next version) or patch your own code, or just make a promise not to use __autoload (my current choice... just in case) or not to use pieces of code that use __autoload. Bottom line, I hate it. as eric pointed out earlier, thats what spl_autoload_register is for; http://us.php.net/manual/en/function.spl-autoload-register.php -nathan I know, I was talking about the old/regular __autoload feature. You need PHP 5 for spl_autoload_register... but having all PHP 5's nice OOP features, you probably want to code a class/file/function/resource loader class (like ZF does) which can do much more. For PHP 4, you are stuck. But anyway, PHP 4 is dying... or seems to be. And don't speak about SPL, I had the worst of disappointments with ArrayObject... since then I got divorced with it (probably will marry it again in the future, my ancestors are French, you know French people are passionate... and they like cooking too). Now, what about set_error_handler? Maybe it's something to discuss in it's own thread, I don't know. Anyway, anyway, anyway must get back to regular work :( See you later, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4296 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What's wrong the __autoload()?
-Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 4:00 PM To: php-general@lists.php.net Subject: Re: [PHP] What's wrong the __autoload()? On 3/12/08, Robert Cummings [EMAIL PROTECTED] wrote: You make it sound like this stuff is new or something. Obviously to some it is. Just in this thread we had a person claim to only know PHP, C, and Java, none of which have any functional language capabilities built in. Lisp and other functional languages have had it for decades. Even JavaScript has it. I'm sorry, I lost context, what missing PHP language feature are you referring to as it? Your analogy is also way off... ask any person without legs if they think about walking. Here, let me dumb-it-down a bit: PHP doesn't have much in the way of meta-programming capabilities. Therefore one would not find it a natural thought to do much meta-programming in PHP, unless one already knew of a language where such support exists. A different example using the same logic: My Mustang doesn't have 4-wheel drive so I don't often think much about taking it through the creeks and woods by my house like my old man and I do in his Bronco that does have 4-wheel drive. A person who has never climbed a really steep hill or ran through a waist-high creek in a 4-wheel drive auto might think such a thing impossible if they were unaware of 4-wheel drive. -- Greg Donald http://destiney.com/ PHP has REAL-programming capabilities, that's why some *cool* functional but still pragmatic features like traits are being discussed on the internals list. PHP's success has its roots in raw pragmatism, easy to learn, easy to deal with. Still fast and OO capable. When RoR starts becoming a REAL PHP competitor, I'll think of learning it and pushing it into my company. Right now, I can only say that PHP is getting better and better. You may miss a lot of features you find in other languages, but PHP features get the job done. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4296 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Frameworks
-Original Message- From: Aschwin Wesselius [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 4:14 PM To: php-general@lists.php.net Subject: [PHP] Frameworks Hi all, Maybe this has past the list a couple of times (just like the 'storing images in a DB' question). What I'm after is a framework that is simple, solid, compact and flexible enough to extend by myself. I'm not an OOP person. But I do use classes when I think they fit a purpose. But most of all I want a framework that has the wheels I don't want to reinvent myself but do make sense to have. Like: - Informative error-handling - DB layer, not too abstract please - Form handling - etc. What is a good framework to start with? What framework doesn't make it too complex that it says it gives you RAD but actually let's you sink in code? I don't have to develop enterprise stuff. I want to manage information for myself and maybe build a blog or whatever to play with. What let's build things quick so you can focus on things to test instead in building the surrounding elements? Again, maybe I've to dive into archives etc. But that doesn't give me answers I need I guess. Thanks in advance. Aschwin Wesselius I want a framework I can plug a microphone in, and talk to it, and it does the job for me (really, I need it). But I guess we are far away from that. If you need REAL RAD (a la Delphi), use VCL for PHP... you'll still have to write the event handlers (you can't save yourself from coding) and you will have to stick with Codegear (you are of those who pay for software, right?). If you are looking for a flexible PHP 5 framework, where each component is more or less independent of the others, try the Zend Framework. If you want a lot of features bundled into a big and fat box, and you need PHP 4 support, use CakePHP. Even the way you name database tables will be affected, but if you eat a piece of the cake you are likely to want it all anyway. If you want a flexible and easy to use PHP 4 and PHP 5 framework and you are willing to wait more than six months for each minor release, you can use CodeIgniter. If you are rich, you can pay us (the PHP-list members) to build one for you :D. It will be a complete disaster because we'll never agree on the features, but you'll entertain yourself with our discussions for months. If your IQ is greater than 150 you can try writing your own. Otherwise, ask Robert Cummings or Manuel Lemos. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4296 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Frameworks
-Original Message- From: Aschwin Wesselius [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 5:04 PM To: Andrés Robinet Cc: php-general@lists.php.net Subject: Re: [PHP] Frameworks Andrés Robinet wrote: I want a framework I can plug a microphone in, and talk to it, and it does the job for me (really, I need it). But I guess we are far away from that. You need it? And what happens if you won't get it in a life time? If you need REAL RAD (a la Delphi), use VCL for PHP... you'll still have to write the event handlers (you can't save yourself from coding) and you will have to stick with Codegear (you are of those who pay for software, right?). REAL RAD? Is that an acronym or is that emphasis? But no thanks. If I've paid around 1000 dollars on software, that would be a bit much. And that must have been a decade ago. If you are looking for a flexible PHP 5 framework, where each component is more or less independent of the others, try the Zend Framework. That's what is on my list of candidates, yes. If you want a lot of features bundled into a big and fat box, and you need PHP 4 support, use CakePHP. Even the way you name database tables will be affected, but if you eat a piece of the cake you are likely to want it all anyway. Wait. PHP 4? I admit that I don't use all the OOP of PHP 5, but really I don't let myself be forced to use deprecated software if it is my income. No, I haven't touched PHP 4 like 3,5 years now. If you want a flexible and easy to use PHP 4 and PHP 5 framework and you are willing to wait more than six months for each minor release, you can use CodeIgniter. Ok, that one is of my list of candidates then. If you are rich, you can pay us (the PHP-list members) to build one for you :D. It will be a complete disaster because we'll never agree on the features, but you'll entertain yourself with our discussions for months. I think I keep that in mind when I've become rich and lonely and need some entertainment. If your IQ is greater than 150 you can try writing your own. Is IQ really relevant to being capable of writing your own framework? Ok, an IQ of 70 won't get you advanced software out of your hands. I've an IQ between 160 and 170 (lost the score along the path somewhere). But I couldn't be bothered to write my own framework just to invent some wheels to have a nice ride. It could be a challenge and might even be rewarding afterwards, but in the mean while it won't get me anywhere. So much for RAD and then writing your own framework. Must be kidding ;-) OK, thanks for your input. Some points are really helpful! Aschwin Wesselius I'm not kidding about the *REAL RAD* thing. RAD is Rapid Application Development, and I don't think anything can be faster than dragging a button component on a *form-like* window, then double clicking on it, writing *echo Hello World!* and hit F9. There you are, you got a *Hello world* in some seconds, no need for special set up, or writing controller/model/view code whatsoever. However, I wouldn't use Delphi for PHP because it's a proprietary thing, it's a fat dog and you must pay some REAL bucks for it. And... as soon as you get more serious with what you want to do, you need to get very close with the code behind the scenes... which means you have to put much more time and effort than you would need for a *standard* MVC framework. Sorry, not something I'm willing to do for a web application. I prefer coding controllers, models and views. That's also why I'm reactive to sniff into Prado or even QCodo (which I think disserves some attention to me, because of the underlying *build system*). Compare that to a ZF component... once you learn it, you can use it wherever you want (generally), even if you are not using ZF for the MVC part (take Zend_Http_Client, Zend_Pdf as examples). Now, take CodeIgniter... I liked it because it had many *out-of-the-box* features and components. Also, some clients still had PHP 4 and I couldn't do anything about it. Dealing with it is fairly easy (don't expect cutting-edge magic out of its components though). I fell in love with rapyd http://www.rapyd.com/ which is based on CodeIgniter and simplifies most backend tasks a bunch. But now, rapyd is discontinued (the CI version at least) and we have kohanaPHP as an alternative (http://kohanaphp.com/). To make it worse, CodeIgniter took several (I think more than 6) months to upgrade from 1.5.4 to 1.6. Why? Because they rely on integrating it with their commercial *Expression Engine* product (and they even stated that in their forums). And the *framework-nightmare* started all over again for me. Wanna know what I'm planning to do? Embrace the Zend Framework, it's solid, it's powerful, it's got a company behind and it's still free. And now that PHP 4 has been discontinued, I have the perfect *excuse* to say NO to whatever project has PHP 4 for hosting... They upgrade their PHP
RE: [PHP] What's wrong the __autoload()?
-Original Message- From: Dave Goodchild [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 5:37 PM To: Robert Cummings Cc: Aschwin Wesselius; Greg Donald; php-general@lists.php.net Subject: Re: [PHP] What's wrong the __autoload()? Will you two pricks cut it out. How f* tedious. Will you be so kind not to use taboo words to hit other people on this list? Thanks, Rob(inet) PS: Middle-posting is cool! On Wed, Mar 12, 2008 at 9:34 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2008-03-12 at 22:26 +0100, Aschwin Wesselius wrote: Robert Cummings wrote: On Wed, 2008-03-12 at 16:11 -0500, Greg Donald wrote: On 3/12/08, Robert Cummings [EMAIL PROTECTED] wrote: -1 for not recognizing a rhetorical question. +2 for setting his tongue firmly in cheek and providing you with an answer to your rhetorical question. -1 for thinking rhetorical question responses mean jack. -1 for thinking +2 exists. *Yawn* -5 for not keeping this kind of childish behavior of the list (both of you) You're new around here right? Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SMTP
-Original Message- From: Alain Roger [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2008 3:16 AM To: Ray Hauge Cc: PHP General List Subject: Re: [PHP] SMTP Hi Ray, in my php.ini i have : SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] but my website (testing machine) is on localhost (which has also the IP 195.126.5.1) i think the problem is not in php.ini but more on SMTP server side (in settings, maybe password for authentication). A. On Sun, Mar 9, 2008 at 10:16 PM, Ray Hauge [EMAIL PROTECTED] wrote: Alain Roger wrote: Hi, i know that this is not necessary the best forum for that, but i need to get a real feedback and i guess you already faced the same issue as mine. basically, i develop php web application on windows XP platform. So i have apache 2.24 installed and PHP 5.2.4. now i would like to test if my application send emails, so i've checked my php.ini file and it seems ok. i tried to use IIS from windows to define a default SMTP server, but as my emails are not sent, i guess something is wrong with IIS. so does it exist a free SMTP server (similar that linux daemon) but running on windows XP ? if yes, where can i find it and what steps should i perform to be sure my emails are sent ? i do not want to transfer all my web application each time i want to test email sending... i would like to test it locally. thanks for your feedback. I could be wrong, but I thought that you had to specify the SMTP server in the php.ini file. http://us2.php.net/manual/en/ref.mail.php#ini.smtp now i would like to test if my application send emails, so i've checked my php.ini file and it seems ok. Maybe that means you already did that. The second issue might be that your SMTP server is MS Exchange, and it requires authentication. If that is the case, then search for php SMTP authentication: http://www.google.com/search?q=php+smtp+authenticationie=utf-8oe=utf- 8aq=trls=org.mozilla:en-US:officialclient=firefox-a -- Ray Hauge www.primateapplications.com -- Alain Windows XP SP2 PostgreSQL 8.2.4 / MS SQL server 2005 Apache 2.2.4 PHP 5.2.4 C# 2005-2008 I'm curious what's the error you get when you use the mail function? Also, if you have SMTP running on port 25 you should be able to telnet localhost 25 and run some SMTP commands (EHLO, etc). Beware as well that some ISPs block port 25 so you may need to use their SMPT server instead of yours, if you can telnet your SMTP server but not send emails, then you either: 1 - Need to authenticate yourself against your SMTP server, or 2 - You have port 25 blocked, and need to use your ISP's server, or an external SMTP server that you can talk to on a port other than 25. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SMTP
-Original Message- From: Ray Hauge [mailto:[EMAIL PROTECTED] Sent: Sunday, March 09, 2008 5:17 PM To: Alain Roger Cc: PHP General List Subject: Re: [PHP] SMTP Alain Roger wrote: Hi, i know that this is not necessary the best forum for that, but i need to get a real feedback and i guess you already faced the same issue as mine. basically, i develop php web application on windows XP platform. So i have apache 2.24 installed and PHP 5.2.4. now i would like to test if my application send emails, so i've checked my php.ini file and it seems ok. i tried to use IIS from windows to define a default SMTP server, but as my emails are not sent, i guess something is wrong with IIS. so does it exist a free SMTP server (similar that linux daemon) but running on windows XP ? if yes, where can i find it and what steps should i perform to be sure my emails are sent ? i do not want to transfer all my web application each time i want to test email sending... i would like to test it locally. thanks for your feedback. I could be wrong, but I thought that you had to specify the SMTP server in the php.ini file. http://us2.php.net/manual/en/ref.mail.php#ini.smtp now i would like to test if my application send emails, so i've checked my php.ini file and it seems ok. Maybe that means you already did that. The second issue might be that your SMTP server is MS Exchange, and it requires authentication. If that is the case, then search for php SMTP authentication: http://www.google.com/search?q=php+smtp+authenticationie=utf-8oe=utf- 8aq=trls=org.mozilla:en-US:officialclient=firefox-a -- Ray Hauge www.primateapplications.com Hi Alain, I think you have two options: 1 - Install a MTA in your windows box, such as Mercury Mail (if you install XAMPP, you get Apache, PHP, MySQL, Filezilla FTP Server and Mercury Mail - use google to know what XAMPP is). To use the mail function on windows, you will NEED a MTA (correct me if I'm wrong, but sendmail is not available in PHP for Windows, the mail function will try to reach an MTA on port 25 or the port you have set up in your php.ini). 2 - Use SMTP Authentication to send out emails on behalf of an existing authenticated email box (or a relay server if you find one). If you choose the second option (SMTP authentication) you will likely also use PHPMailer (or PEAR_Mail, or any of the featured classes at http://www.phpclasses.org that support SMTP authentication) unless you are willing to write your own class for SMTP stuff through sockets. So let's say you have an email box with the following information: User: [EMAIL PROTECTED] Password: mypassword SMTP Server: smtp.mydomain.com Your PHPMailer code will look like: $mail = new PHPMailer(); $mail-Mailer = 'smtp'; $mail-SMTPAuth = true; $mail-Username = '[EMAIL PROTECTED]'; $mail-Password = 'mypassword'; $mail-Host = 'smtp.mydomain.com'; $mail-From = '[EMAIL PROTECTED]'; $mail-FromName = 'My beautiful website'; $mail-Subject = 'You know what this is'; $mail-Body = 'Your email message'; $mail-AddAddress('[EMAIL PROTECTED]', 'Mr X-Man'); $mail-AddReplyTo('[EMAIL PROTECTED]', 'My Beautiful Website'); $mail-Send(); Hope this helps. This issue drove me crazy on my first month with PHP... what is worse, I asked in the office I worked for at that time. They said it was not possible (great I don't work there anymore). As The Rock said... NEVER SAY NO :). Cheers, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CVS Scripts
-Original Message- From: Wolf [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 11:02 AM To: Adrian Walls Cc: php-general@lists.php.net; 'Eric Butera' Subject: RE: [PHP] CVS Scripts I am using Zend Studio Server and I haven't upgraded to Zend Studio for Eclipse as yet. It also has some CVS capability not its not what I am after. Google was my first stop but it didn't turn up anything which appeared to be in a stable enough state. Hence my email to the list to see if anyone else had come across such a solution. My application is built from several modules contained with cvs. Some of these modules are used across projects. I wanted to create my own web-based script to check these out of cvs and to build and configure the application on the fly. I had a look at cruisecontrol but its not really what I am looking for either. !-- SNIP -- You're probably going to have to code that sucker on your own and slide it in as a cron job on your build server to get the latest/greatest whenever needed. I haven't come across anything like it before, but I definitely like the concept. Wolf Just a note about Confidentiality footers. Mine is as follows: Confidentiality: All information in this email message, including images, attachments, contains confidential and proprietary information of BESTPLACE CORPORATION and should only be used or serves for the intended purpose and should not be copied, used or disclosed to anyone other than the sole recipient of this e-mail message. It makes a lot of sense if you, for example, signed an NDA with a customer/partner. However, on a public list like this, it would be a nonsense to include it, as every post here is broadcasted to everyone else and will be published on one zillon sites that track this list. So, when I first rolled in here, I told my company's president that I would be removing the confidentiality warning or I would be using my personal gmail address if that was not allowed. She was pretty reasonable about it. Still, I kept the other part of the signature (which you can see at the bottom) because it contains information that can be of some value for anybody reading my posts. It says who I am, who I work with, where we are and the many to contact us. It's not about bandwidth, it's just about removing noise. Many times I even remove the whole footer so the messages are more readable. If it was only my decision, I wouldn't have a footer at all. Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Anyone jump from Studio 5.5.x - Zend Eclipse?
-Original Message- From: Steve Finkelstein [mailto:[EMAIL PROTECTED] Sent: Sunday, March 02, 2008 12:48 AM To: php-general Subject: [PHP] Anyone jump from Studio 5.5.x - Zend Eclipse? Hi all, I've tried googling around to find some blogs with decent information on whether Zend Eclipse is mature enough to make the jump over from 5.5.x just yet. Admittedly, I've dropped Zend Studio as of late and been writing all of my code in TextMate -- but at the end of the day when a project is complex enough, Zend Studio is much more powerful than TextMate with all of its features and remote debugging capabilities. Anyhow, I'm curious if it's worth it to check out Zend Eclipse yet. We're a team of about 5-6 developers and I've been getting asked by a few colleagues if I've tried it out yet since I'm usually the one to try out the newer technologies. I'd love to hear some feedback. Thanks! /sf I'm also interested on this. I've tested Zend Eclipse just a bit and it looks promising, except for what we all know about Eclipse (and Zend) it eats all your RAM like a critter. I use Dreamweaver (yeah, don't laugh!) for the purely HTML related stuff (however, almost never the design view), Topstyle for CSS and PHPDesigner for PHP coding (if you usually use an MVC-like framework, you may know what I mean). However, it's almost always only me involved in the process (maybe one more dev and rarely three of us). Eclipse sounds like a panacea because in theory you can even add code completion for JavaScript and get the best out of JS coding when you use, say Prototype or ExtJS. But, every time I tried Eclipse (whatever flavor you pick), I had a hard time trying to get what I want out of it. I prefer simplicity and I'm bound by a kind of Unix philosophy (get several programs, each one doing exactly what you want and concatenate the outputs of each). But that's me and that's me right NOW. If I had to work with more than two people, I'd surely take the Eclipse learning curve once and forever and I'd upgrade my hardware to tons of RAM if necessary. In a team you need integration (that's what IDEs are good for), and I don't know of another IDE that can provide you as many features for as many languages. If I was in your shoes, I'd give Zend Eclipse a respectful try. Moreover, if you are Mr-T in your office (T for technology), they will expect you to do so. And... there's no textmate for Windows (is there any?) if you ever consider that OS as a development platform, nor there is anything compared to Eclipse (at least I didn't find something alike). And... Zend Studio is the past, Zend Eclipse is the present and future (if you like Zend Products): We expect that for many customers an Eclipse based product will be preferable. With all the functionality and extensibility of Eclipse, it simply provides richer functionality than Zend could create on our own. However, by continuing to support and maintain Zend Studio V5.5 we will let customers decide when to migrate to the next generation product. Migration tools are provided to streamline the adoption process. - http://www.zend.com/products/studio/studio55 Anyway, I don't have such an experience in team leadership for more than two/three people (including myself in the group), so I can be wrong. I'd LOVE to hear a real voice, speaking about real projects and real teams, where you need a common environment to avoid development chaos. I would buy a book on the subject if you can recommend one (but one about the real thing and not too academically oriented). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP on Windows
-Original Message- From: Erik SJMN [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 9:41 PM To: php-general@lists.php.net Subject: [PHP] PHP on Windows I'm completely new to php and I'm trying to setup an online trouble ticket system. After the user logs in and submits the ticket, they're supposed to receive an email confirmation with the ticket number. I have my Exchange server setup on another server in the same domain that I'm trying to use to send these emails - this server requires SMTP authentication. So I've installed the PEAR Mail package, as it was my understanding that this would allow me to do the authentication for the SMTP server - I installed it in the C:\PHP5\PEAR directory. Do I need this mail package for the authentication? In any case, where do I setup the authentication variables to send this email? I tried adding the authentication vars to the smtp.phpfile in the C:\PHP5\PEAR\Mail directory, but still not authenticating. I'm completely lost, any help is greatly appreciated. ; PHP 5.2.5 installed on Windows Server 2003 with IIS 6 ; Mail-1.1.14 mail pkg with Net_SMTP-1.2.11 pkg --Erik Did you try this http://email.about.com/od/emailprogrammingtips/qt/et073006.htm ? Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading incoming xml
You can get what you post either with: $postText = trim(file_get_contents('php://input'); Or with: $postText = $GLOBALS[HTTP_RAW_POST_DATA]; About HTTP_RAW_POST_DATA http://us2.php.net/manual/en/reserved.variables.php Read the notes here http://us2.php.net/variables.predefined It should be noted that $HTTP_RAW_POST_DATA only exists if the encoding type of the data is -not- the default of application/x-www.form-urlencoded, and so, to accessing raw post data from an HTTP form requires setting enctype= in your HTML. So, if $RAW_POST_DATA doesn't exist, it is because you should be able to use $_POST (unless you set PHP to always populate raw post data in php.ini). The preferred method is, however, to read 'php://input' Then after you get the XML body, you must use one of the XML extensions available in PHP to parse the XML data (search for it as it's not part of this help pack ;) ). Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, March 01, 2008 9:43 PM To: Nathan Nobbe Cc: php Subject: Re: [PHP] reading incoming xml The incoming message to the server is: POST /vendorXML.html HTTP/1.0 MIME-Version: 1.0 Content-type: text/html Content-length: 114 Content-transfer-encoding: text Request-number: 1 Document-type: Request Interface-Version: Test 1.4 Connection: close ?xml version=1.0 encoding=UTF-8?DatavendorCompanyID/Data Larry On Sat, 2008-03-01 at 18:08 -0500, Nathan Nobbe wrote: hmm, it looks to me like you want to post a bunch of raw data to the server. im not sure exactly how to do that w/ the php curl functions... everything ive seen uses CURLOPT_POSTFIELDS to supply an associative array of data to be posted. in this case you could easily send you data across by choosing a name for the index, something like 'postdata', anything will do, then it will be accessible on the system youre posting to via $_POST['postdata']. also, inlooking at your usage of CURLOPT_CUSTOMREQUEST, i dont believe youre using it correctly, i think youre just supposed to put a string representing the desired http method in there, so something like 'HEAD', 'PUT', or in this case 'POST'. then you would supply the data as i said earlier, using CURLOPT_POSTFIELDS. so in all, i think something like this would work for you, and also, in reading the warning about CURLOPT_CUSTOMREQUEST, you might just go with CURLOPT_POST = true, since you arent using an obscure http method. im not sure exactly how to determine if the server supports this method or not. anyway, i found this in 'man curl_easy_setopt' (thats the manpage for the c function php uses for the CURLOPT_CUSTOMREQUEST option). Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST contents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote server badly. Use CURLOPT_POST and CUR- LOPT_POSTFIELDS to set POST data. Use CURLOPT_HTTPHEADER to replace or extend the set of headers sent by libcurl. Use CURLOPT_HTTP_VERSION to change HTTP version. -nathan -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Get country from Phone number
-Original Message- From: Dani Castaños [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 5:03 AM To: PHP LIST Subject: [PHP] Get country from Phone number Hi all! I'm looking for some piece of code or class which giving a phone number it returns me from wich country is this phone. Do you know where I can find something like this? Thank you in advanced! -- Seems like you'll have a hard time if you want to include all the possibilities: http://www.kropla.com/dialcode.htm But probably Rob (Cummings) will come up with a solve-it-all regex that will save your day. Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] output buffering in CLI script.
-Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Thursday, February 28, 2008 6:39 AM To: [php] PHP General List Subject: [PHP] output buffering in CLI script. hi there, I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer output so we can avoid the shebang line being output (and strip it from the output we log) $oldIFvalue = ini_set('implicit_flush', false); ob_start(); if ([EMAIL PROTECTED] $script) { ob_end_clean(); } else { $output = explode(\n, ob_get_clean()); if ($output[0] preg_match('%^#!\/%', $output[0])) unset($output[0]); } ini_set('implicit_flush', $oldIFvalue); the reason I'm wanting to do this is, primarily, in order to stop the shebang line that *may* be present in the included script from being output to stdout. -- Aren't you deleting the output when you do ob_get_clean? Meaning, you are missing an echo of the captured buffer, like: $output = explode(\n, ob_get_clean()); if ($output[0] preg_match('%^#!\/%', $output[0])) unset($output[0]); echo join(\n, $output); // You need to echo this, since you lost your buffer by doing ob_get_clean Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uppercase first letter of each new line?
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 27, 2008 5:09 PM To: Keikonium Cc: php-general@lists.php.net Subject: Re: [PHP] Uppercase first letter of each new line? On Wed, 2008-02-27 at 16:38 -0500, Keikonium wrote: Thank you again Robert, and thank you too Daniel. I have gotten both methods to work flawlessly so far :). I am slowly learning by trial and error here, but sometimes a little push in the right direction does some good ^_^. Nothing against Dan, but you should use my version if this is coming from browser submitted data. Dan's presumes unix lines endings which won't always be the case. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- Unless you only get line feeds (\r), this should work as well (for \n or \r\n as line separators) $text = getTextFromSomewhereElse(); $newText = join(\n, array_map('ucfirst', explode(\n, $text))); (fist thing that came to my mind, just posting because of that... use the regex if you want to be safe) Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Getting the name of a function
-Original Message- From: Shawn McKenzie [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 27, 2008 3:58 PM To: php-general@lists.php.net Subject: [PHP] Re: Getting the name of a function Richard S. Crawford wrote: For my own amusement, I'm writing a function that will print out detailed error messages for an API that I'm creating for a minor project. One of the pieces of information I'd like to return would be the name of the function that called the error function. For example: ?php function error ($message) { print The error message is $message; print The function that called the error was: [INSERT COOL CODE HERE]; } function bad_function($param) { error (This is dumb); return false; } bad_function(blah); ? Ideally this script would print this out: The error message is This is dumb The function that called the error was bad_function I know that I could pass the name of the function as a parameter to the error() function (e.g. error(bad_function,This is dumb)) but I'd rather keep it simpler than that. Is there a way to do this? It's an extension but may be worth a look: http://us.php.net/manual/en/ref.apd.php -Shawn Not exactly what you want, but check the use of __FUNCTION__: function error ($message, $fn) { print The error message is $message; print The function that called the error was: $fn; } Function bad_function($param) { error (This is dumb, __FUNCTION__); return false; } You can get better (and more complex) information using debug_backtrace http://php.net/debug_backtrace. Probably doing something like: function error ($message) { $backtrace = debug_backtrace(); $fn = $backtrace[1][function]; print The error message is $message; print The function that called the error was: $fn; } Function bad_function($param) { error (This is dumb); return false; } Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uppercase first letter of each new line?
-Original Message- From: M. Sokolewicz [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 27, 2008 6:06 PM To: Daniel Brown Cc: Robert Cummings; Keikonium; php-general@lists.php.net Subject: Re: [PHP] Uppercase first letter of each new line? Daniel Brown wrote: On Wed, Feb 27, 2008 at 5:08 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2008-02-27 at 16:38 -0500, Keikonium wrote: Thank you again Robert, and thank you too Daniel. I have gotten both methods to work flawlessly so far :). I am slowly learning by trial and error here, but sometimes a little push in the right direction does some good ^_^. Nothing against Dan, but you should use my version if this is coming from browser submitted data. Dan's presumes unix lines endings which won't always be the case. Well, actually, my code will still split it properly (the \n is still at the end), but the \r will become part of the string. Then, when it's modified and passed back with the \n appended, it is redone as \r\n. In any case, as I already said in a previous message, I still agree. Use Rob's code. And what happens if someone uses a(n old) Mac? Where it's just \r (no \n at all) :) - Tul I must declare myself ignorant on this issue, but if you are telling us that only an old Mac will send you line feeds alone... I'd say you have more browser related problems than just new lines. We don't target IE 4 anymore do we? (I don't even target IE 5, it's not worth the pain). Again, my experience with the Mac world is nearly zero. I don't know which specific OS+Browser would cause the issue, but if it is only an old Mac with an old browser... well, I wouldn't care, as I don't care if a visitor with Windows 98+IE5 can't handle CSS and/or Javascript properly. You have to set a limit somewhere (otherwise, why don't we use HTML 3.2 and that's it?). Mine is at IE 6+ and latest FF/Opera/Safari. For the webs I develop, that's more than enough (it covers more than 90% of the market). Anyway... I'm just blind ignorant of what is the specific Mac OS and browser that can cause you trouble with line feeds (maybe all of them has this behavior, I repeat, I don't know). Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Functions not available when run as Scheduled Task?
-Original Message- From: Ray Hauge [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 27, 2008 6:42 PM To: Brian Dunning Cc: php-general@lists.php.net Subject: Re: [PHP] Functions not available when run as Scheduled Task? Brian Dunning wrote: Don't laugh but we have a Win 2003 Server set up with WAMP, and the PHP/MySQL scripts work great. I set one up to run as a scheduled task: C:\php5\php.exe D:\wamp\www\scriptname.php ...but nothing happens and the Scheduled Tasks log says that it exited with an (ff). So I entered the above manually into a command prompt, and it said that mysql_connect() is an unknown function! WTF? It's like it's trying to use a different php.ini file that maybe has mysql commented out. I double checked that all the php.ini files on the machine do have mysql enabled, and anyway mysql works fine normally. Anyone know what PHP is doing to me here in the scheduled service? I think that there might be a separate php-cli.ini file that is not loading the modules that apache does. I'm too lazy to verify, but I remember running into that myself a time or two. Check the output of phpinfo(); or C:\php5\php.exe -v (I think that'll work on Windows). -- Ray Hauge www.primateapplications.com -- Use the -c command line option to be sure, for example: C:\php5\php.exe -c C:\php5\php.ini -f D:\wamp\www\scriptname.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about PHP Licence and it's future!
-Original Message- From: Shawn McKenzie [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 26, 2008 3:44 PM To: php-general@lists.php.net Subject: Re: [PHP] Question about PHP Licence and it's future! tedd wrote: At 12:53 PM -0500 2/25/08, Andrés Robinet wrote: *gringos* started calling me Rob long ago. It's shorter, it's easier to pronounce and it's a short form for my last name (Robinet). Gringos? That brings up another subject, why is it that Caucasians don't have any offensive slang words? We are called by all sorts of slang (i.e., cracker, white-bread, hunkie, and so on), but we don't have something equivalent to the n-word/ No reply is needed -- just a comment. Thanks for pointing out the *who* instead of *that* :), since I didn't realized it until now. That's alright, many English writers get that wrong. You see, when the object is not a person, then the use of that is proper. However, if you are referring to a person, then who is proper. I see a similar thing with people using then when they mean than, but that may be a Brit thing -- like driving on the wrong side of the street or eating with their fork in the wrong hand -- you know one of those cultural things that went haywire. :-) Cheers, tedd They (anyone non-white) call us howlies in Hawaii I believe and it's not meant as a compliment. Regardless, most whites don't take any of these that negatively because we don't view ourselves as the oppressed and don't view the others as oppressors shouting offensive slang at us. Cinco de Mayo is big here in Texas and I held a Gringo de Mayo party last year on the 5th of May. It was a big hit! -Shawn Well, I don't know why some people gives so much importance to words. But I think it's related to what someone said once (don't know who): The raw description of evil scandalizes people much more than the perpetration of it I have some friends who are called *gringo* and some others who are called *niger*. What's more, here in Argentina, many times we call ourselves *niger* (The Spanish word is *negro*) as you would say *buddy* (like *hey niger, let's play soccer tomorrow*), independently of skin color or social status. We also use the same word (*niger*) in a slighting way, referring to ignorant people or people with bad habits (among other things). But we rarely use *gringo* in a slighting way. More often than not we call *gringa* to a hot blonde woman. Now, in Mexico, a *gringo* would mean an US citizen most of the time, and it would be used in a pejorative way most of the time as well. I think you'd all benefit of reading http://en.wikipedia.org/wiki/Gringo: In South America, the word is not pejorative. In some countries it may be used to refer to any foreigner who does not speak Spanish, but in other countries it is used just or especially to refer to U.S. citizens; it may also be used to describe a blond or brunette white native person with soft facial features and light colored eyes. For instance, it is a popular nickname Now, why I said *gringos*? In my case gringos meant both US citizens and Caucasian people (specifically German people), and I didn't mean it in any pejorative way. My company's president (who started calling me Rob in the first place) is a native German, now living in Florida for several years. Same for her husband, and same for many business partners or clients or friends of her. And I have a very nice relationship with them, and they all call me Rob. If I wrote an email signing it *Regards, Andrés*, they wouldn't know who I am (lol). However, I must admit that I used the term *gringo* in the Mexican sense at least once in my life, but just for the fun of it (back in 2002 when I entered English chat rooms to perfection my English and learn a bit of the slang... I was such a dumbass, lol). IMHO, more important than words is the mouth that pronounces them and the ears that hear them, my father-in-law calls me *Mr Magoo* because of my glasses, and I call him *Viejo violeta* (something similar to *pervert*) and we get along very well (despite I've stolen her beloved daughter :D). Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about PHP Licence and it's future!
-Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 26, 2008 6:22 PM To: tedd Cc: php-general@lists.php.net Subject: Re: [PHP] Question about PHP Licence and it's future! On Tue, Feb 26, 2008 at 6:01 PM, tedd [EMAIL PROTECTED] wrote: At 5:10 PM -0500 2/26/08, Andrés Robinet wrote: let's play soccer tomorrow Oh No, that's not the way you guys say it. You say it like: Let's play OOC tomorrow. I believe the word is futbol. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? Yeah, FUTBOL, FUTBOL, FUTBOL! Look what's the first team according to FIFA http://www.fifa.com/worldfootball/ranking/lastranking/gender=m/fullranking.html He he he (now, I'll get tons of emails from Brazilians on this list) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] email with style (again)
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 26, 2008 8:33 PM To: php-general@lists.php.net Subject: [PHP] email with style (again) Ok gang: What's wrong with the following code? It sends the email OK, but nothing is styled. Where did I go wrong? Thanks, tedd --- code ?php $to = [EMAIL PROTECTED]; $body = make_mail(); $subject = Subject; $fromaddress = [EMAIL PROTECTED]; $fromname = tedd; send_mail($to, $body, $subject, $fromaddress, $fromname, $attachments=false); echo('Email sent'); ? ?php function make_mail() { $message = EOT span style=font-weight: bold;Title:/span A title of something span style=font-weight: bold;Presenter:/span By someone tedd EOT; return $message; } function send_mail($to, $body, $subject, $fromaddress, $fromname, $attachments=false) { $eol=\r\n; // Common Headers $headers .= From: .$fromname..$fromaddress..$eol; $headers .= Reply-To: .$fromname..$fromaddress..$eol; $headers .= Return-Path: .$fromname..$fromaddress..$eol; $headers .= Message-ID: .time().-.$fromaddress..$eol; $headers .= X-Mailer: PHP v.phpversion().$eol; // HTML Version $msg .= Content-Type: text/html; charset=iso-8859-1.$eol; $msg .= Content-Transfer-Encoding: 8bit.$eol.$eol; $msg .= $body.$eol.$eol; Shouldn't this be added? $msg .= MIME-Version: 1.0.$eol; ... And, actually, shouldn't this be placed in the $headers variable? Like: $headers = MIME-Version: 1.0.$eol; $headers .= Content-Type: text/html; charset=iso-8859-1.$eol; $headers .= Content-Transfer-Encoding: 8bit.$eol.$eol; $headers .= From: .$fromname..$fromaddress..$eol; $headers .= Reply-To: .$fromname..$fromaddress..$eol; $headers .= Return-Path: .$fromname..$fromaddress..$eol; $headers .= Message-ID: .time().-.$fromaddress..$eol; $headers .= X-Mailer: PHP v.phpversion(); // I REMOVED THE LAST $eol, IS IT NECESSARY??? $msg .= $body.$eol.$eol; ... // SEND THE EMAIL ini_set(sendmail_from,$fromaddress); $mail_sent = mail($to, $subject, $msg, $headers); ini_restore(sendmail_from); return $mail_sent; } ? -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: temporary error
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 4:57 AM To: Andrés Robinet Cc: php-general@lists.php.net Subject: RE: [PHP] Re: temporary error On Sun, 2008-02-24 at 03:34 -0500, Andrés Robinet wrote: -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 2:34 AM To: Andrés Robinet Cc: php-general@lists.php.net Subject: RE: [PHP] Re: temporary error On Sat, 2008-02-23 at 20:11 -0500, Andrés Robinet wrote: -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED] Sent: Saturday, February 23, 2008 1:33 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: temporary error On 2/23/08, tedd [EMAIL PROTECTED] wrote: I love the book written by Carl Sagan the The Dragons of Eden - - he has an interesting perspective on the God thing and it contains more substance than a cute quote. Well as long as we're quoting famous old fence-sitting agnostics, lets not forget Sagan's best: 'If by God one means the set of physical laws that govern the universe, then clearly there is such a God. This God is emotionally unsatisfying... it does not make much sense to pray to the law of gravity.' -- Greg Donald http://destiney.com/ Why not? Many people believes in such a God, so he has a very high probability of existence, and it has taken the worst part as nobody I know of is currently praising and praying to him. You sir have homework: http://en.wikipedia.org/wiki/Bandwagon_effect http://en.wikipedia.org/wiki/List_of_cognitive_biases http://en.wikipedia.org/wiki/Critical_Thinking LOL, I have to recognize that my previous email had some dirty tricks in it. I was mostly being ironic. I'm actually more of an agnostic person (with some atheism moments from time to time). So, let me clarify what I said and to whom I said it: *Many people believe in such a God, so he has a very high probability of existence*: To those who say that something exists because they believe in it. That can't be true, since anybody can argue the opposite (something does not exist, because they don't believe in it) and neither of them can be proved. As both statements can't be true, we can assume there's no deterministic way in which existence can be derived from belief. So we can propose as an alternate hypothesis that existence is a probabilistic variable, proportional to the number of believers, ergo, the aforementioned God has pretty good chance of existence. Furthermore, in order to simplify the problem we can compute the probability of existence, in a weighted average fashion, using the metric *believer contribution to the human race* (from now on called C), we get following formula: P(G) = SUM [ C(i)*X(i) ] / SUM [ C(i) ] Were, P(G) is the *probability of existence of god G*, C(i) is the aforementioned metric applied to person *i* and X is a binary variable, such that: X(i) = [*i* is a person: 1 if person *i* is a believer of god G, 0 otherwise] We can even find joint probabilities for gods G1 and G2 and calculate all sorts of statistic parameters. The only problem is determining C(i), that is, a measure of the contribution of person *i* to the human race, but our team has found a method for that. I can't get deeper into this, because I would be in violation the NDA I have signed with NSA. Interesting though, is that we can find gods that have more probability of existence than an electron in the first level of energy of an hydrogen atom (and we don't have such a complicated formula! http://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation) So this is more of a scientific reality (still being researched) than a bias in our brains. And we must believe in science, *EVERYONE DOES*, right? (lol) This is still invalid argument. I'm not sure if it falls under illusory correlation, proof by verbosity or both. It makes no difference what the math says since we know nothing about the probability and we cannot ascertain any probability from any sample. The probability that God exists doesn't change depending on the audience, just like the probability of a fair dice doesn't change depending on the thrower (note I said fair dice ;). To declare some probability means we have some knowledge of God, but if we did then the whole issue would be moot. And so the probability is unknown. For instance, the question is not the same as trying to guess the probability of aliens existing in the universe. For the universe we know the approximate size, and we know that there are already creatures living in the universe (us). And so we can try to guess a probability based on this knowledge. But for God... we know nothing. You know nothing about God, I know nothing about
RE: [PHP] RE: temprorary error
-Original Message- From: Nathan Rixham [mailto:[EMAIL PROTECTED] Sent: Monday, February 25, 2008 11:32 AM To: php-general@lists.php.net Subject: Re: [PHP] RE: temprorary error Robert Cummings wrote: On Mon, 2008-02-25 at 11:18 -0500, Daniel Brown wrote: I didn't think Quakers could use computers. Or electricity. You're confusing them with Amish. Cheers, Rob. and coldfusion developers And windows users (lol) [ps: rob your lucky i keep saving your ass from the dreaded last post] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] URL modification
-Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: Monday, February 25, 2008 11:37 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] URL modification On Sat, Feb 23, 2008 at 6:27 AM, Richard Heyes [EMAIL PROTECTED] wrote: You could also forego the Files bit if you're willing to accept URLs like this: /rental.php/property/23425 I was waiting to see if anyone made mention of that while reading through the thread. I think this is a highly underused built-in feature. PHP is already, out-of-the-box, ready for search-engine-friendly URLs. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? Yeap, PHP rocks! I mentioned it in the first reply, only that it was not rental.php, but index.php. Many if not all MVC frameworks support this kind of routing which doesn't require mod_rewrite. However, I prefer mod_rewrite if it's available, for crawlers it is not the same /index.php/my-keywrod than /my-keyword alone. But I must admit that there are a hundred other factors that can have much more weight for generating SEO problems than having index.php everywhere. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about PHP Licence and it's future!
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 9:09 AM To: php-general@lists.php.net Subject: RE: [PHP] Question about PHP Licence and it's future! Rob (Other Rob that is actually called Andrés) Yeah, that confused me too. Especially when I saw you arguing with yourself. Also, the phrase: Rob (Other Rob that is actually called Andrés) would read better as: Rob (Other Rob who is actually called Andrés) Why don't you use the name Andrés ? That's much better than Rob anyway. ;-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com *gringos* started calling me Rob long ago. It's shorter, it's easier to pronounce and it's a short form for my last name (Robinet). So I just adopted it for simplicity. However it turns out to be a mess sometimes since they've called me *Robert*, *Robbie* and whatever you can imagine that starts with Rob (lol). Humility aside, Andrés is the best name ever! :). But my opinion might be just a bit biased (*bias* is such a fashion these days :)) Also, It's likely that you will find spelling and grammar issues all over in my writing, since I'm a Spanish speaker by birth and I still live in Argentina. Thanks for pointing out the *who* instead of *that* :), since I didn't realized it until now. Cheers, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about PHP Licence and it's future!
-Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: Monday, February 25, 2008 1:24 PM To: Andrés Robinet Cc: tedd; php-general@lists.php.net Subject: Re: [PHP] Question about PHP Licence and it's future! On Mon, Feb 25, 2008 at 1:23 PM, Daniel Brown [EMAIL PROTECTED] wrote: On Mon, Feb 25, 2008 at 12:53 PM, Andrés Robinet [EMAIL PROTECTED] wrote: Thanks for pointing out the *who* instead of *that* :), since I didn't realized it until now. That's realize, Andrés. ;-P Oh, and by the way Thank you for subscribing to [EMAIL PROTECTED] Heh. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? Oh dear, I think I can't help it! I'll need a good lawyer in order to avoid life imprisonment! But... in order to have a fair court on this trial, only people capable of quickly repeating tres tristes tigres comen trigo en un trigal in Spanish should be part of the jury. :) Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP cuts download process prematurely
-Original Message- From: Shawn McKenzie [mailto:[EMAIL PROTECTED] Sent: Monday, February 25, 2008 11:19 PM To: php-general@lists.php.net Subject: [PHP] Re: PHP cuts download process prematurely Manuel Barros Reyes wrote: I am building a report application that generates some text files for download and when the download starts it stops prematurely. The file sizes are currently in the order of the mega bytes and when I try the script that generates and sends the file in a test server the process goes smoothly no matter the size of the file but as soon as I move the script to the production server dowloads cut at 300kb aprox. My current workarround is to gzip the files and that is giving me some extra time but the files are growing and sooner or later my workarround will become useless. I guess the download is stoped by some timeout and not because of the amount of kb downloaded because the size varies slightly. If that timeout exists it should be of apox. 5-10 seconds. I use this function to perform the upload $contenido is the content of the file and to that variable I assign the big chunk of output from the report, $nombre_archivo is the optional name for the file. I can paste more code but I think the problem is here. ?php function enviarArchivo($contenido, $nombre_archivo = ) { if($nombre_archivo == ) { $nombre_archivo = date(dmyHi)..csv; } header(Content-Type: application/octet-stream); header(Content-Disposition: attachment; filename=$nombre_archivo); header(Content-Length: .strlen($contenido)); echo $contenido; } ? Thanks in advance Manuel What does your error log say when this happens? -Shawn Though this is not likely to solve the problem, try adding the following two lines at the beginning of the script (even before you query the database and do all your logic) ignore_user_abort(true); set_time_limit(0); If this solves the problem you should read this http://ar2.php.net/info and this http://ar2.php.net/manual/es/function.ignore-user-abort.php carefully and then choose more rational settings. PHP has a default execution time of 30s. However, this is not likely to solve the problem as execution time should not be affected by streaming and we are assuming the user/browser is not aborting the connection. On the other hand you could support download resuming (it involves some tricky headers and if you are willing to dig deeper into this read the manual notes at http://ar.php.net/manual/es/function.header.php). But this won't solve your problem... at least for IE as it doesn't support resuming :(. You need the log files to know exactly what the problem is. And, even if you are not solving this issue using compression as a workaround, you may also want to add at the beginning of the script: ob_start(ob_gzhandler) Or... you can use zlib.output_compression INI setting in an .htaccess file or in php.ini. Compressed files will require more server processing but will download way faster. ob_gzhandler and zlib compression are transparent to the end user, so they will think they've got the uncompressed file, no need to gzip the files programmatically. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: temporary error
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 2:34 AM To: Andrés Robinet Cc: php-general@lists.php.net Subject: RE: [PHP] Re: temporary error On Sat, 2008-02-23 at 20:11 -0500, Andrés Robinet wrote: -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED] Sent: Saturday, February 23, 2008 1:33 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: temporary error On 2/23/08, tedd [EMAIL PROTECTED] wrote: I love the book written by Carl Sagan the The Dragons of Eden -- he has an interesting perspective on the God thing and it contains more substance than a cute quote. Well as long as we're quoting famous old fence-sitting agnostics, lets not forget Sagan's best: 'If by God one means the set of physical laws that govern the universe, then clearly there is such a God. This God is emotionally unsatisfying... it does not make much sense to pray to the law of gravity.' -- Greg Donald http://destiney.com/ Why not? Many people believes in such a God, so he has a very high probability of existence, and it has taken the worst part as nobody I know of is currently praising and praying to him. You sir have homework: http://en.wikipedia.org/wiki/Bandwagon_effect http://en.wikipedia.org/wiki/List_of_cognitive_biases http://en.wikipedia.org/wiki/Critical_Thinking Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' LOL, I have to recognize that my previous email had some dirty tricks in it. I was mostly being ironic. I'm actually more of an agnostic person (with some atheism moments from time to time). So, let me clarify what I said and to whom I said it: *Many people believe in such a God, so he has a very high probability of existence*: To those who say that something exists because they believe in it. That can't be true, since anybody can argue the opposite (something does not exist, because they don't believe in it) and neither of them can be proved. As both statements can't be true, we can assume there's no deterministic way in which existence can be derived from belief. So we can propose as an alternate hypothesis that existence is a probabilistic variable, proportional to the number of believers, ergo, the aforementioned God has pretty good chance of existence. Furthermore, in order to simplify the problem we can compute the probability of existence, in a weighted average fashion, using the metric *believer contribution to the human race* (from now on called C), we get following formula: P(G) = SUM [ C(i)*X(i) ] / SUM [ C(i) ] Were, P(G) is the *probability of existence of god G*, C(i) is the aforementioned metric applied to person *i* and X is a binary variable, such that: X(i) = [*i* is a person: 1 if person *i* is a believer of god G, 0 otherwise] We can even find joint probabilities for gods G1 and G2 and calculate all sorts of statistic parameters. The only problem is determining C(i), that is, a measure of the contribution of person *i* to the human race, but our team has found a method for that. I can't get deeper into this, because I would be in violation the NDA I have signed with NSA. Interesting though, is that we can find gods that have more probability of existence than an electron in the first level of energy of an hydrogen atom (and we don't have such a complicated formula! http://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation) So this is more of a scientific reality (still being researched) than a bias in our brains. And we must believe in science, *EVERYONE DOES*, right? (lol) *and it has taken the worst part as nobody I know of is currently praising and praying to him* Just part of the (bogus) argument. I have not yet conducted a survey, but, why would you praise a God if he has no implications in your life (hey, perhaps that's how the *personal God* idea arose in human minds). And why would you pray to him, if he's not interested in your fate or life and has zero requirements to let you in his *private circle of trust*? (yes, I took that from *The Fuckers* movie). So, there are scientific studies to support my argument (call 0800-THE-NSA and ask for Rob if you don't believe me). And at least a rational assumption also (*and it has taken the worst part as nobody...*). What bias are you talking about? Regards, Rob PS. Please
RE: [PHP] Question about PHP Licence and it's future!
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 2:40 AM To: Tamer Higazi Cc: php-general@lists.php.net Subject: Re: [PHP] Question about PHP Licence and it's future! On Sun, 2008-02-24 at 06:50 +0200, Tamer Higazi wrote: Hi! I have asked myself a question. After I saw, that SAP will no more release future Versions of their open source Database MaxDB under the GPL License, I have asked myself either if this could happen with PHP. Who owns PHP? Is it Zend Technologies or the PHP Group itself? Who is the PHP Group and what makes the PHP Group? Who guaranties that future Versions of PHP stays open source and are being released under the Terms of the General Public Licenses? Can future Versions from one day to the other no more being released under the GPL, only under a closed source license? Let us say, PHP would be distributed for several architectures only in binary forms and the PECL modules stay open source. These questions are for me very importand according to an commercial product which will be planed, designed, written and sold commercially. We are pendling between Ruby, Python and PHP5. Only the point written is unclear. It doesn't matter. The PHP code as it is has been released under the PHP License. This means if the future versions were ever released under another license that was exclusionary, then there is still the opportunity to fork code released under the PHP license. Heck you can fork the PHP project now if you felt you could get the ball rolling with enough momentum for acceptance. If beleive the hardened PHP project is considered a fork despite the fact it generally keeps full compatibility while adding security enhancements. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' Rob, Are you sure you can fork the *current* PHP version??? The hardened PHP project still complains with the PHP license I think. I don't think the current PHP version can be forked, you can fork PHP 3, but not PHP 5 for example. Maybe I'm totally wrong, but it doesn't matter, I don't think PHP will change its license in a substantial way, it wouldn't be profitable to anybody on the long run (including Zend) and everyone would start switching to, say, RoR. Just my uninformed and honest opinion. Regards, Rob (Other Rob that is actually called Andrés) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about PHP Licence and it's future!
-Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 3:41 AM To: 'Robert Cummings'; 'Tamer Higazi' Cc: php-general@lists.php.net Subject: RE: [PHP] Question about PHP Licence and it's future! -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 2:40 AM To: Tamer Higazi Cc: php-general@lists.php.net Subject: Re: [PHP] Question about PHP Licence and it's future! On Sun, 2008-02-24 at 06:50 +0200, Tamer Higazi wrote: Hi! I have asked myself a question. After I saw, that SAP will no more release future Versions of their open source Database MaxDB under the GPL License, I have asked myself either if this could happen with PHP. Who owns PHP? Is it Zend Technologies or the PHP Group itself? Who is the PHP Group and what makes the PHP Group? Who guaranties that future Versions of PHP stays open source and are being released under the Terms of the General Public Licenses? Can future Versions from one day to the other no more being released under the GPL, only under a closed source license? Let us say, PHP would be distributed for several architectures only in binary forms and the PECL modules stay open source. These questions are for me very importand according to an commercial product which will be planed, designed, written and sold commercially. We are pendling between Ruby, Python and PHP5. Only the point written is unclear. It doesn't matter. The PHP code as it is has been released under the PHP License. This means if the future versions were ever released under another license that was exclusionary, then there is still the opportunity to fork code released under the PHP license. Heck you can fork the PHP project now if you felt you could get the ball rolling with enough momentum for acceptance. If beleive the hardened PHP project is considered a fork despite the fact it generally keeps full compatibility while adding security enhancements. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' Rob, Are you sure you can fork the *current* PHP version??? The hardened PHP project still complains with the PHP license I think. I don't think the current PHP I meant *complies* not *complains* sorry (lol, I really need that cup of coffee now) Regards, Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: temporary error
-Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED] Sent: Saturday, February 23, 2008 1:33 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: temporary error On 2/23/08, tedd [EMAIL PROTECTED] wrote: I love the book written by Carl Sagan the The Dragons of Eden -- he has an interesting perspective on the God thing and it contains more substance than a cute quote. Well as long as we're quoting famous old fence-sitting agnostics, lets not forget Sagan's best: 'If by God one means the set of physical laws that govern the universe, then clearly there is such a God. This God is emotionally unsatisfying... it does not make much sense to pray to the law of gravity.' -- Greg Donald http://destiney.com/ Why not? Many people believes in such a God, so he has a very high probability of existence, and it has taken the worst part as nobody I know of is currently praising and praying to him. Maybe, it is about time to give some recognition to *the real God*: I believe in Spinoza's God, who reveals Himself in the lawful harmony of the world, not in a God Who concerns Himself with the fate and the doings of mankind. - Albert Einstein At least this God seems not to incite people to kill other people, and doesn't ask you to go to church every Sunday to put some money in the priest's pockets. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question about PHP Licence and it's future!
-Original Message- From: Tamer Higazi [mailto:[EMAIL PROTECTED] Sent: Saturday, February 23, 2008 11:50 PM To: php-general@lists.php.net Subject: [PHP] Question about PHP Licence and it's future! Hi! I have asked myself a question. After I saw, that SAP will no more release future Versions of their open source Database MaxDB under the GPL License, I have asked myself either if this could happen with PHP. Who owns PHP? Is it Zend Technologies or the PHP Group itself? Who is the PHP Group and what makes the PHP Group? Who guaranties that future Versions of PHP stays open source and are being released under the Terms of the General Public Licenses? Can future Versions from one day to the other no more being released under the GPL, only under a closed source license? Let us say, PHP would be distributed for several architectures only in binary forms and the PECL modules stay open source. These questions are for me very importand according to an commercial product which will be planed, designed, written and sold commercially. We are pendling between Ruby, Python and PHP5. Only the point written is unclear. for any answer Thank you very much Tamer Higazi First off, PHP is not GPL-ed. Check this http://www.php.net/license/ Now, if all you plan to do is to *write PHP code you can sell*, I'd say you rest assured. Nothing like MaxDB issue will ever happen to PHP (though things like this could happen for PECL extensions who depend on third-party libraries I think). So, unless you are planning to distribute the Zend Scripting Engine ALONE as part of a commercial product (say you want to use PHP to script against a desktop application, like VBA works for MS Word), you are also safe about Zend. Keep in mind also, that the worst problem with closed source software is lack of support if the company goes out of business. I believe that will never happen to PHP. It can happen to some extensions, but only those that rely on third-party functionality (say, the mysql extension), so the problem is not PHP itself (and you'll have the same problem for every other language). As this is not an authoritative answer, you'd better off sending an email to [EMAIL PROTECTED] explaining what you are planning to do and your concerns on the future of PHP. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: temporary error
-Original Message- From: Shawn McKenzie [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 10:36 AM To: php-general@lists.php.net Subject: [PHP] Re: temporary error Mirco Soderi wrote: In my opinion, variable names are a personal choice, I think the time you loose when writing the name (about a second is long less than the time you gain when, months later, you go and modify the code and you have clear the content and meaning of each variable. In the original code there were no sintax errors, I added some errors when pasting here. Sorry. I have found that in the first execution, it was the $logQueryInserimentoDatiAllenamentoCalciPiazzati that evaluated to false. After having removed the two-field key that I had originally defined for that table and having added an autoincrement key, the problem seems to be solved. Do you find any reason for that? Mirco Soderi [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED] Consider the following code: $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = INSERT INTO ... etc etc $queryInserimentoDatiAllenamentoCalciPiazzati = mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati); if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something } if($queryInserimentoDatiAllenamentoCalciPiazzati) { $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query(insert into log ... etc etc ...); if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } } if($queryInserimentoDatiAllenamentoCalciPiazzati $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } 1st execution: $queryInserimentoDatiAllenamentoCalciPiazzati $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last conditional statement, evaluates to false even if both queries are correctly executed. I modify as follows: $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = INSERT INTO ... etc etc $queryInserimentoDatiAllenamentoCalciPiazzati = mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati); if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something } else echo(error message 1); if($queryInserimentoDatiAllenamentoCalciPiazzati) { $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query(insert into log ... etc etc ...); if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } else echo(error message 2); } if($queryInserimentoDatiAllenamentoCalciPiazzati $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } 2nd execution: $queryInserimentoDatiAllenamentoCalciPiazzati $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last conditional statement, evaluates to true. Now, I modify again, back to the original version: $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = INSERT INTO ... etc etc $queryInserimentoDatiAllenamentoCalciPiazzati = mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati); if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something } if($queryInserimentoDatiAllenamentoCalciPiazzati) { $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query(insert into log ... etc etc ...); if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } } if($queryInserimentoDatiAllenamentoCalciPiazzati $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } 3rd execution: $queryInserimentoDatiAllenamentoCalciPiazzati $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last conditional statement, evaluates to true. Do you know any reason for that? Glad to see that you found your problem. Variables may be easier to read with some underscores. Personally, here is what I use as a counter in most all of my code, instead of $i++; which isn't always clear. $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter = $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter + ($Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter / $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter); If you wan to shorten a bit you can use a constant as the counter increment like so: define('Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter', 1); $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter = $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter + Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter; -Shawn You forgot to add the project name you are working on to the counter, this way you'll never confuse yourself at all. define('Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter_For_Project _Spaghetti', 1); $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter_For_Project_Spaghetti = $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter_For_Project_Spaghetti + Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter_For_Project_Spaghet ti; LOL -- PHP General Mailing List (http://www.php.net/) To
RE: [PHP] All Survey leading to PHP
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 11:36 AM To: Allan Fernandes Cc: php-general@lists.php.net Subject: Re: [PHP] All Survey leading to PHP On Thu, February 21, 2008 6:29 am, Allan Fernandes wrote: 1) Is there any method to protect source code of my applications even when deployed at the clients Server. Have a good, clear contract and relationship with the client. You can also attempt to encode them with any number of PHP encoders, all of which have been and can be cracked by a determined user. 2) Can I call Delphi Dll's You may be able to use COM objects. http://php.net/com -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- I assume you will be deploying your applications on a windows server, right? Otherwise, COM is NOT an option (probably .Net is ???). Just curious, why would you want to call a Delphi DLL (which is no different than any DLL)? Just curious (x2) has anybody tried Delphi 4 PHP (http://www.codegear.com/products/delphi/php)? As a Delphi fan... if you are moving to PHP development, I'd say you forget all you know about Delphi (or .Net for that matter) except the very generic programming and OOP concepts. If you plan to target Linux... forget about DLLs. However, if you will always use your own server for deployment, you could try *migrating* your existing codebase as a set of modules and cgi programs (I don't know, it depends on what you are trying to do). Check out Freepascal (http://www.freepascal.org/). Anyway, if you are deploying PHP web applications for *all* OSs, you'd better off forgetting about Delphi and get good tutorials/courses/books on PHP. And if you want a Delphi-like IDE... be prepared for deception, only Delphi4PHP gets somewhere close to that (and I don't know how high are the runtime requirements to run PHP-VCL applications). There are very good PHP IDEs, such as Zend Studio, PHPDesigner, and NuSphere, etc... but forget about clicking and dragging components on a form if that's your choice. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP To an EXE Executable for Win32 ( Is it possible)
-Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 4:17 PM To: php-general@lists.php.net Subject: [PHP] PHP To an EXE Executable for Win32 ( Is it possible) I know that there's apparently some way to compile PHP to make it run faster. But has anyone come up with a system to turn PHP scripts into an .exe? What I mean is you would run the exe and see exactly the same thing as if you were viewing the script through a webbrowser, but without having to install php. What is the name of this? - Dan -- If you want to see exactly the same thing as if you were viewing the script through a webbrowser... ... THEN YOU'LL NEED a webbrowser. PHP only generates the HTML output (and under some circunstances JS, CSS and other file types). If you mean to develop desktop applications in PHP, then you want to take a look at PHP-GTK (http://gtk.php.net/). If you mean to just convert a script PHP into binary code for whatever purpose you want, then probably you should be after the Roadsend compiler http://www.roadsend.com/home/index.php?pageID=compiler or any other similar solution (if they exist - ???). However, assuming that your solely goal is to make PHP run faster, the first and best step you can take is to improve your application and database design and optimize your PHP code. Then, you can take further steps, such as installing an opcode cache, or accelerator (Zend Optimizer, eAccelerator, XCache, etc). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] AMP installer
-Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 6:24 PM To: php php Subject: [PHP] AMP installer Hey! Need to reinstall Apache PHP and MySql for personal development use on my new laptop... I usually used phpdev in the past but now I want php5 compatability... can anyone recommend any such all in one installer. And yes, I know its good experience and so on to do each one manually... but dont have the time to pure over help docs for hours or days. Am on Win Vista premium. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) ___ _ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs -- Hi there, It's not that hard to install them all separately and configure them. However, yes, sometimes you just want a quickstart and then customize as needed. This is my recommendation for Windows XP (http://www.apachefriends.org/en/xampp-windows.html), I don't know of Vista, but it seems to work for that OS too. Also, I prefer to use MySQL gui tools for MySQL administration (instead of the bundled mysqladmin - or even PHPMyadmin, which I use only for exporting - that comes with XAMPP) http://dev.mysql.com/downloads/gui-tools/5.0.html. Hope this helps, though you will get other options as well, this is much of a personal choice (One year ago I installed them all separately, to get very familiar with the setup). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with quotes
-Original Message- From: Mário Gamito [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 11:04 PM To: php-general@lists.php.net Subject: [PHP] Problem with quotes Hi, Sorry for such a laim question. I have this code: $host = 'http://' . $_SERVER['HTTP_HOST']; foreach($browser as $key = $val){ echo img src=\dcs/ . $key . '.png' . / . ; (...) but it has a bug, I need to add the server domain before the picture, so I did: $host = 'http://' . $_SERVER['HTTP_HOST']; foreach($browser as $key = $val){ echo $host . img src=\dcs/ . $key . '.png' . / . ; (...) But this way, all it echoes is the $host variable. What am I missing here ? Any help would be appreciated. Warm Regards, Mário Gamito Mmm... It may have to do with operator precedence Try either: code echo ($host . img src=\dcs/ . $key . '.png' . / . ); /code Or, code $output = $host . img src=\dcs/ . $key . '.png' . / . ; echo $output; /code Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Exception vs exception
-Original Message- From: Prabath Kumarasinghe [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 11:19 PM To: php-general@lists.php.net Subject: [PHP] Exception vs exception Hi All Recently I'm came across following code snippet regarding exceptions there I'm executing invalid query and catch the exception as follows. First Approach --- try{ $result = mysql_query('SELECT * from unknowntable'); }catch(exception $e){ echo $e-getTrace(); } --- Second Approach --- try{ $result = mysql_query('SELECT * from unknowntable'); if (!$result) { throw new MySQLException('Query failed to execute') } }cathc(MySQLException $e){ echo $e-getMessage(); }cathc(Exception $e){ echo $e-getMessage(); } --- Which one is the best approach and efficient and what the recommended approach. Cheers Prabath ___ _ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs Class names are case insensitive, so Exception is the same as exception. Now, about the first approach: Does the mysql extension throw exceptions??? (maybe you just didn't write the throw statement, I presume). About the second approach: What is catchc? (I guess it's just a typo). And, what other exceptions are you expecting to be thrown out of the try block to use the second *generic* catch? If you and only you are throwing the custom * MySQLException* exception (which you should code and throw under the proper conditions) why do you need a generic *Exception* catch block? Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] form cleaner class
-Original Message- From: nihilism machine [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 11:53 PM To: php-general@lists.php.net Subject: [PHP] form cleaner class What is a better idea? Using this class in my db class and using CleanInput on the sql statements, or using it in the top of the all pages with form input to clean the $_POST's? Will all your $_POST variables contain HTML code that must be filtered out except a set of tags that must be kept? Otherwise, it's not worth to filter everything everytime (it will become a performance issue). IMO, if you expect an integer for some *whatever* input variable, it's best to do: $whatever = (int)$_POST['whatever']; Also, any ideas or comments on improving the class? I'd check out how well-known PHP Frameworks/CMS clean out HTML code to prevent XSS attacks (If somebody has done the job already, you just need to improve it - if you ever can). And what other precautions they take. ?php class FormCleaner { // Initializer function __construct() { if (count($_POST) 0) { foreach($_POST as $curPostKey = $curPostVal) { $_POST[$curPostKey] = $this- CleanInput($curPostVal); } } } // Clean Form Input public function CleanInput($UserInput) { $allowedtags = b/bi/ih1/h1a/aimgul/ulli/ liblockquote/blockquote; $notallowedattribs = array(@javascript:|onclick|ondblclick| onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress| onkeydown|[EMAIL PROTECTED]); $changexssto = ''; $UserInput = preg_replace($notallowedattribs, $changexssto, $UserInput); $UserInput = strip_tags($UserInput, $allowedtags); $UserInput = nl2br($UserInput); return $UserInput; } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] URL modification
-Original Message- From: Xavier de Lapeyre [mailto:[EMAIL PROTECTED] Sent: Friday, February 22, 2008 2:09 AM To: php-general@lists.php.net Subject: [PHP] URL modification Importance: High Hi all, I saw on some websites that modifies the links to access the webpages. Something like: http://www.example.com/login/ instead of http://www.example.com/login.php Does anyone knows how this works or how its call / which PHP library performs this action? Xavier de Lapeyre That's called URI/URL Routing and it's usually performed as part of every MVC Framework I know of (CodeIgniter, CakePHP, Symfony, Zend Framework... just to name a few). It's usually implemented through Apache's mod_rewrite module, but you can get close without that module, if you allow for something like: http://www.example.com/index.php/myaccount/profile (that is, you don't need mod_rewrite unless you want to remove the index.php part of the URI path) However, if you have an existing website, migrating it to use one of the MVC frameworks (or just using a stand-alone URI Routing class) may not be the path you want to follow. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Php warning message
-Original Message- From: Jason Pruim [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 20, 2008 4:39 PM To: Yuval Schwartz Cc: php-general@lists.php.net Subject: Re: [PHP] Php warning message On Feb 20, 2008, at 4:29 PM, Yuval Schwartz wrote: Hello and thank you, Another question, I get a message: *Warning*: feof(): supplied argument is not a valid stream resource in * /home/content/t/h/e/theyuv/html/MessageBoard.php* on line *52* ** And I've tried troubleshooting for a while; I'm pretty sure I'm opening the file handle correctly and everything but I can't get feof or similar functions like fgets to work. Here is my code if you're interested (it's so that I color every 2nd line in the text): *$boardFile = MessageBoard.txt; $boardFileHandle = fopen($boardFile,r); for ($counter = 1; !feof($boardFileHandle); $counter += 1) { $colorLine = fgets(boardFilehandle); if ($counter % 2 == 0) { I may be showing my ignorance here... But on your if ($counter % 2 ==0) line what does the % do? Was that possibly a typo? Also, it might be good to point out what line 52 is :) echo font color='00ff00'$colorline/font; } else { echo $colorline; } } fclose($boardFileHandle);* Thank you -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] % is the modulus (= remainder most of the time) operator. 8 % 2 == 0, 9 % 4 == 1, etc You are missing a $ at fgets(boardFilehandle); (should be fgets($boardFilehandle);). Are you sure the file handle is valid anyway? // $boardFileHandle = fopen($boardFile,r); If ($boardFileHandle) { die(very bad things happen these days); } // Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] More than one values returned?
-Original Message- From: Nathan Rixham [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 19, 2008 5:17 AM To: php-general@lists.php.net Subject: Re: [PHP] More than one values returned? Robert Cummings wrote: On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote: On Monday 18 February 2008, Nick Stinemates wrote: I have found, however, that if I ever need to return /multiple/ values, it's usually because of bad design and/or the lack of proper encapsulation. You mean you've never had a function like getCoordinates()? Or getUsers(), or any other of a zillion perfectly valid and reasonable functions that return multiple values as an array? Wow, how odd! Cheers, Rob. getCoordinates() would return a Point object getUsers() would return a Group object... Not rocket science ;) I wouldn't consider an array of user objects to be multiple things. I consider it a single aggregate thing, and return arrays all the time. That's conceptually different from wanting two separate return values from a function, which is indeed conceptually icky. Yes, an aggregate is comprised of multiple things usually. Hence when decomposing the concept you are indeed returning multiple values-- both points of view are valid. If you receive a parcel of 100 pens. I can say, has the parcel arrived yet (one entity) or have the pens arrived yet (multiple entities). At any rate, the O.P. wanted to return multiple values called $x and $y. It seems quite reasonable to assume he was returning something akin to coordinates but didn't know how to do so by binding them in an aggregating structure such as an array, or if you wish, an object. Cheers, Rob. seriously, whats wrong with returning an array? half the standard php functions return array's, therefore at least half of php has been designed badly..? ps: when working with co-ordinates / GIS data you should really be using wkb data instead, it's much faster. [unpack] So returning multiple values is a bad thing? How about Matlab for which it is such a common thing to use multiple return values, and they even have names? function [x, y] = myvectorfun(A, t) x = A*cos(t); y = A*sin(t); end Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Gzipped output
-Original Message- From: Jakub [mailto:[EMAIL PROTECTED] Sent: Sunday, February 10, 2008 1:36 PM To: php-general@lists.php.net Subject: Re: [PHP] Gzipped output That would do the trick if it was allowed at the server but it isn't :( And it's not my server and I can't change its settings. Jakub Čermák [EMAIL PROTECTED] ICQ 159971304 Per Jessen napsal(a): Jakub wrote: Yes, I thought about this, but this has a big disadvantage - the client must wait for the file to be fully processed and compressed and then he can start downloading. I'd like to let the client start downloading the compressed parts while the further parts are still being processed and compressed - it's similar to streaming concept. I hope you can see what I mean. Maybe apaches mod_deflate is what you're after? That will do in-flight compression. /Per Jessen, Zürich How about something like this? (Needs debugging and testing, but... just a hint after all) ?php ob_start(ob_gzhandler); while ($someString = getTheNextPartOfTheLargeFile()) { echo $someString; ob_flush(); } ? Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Source code protection
exclusive contracts for continued support on the scripts. they possess the acumen and free time to be able to reverse-engineer the code themselves, I honestly don't know why they'd pay someone to develop the application in PHP for them in the first place. I honestly don't know where you find clients so dumb that they who would put up with not getting full source code for a paid project. Hopefully by now I've illustrated enough points. For now, I'm heading out of the office for the evening. Well, at least that's the plan at this moment -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? Has anybody mentioned ionCube? http://www.ioncube.com/ It's always the choice for encoding DirectAdmin commercial templates and plugins (not saying it is the best, just the common practice in DA's commercial world). Also: 1 - I believe the fact that we don't encode (read compile) our scripts is tightly related to the fact that we don't have a bytecode interpreter (say JIT compiler or something?) bundled into PHP. If we had, we'd all release the compiled scripts for performance reasons and forget about distributing the source code (clients don't usually ask for source code, they usually don't even know what source code is). So, we don't encode them, compile them, binarize them because we can't rely on anything installed in hosting XYZ. Existing pure PHP obfuscating solutions are not worth the try (my opinion) and only compromise performance or break working code (my opinion again). 2 - Decoding an encoded script will not (usually?) restore the original source code, but rather a reverse engineered binary code that would become the encoded script if it was again processed by the encoding software. So, if source code alone is hard to read sometimes, just imagine reverse engineered binary code. So, I think that encoding PHP scripts for copyright, security, or whatever reason, is as valid as using serial numbers and activation codes for desktop software, despite we all know that we can get key generators and cracks in the p2p networks, such as ed2k and bittorrent. 3 - If the PHP license allows for commercial use of PHP scripts and allows for encoding the sources, I don't see any compelling reason or commandment to not do so. If you give away something, nobody has the obligation of doing the same. It is the client who has to make the choice; and other than that, it is you who have to either start encoding your files or placing huge banners in your site with the phrase WE DON'T ENCODE OUR WORK, or just do nothing. Just to make it clear, we don't encode our work :), but only because: 1 - We trust ourselves, that nobody can get a better deal for our clients. 2 - If we offered source release as an extra, no client would want it and it would still be a management pain for us to debug-encode-upload. The only concern for a client is that the damn thing works. If the damn thing doesn't work they would just contract someone else, source code or not. It doesn't make any difference. 3 - Either you have to buy encoding software and beg all your clients have the decoding counterpart installed in their servers, or force all your development clients to host with you, or you have to use pure PHP solutions, which all have some performance hit. But even trusting ourselves, we don't release the source code until the last cent of a project is paid. In the meantime, we host the project. We don't have to trust the client 100%, and that's why we all sign contracts and lawyers exist. In business you can be very friendly and complaisant with your clients; but the only thing you can (barely) trust is a signed piece of paper reviewed by a lawyer. Don't misunderstand me, some clients are great to work with, even those who come to you with cutting-edge ideas for which you spend a weekend without seeing sunshine. But there are some who just change their minds about a critical point in the middle of a project and will want you to rewrite the whole thing from scratch threatening you that they will go somewhere else without paying you a cent (there are people like this). All in all, encoding is either a critical thing, or just another link in the chain, but it is as valid as compiling a C# application and some people may have very specific needs to do so. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] killing a process through php webservice
-Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Friday, February 08, 2008 12:04 AM To: Fahad javed Cc: php-general@lists.php.net Subject: Re: [PHP] killing a process through php webservice Fahad javed wrote: I am developing a webservice in PHP/Linux where I need to kill a process. I tried using exec(kill .$pid); and exec(kill -KILL .$pid); but the return value was always 1 and the process still remained. I wrote up a small shell script and have exec run that script. The script worked fine if invoked through command line but through php it didn't do anything. I have a hunch that this is because killing a process might need root privilages so I updated the script to: sudo -p my_passsword -u root kill $pid yet it didn't work. I still think the problem is access rights. question is how to solve it. Try a full path: /bin/kill or whatever it is. in php, try: ?php $kill_path = '/bin/kill'; echo 'can find kill: ' . is_file($kill_path) . 'br/'; that will tell you whether php can see the file or not. Other stuff like safe-mode being enabled, open_basedir restrictions and this fn can be disabled (echo ini_get('disabled_functions')) all affect whether this will work or not. -- Postgresql php tutorials http://www.designmagick.com/ To use sudo -p my_passsword -u root kill $pid, you will need to add the user php runs on to the wheel group (this is INSANE, REALLY). Doing this, you will open a HUGE backdoor to anyone capable of running ps aux (in php or in any other context) as they will see your root password in plain text (they will see the sudo command line). If possible: 1 - Set up a cron job for root, the cron job would periodically (say every half minute, 10 seconds, whatever) search for a file in a specific location, read it and do what the file says (don't put plain commands, build some sort of interface). 2 - Write or find a daemon capable of doing what you are trying to do (execute commands on demand) but using some authentication model, so that you can communicate with the daemon using a local socket (and don't open the backdoor through TCP/IP). I don't have any clues on this, but that's what I would look for. This is still a risk if you have PHP installed as an apache module (everyone can read your files and your login info, don't they? But at least it is more secure than letting somebody read your sudo command line) 3 - PHP SSH2 extension could be a way... but it is still a HUGE security hole if you have your root password in plain text on your scripts... so you must find some way of not doing so (don't ask me how, I'm not trying to kill a process right now :), I love processes). Just my 2 cts :), Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php installation problem
/iconv/iconv.c:1057: undefin ed reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1316: undefin ed reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1319: undefin ed reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1176: undefin ed reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1128: undefin ed reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1160: undefin ed reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1319: undefin ed reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1228: undefin ed reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1259: undefin ed reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1303: undefin ed reference to `libiconv' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_append_bucket': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:2615: undefin ed reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:2537: undefin ed reference to `libiconv' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_ctor': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:2491: undefin ed reference to `libiconv_open' ext/xmlrpc/libxmlrpc/.libs/encodings.o: In function `convert': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/xmlrpc/libxmlrpc/encodings. c:73: undefined reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/xmlrpc/libxmlrpc/encodings. c:81: undefined reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/xmlrpc/libxmlrpc/encodings. c:101: undefined reference to `libiconv_close' collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 Now please help what should i do? systems are both slackware 12.0 php version same php installation paraments same then why this error message appears. Kind Regards, Umar Draz -- View this message in context: http://www.nabble.com/php-installation- problem-tp15117164p15117164.html Sent from the PHP - General mailing list archive at Nabble.com. Sounds like you need the iconv libraries?? http://www.gnu.org/software/libiconv/#downloading http://ar.php.net/iconv Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date: 1/25/2008 7:44 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] determine file-upload's tmp-filename
-Original Message- From: Michael Fischer [mailto:[EMAIL PROTECTED] Sent: Sunday, January 27, 2008 4:03 AM To: php-general@lists.php.net Subject: Re: [PHP] determine file-upload's tmp-filename Original-Nachricht Datum: Sat, 26 Jan 2008 16:09:58 -0800 Von: Casey [EMAIL PROTECTED] An: Michael Fischer [EMAIL PROTECTED] CC: php-general@lists.php.net Betreff: Re: [PHP] determine file-upload\'s tmp-filename On Jan 26, 2008 3:57 PM, Michael Fischer [EMAIL PROTECTED] wrote: hi there, is there a way to determine the tmp-filename of a file upload while the upload is still in progress? the tmp-file is stored in /tmp and it's name is something like PHP. what i would like to do is: i want to upload a file via a html-form and while the upload is in progress make repeatedly ajax-requests to a php-script on the server that replies the size of the tmp file (the amount of data that was already uploaded). So in this script i need to know what the tmp-filename is. or do you think this is a completely useless approach? lg, Michi Will this help? http://tomas.epineer.se/archives/3 -- -Casey well, i've found this before and this script uses perl-cgi and not php. it determines the tmp-filename as such: $post_data_file = $tmp_dir/$sessionid._postdata; $monitor_file = $tmp_dir/$sessionid._flength; $error_file = $tmp_dir/$sessionid._err; $signal_file = $tmp_dir/$sessionid._signal; $qstring_file = $tmp_dir/$sessionid._qstring; i'm looking for something similar in php... lg, michi If all you want is to display a progress bar, you'd better move all of your logic to the client side. Check this out http://www.swfupload.org/documentation/demonstration Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date: 1/25/2008 7:44 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php installation problem
-Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: Sunday, January 27, 2008 11:03 AM To: php-general@lists.php.net Subject: RE: [PHP] php installation problem -Original Message- From: Umar [mailto:[EMAIL PROTECTED] Sent: Sunday, January 27, 2008 3:55 AM To: php-general@lists.php.net Subject: [PHP] php installation problem Dear Members! I have installed php-5.2.5 on slackware 12.0 with these option successfully ./configure --prefix=/usr/local/php --with- apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-pcre-regex --with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode --enable-bcmath --disable-debug --enable-sockets --enable-force-cgi- redirect --with-gettext --with-zlib --with-gd --enable-gd-native-ttf -- disable- rpath --enable-mbregex --with-bz2 --with-mime-magic --enable-calendar --enable-inline-optimization --enable-magic-quotes --enable- wddx=shared --with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear --with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring --with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local --with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt --with-mhash --with-ldap=/usr/local/ldap Now I am trying to install php-5.2.5 on another slackware 12.0 with same options but i got error on make ext/gd/libgd/.libs/gdkanji.o: In function `do_convert': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/gd/libgd/gdkanji.c:350: und efined reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/gd/libgd/gdkanji.c:365: und efined reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/gd/libgd/gdkanji.c:381: und efined reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:603: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:626: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:660: undefine d reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_string': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:441: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:453: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:467: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:478: undefine d reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:851: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:879: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:993: undefine d reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:348: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:385: undefine d reference to `libiconv' ext/iconv/.libs/iconv.o: In function `_php_iconv_substr': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:723: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:747: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:802: undefine d reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:806: undefine d reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:755: undefine d reference to `libiconv_open' ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_decode': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1354: undefin ed reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1465: undefin ed reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1468: undefin ed reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1823: undefin ed reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:1826: undefin ed reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_dtor': /home
RE: [PHP] Re: Posting Summary for Week Ending 18 January, 2008: php-general@lists.php.net
-Original Message- From: David Powers [mailto:[EMAIL PROTECTED] Sent: Saturday, January 19, 2008 10:22 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: Posting Summary for Week Ending 18 January, 2008: php-general@lists.php.net Jochem Maas wrote: if I am correct you are or were a journalist. forgive if I have mistaken you for another, but if that is correct then how often have you trodden on someone's privacy for the sake of a story? Yes, I was a journalist for some 30 years, but roughly two-thirds of that time was spent in an editorial capacity, not on the road. I cannot honestly remember an occasion on which I infringed someone's privacy for the sake of a story. The privacy guidelines that applied to my job are publicly available online: http://www.bbc.co.uk/guidelines/editorialguidelines/edguide/privacy/con sent.shtml as Dan pointed out he's not actually in violation of anything That's Dan's interpretation. why not get over it and join the club instead of knocking it? All that was necessary was for Dan to acknowledge that he'd made a mistake publishing a list of everyone's email address in plain text. It was wholly unnecessary for the purpose of creating a chart of the most prolific posters. Counting the number of posts is pretty meaningless anyway. It says nothing about the usefulness of those posts. I rarely post here, not for any negative reasons, but because I can see there are plenty of knowledgeable people here giving a lot of valuable help to others. So I spend my time contributing to other forums where PHP expertise is thin on the ground. If treating someone's complaint with contempt, even if you don't agree with the substance of it, is the way this club works, it's not one that I feel comfortable joining. -- David Powers -- I have some thoughts, I just hope you (all) don't start hunting for me. But if you do, well, do it: 1 - I do believe the posting summary adds nothing to this list. But I don't care about it either. I think this is all about karma and as such, who has the biggest dick. We could argue for hours about this, and I know some of you will find the stats valuable (specially to show your boss how karmatic you are, or to show your boss how much time one of your partners spends instead of doing his job, lol). 2 - I don't have anything against my name and email being published in the stats (sure, I'd like support for the é character on my name :)). I don't care about spam either, we all get spam anyway, and that's why we have RBLs in our mail server and the MS Outlook junk folder. Moreover, if I was a spammer, I would also search for mailto: patterns like agrobinet+at+bestplace+dot+biz, so I think I'd get mangled email addresses anyway. 3 - I don't like the attitude of both Dan and David. IMHO, David thinks the issue is more severe than it is, and Dan just won't recognize that mangling email addresses is kind of a (arguably also) standard practice. No public apologize is needed, but maybe Yeah, I just didn't consider that would be enough. 4 - I have two phrases I like very much, one of them is one fault does not cover another and the other one is Hakuna Matata (yes, I saw the lion king baby! lol). Just one more thing, about... If treating someone's complaint with contempt, even if you don't agree with the substance of it, is the way this club works, it's not one that I feel comfortable joining. ... well, that's because you didn't taste the internals list yet, lol. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] password hashing and crypt()
to match). Now, let's change the scenario and let's say that instead of a table of 10 encrypted passwords you have a table of 10 encrypted passwords and 10 random SALT values that were used to generate them. According to that, you have the following equivalence: $encryptedPassword = md5($password.$salt); // Or similar This complicates things for the cracker, because: 1 - He must know how the salt was used to generate the password (was it concatenated before the password, after the password or both)? 2 - He has to generate 10 dictionary hashes (one for each salt value, assuming each salt value is different). So now the hashed dictionary has actually 1000 entries instead of 100. And he MUST recreate the hashed dictionary for each attack he wants to perpetrate to one of these tables (assumed he has sniffed in more than one place). 3 - Even if he finds two hashes are equal in the passwords table, he won't guess two passwords in one shot, because the SALT values for each password would be different. I remember I first came across to the SALT thing while doing an SMF integration (don't remember the SMF version, but I remember I had to do things manually that time, now SMF has an API of some sort I think). Ok, that's all folks. Now, I'll have a glass of water (or better yet, wine). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question About Blocking Email Addresses in Forms
-Original Message- From: Andrew Ballard [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 6:10 PM To: PHP General list Subject: Re: [PHP] Question About Blocking Email Addresses in Forms On Jan 18, 2008 10:18 AM, Richard Heyes [EMAIL PROTECTED] wrote: I am wondering if there is a way to block out email addresses in specific format from a form? We ahve a form that people have to enter an email address, and the form has been getting used by bots to send spam to a listserv. The email address they enter is in this type of format [EMAIL PROTECTED], and of course it is always just a bit different every time. Any help is greatly appreciated. Could add a CAPTCHA image (Type the letters in the image...) to your form. It eliminated comment junk when I added one to my website. Depending on what it is for, make sure if you use CAPTCHA that you provide an accessible alternative, as I'm sure NU would hate to run afoul of the ADA. Andrew It depends on your target, that's for sure. I made up a list of things you can do when you are this kind of trouble. It's a small summary. I think you can't live without 1 and 2 most of the time, and specially for contact forms (you are free to disagree): 1 - Simple CAPTCHA (audio support if it's difficult for people with visual disease - if you target them as well) 2 - Email validation REGEX (well, validation to all extents, not only email) 3 - Some/All of the hidden fields techniques (to prevent automated bots not launched directly to you, but scanning the whole web - which are usually the most powerful and nasty ones) 4 - PHP IP/Session blacklisting (for example, fail the captcha 3 times and you have to wait 10 seconds) 5 - Some mod_security rules for when 1 and/or 2 fail. I don't like mod_security (you have to be careful on the ruleset to keep your server load low and avoid breaking some apps like phpMyAdmin), but sometimes you may need it (specially if you deal with code not written by you). 6 - mod_throttle or similar when it starts becoming more of a DOS/DDOS attack (anybody sharing experience on this?). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Expand variable in comparison
-Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Marcus Sent: Friday, January 18, 2008 4:51 PM To: php-general@lists.php.net Subject: [PHP] Expand variable in comparison Hi! Is there any way to get the following snippet returning a true? ... $this-var = ? if ($this-var == $preDefinedStringToTestWith) return true; else false; The problem: I don't know, what $preDefinedStringToTestWith is! $this-var can be set to any string. I tried $this-var = ${preDefinedStringToTestWith} but this doesn't get expanded. Thanks for your help, Marcus. -- Uh! Shouldn't it work? $this-var = $preDefinedStringToTestWith Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Posting Summary for Week Ending 18 January, 2008: php-general@lists.php.net
Hey, your script doesn't like me, is it that you need quoted_printable_decode? =?iso-8859-1?Q?Andr=E9s_Robinet?= Rob -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 7:38 PM To: PostTrack [Dan Brown]; php-general@lists.php.net Subject: RE: [PHP] Posting Summary for Week Ending 18 January, 2008: php-general@lists.php.net Wow, I wasn't on the list. And I top posted. I really suck. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of PostTrack [Dan Brown] Sent: Friday, January 18, 2008 3:01 PM To: php-general@lists.php.net Subject: [PHP] Posting Summary for Week Ending 18 January, 2008: php-general@lists.php.net Posting Summary for PHP-General List Week Ending: Friday, 18 January, 2008 Messages| Bytes | Sender +-+-- 514 (100%) 975244 (100%) EVERYONE 69(13.4%) 92431(9.5%) Richard Lynch [EMAIL PROTECTED] 46(8.9%) 78933(8.1%) Jochem Maas [EMAIL PROTECTED] 29(5.6%) 48003(4.9%) Eric Butera [EMAIL PROTECTED] 28(5.4%) 40764(4.2%) Nathan Nobbe [EMAIL PROTECTED] 26(5.1%) 41149(4.2%) Daniel Brown [EMAIL PROTECTED] 24(4.7%) 15837(1.6%) Per Jessen [EMAIL PROTECTED] 19(3.7%) 40495(4.2%) Manuel Lemos [EMAIL PROTECTED] 17(3.3%) 21478(2.2%) Jim Lucas [EMAIL PROTECTED] 16(3.1%) 38021(3.9%) =?iso-8859-1?Q?Andr=E9s_Robinet?= [EMAIL PROTECTED] 14(2.7%) 10125(1%) Richard Heyes [EMAIL PROTECTED] 11(2.1%) 14946(1.5%) mike [EMAIL PROTECTED] 9(1.8%) 22245(2.3%) Wolf [EMAIL PROTECTED] 9(1.8%) 11964(1.2%) Europus [EMAIL PROTECTED] 7(1.4%) 9494(1%) Ken Kixmoeller -- reply to [EMAIL PROTECTED] [EMAIL PROTECTED] 7(1.4%) 5637(0.6%) Chris [EMAIL PROTECTED] 6(1.2%) 4881(0.5%) Naz Gassiep [EMAIL PROTECTED] 5(1%) 8497(0.9%) Andrew Ballard [EMAIL PROTECTED] 5(1%) 8705(0.9%) =?ISO-8859-1?Q?Zolt=E1n_N=E9meth?= [EMAIL PROTECTED] 5(1%) 4932(0.5%) Sancar Saran [EMAIL PROTECTED] 5(1%) 6174(0.6%) Colin Guthrie [EMAIL PROTECTED] 5(1%) 7854(0.8%) Wang Chen [EMAIL PROTECTED] 5(1%) 5875(0.6%) Javier Huerta [EMAIL PROTECTED] 4(0.8%) 6000(0.6%) Pastor Steve [EMAIL PROTECTED] 4(0.8%) 2214(0.2%) Lucas Prado Melo [EMAIL PROTECTED] 4(0.8%) 11675(1.2%) David Giragosian [EMAIL PROTECTED] 4(0.8%) 25354(2.6%) Apple [EMAIL PROTECTED] 4(0.8%) 3892(0.4%) clive [EMAIL PROTECTED] 4(0.8%) 5407(0.6%) Larry Garfield [EMAIL PROTECTED] 4(0.8%) 3479(0.4%) Carole E. Mah [EMAIL PROTECTED] 4(0.8%) 3104(0.3%) Adam Williams [EMAIL PROTECTED] 3(0.6%) 2552(0.3%) tedd [EMAIL PROTECTED] 3(0.6%) 5341(0.5%) Scott Wilcox [EMAIL PROTECTED] 3(0.6%) 3021(0.3%) Max Antonov [EMAIL PROTECTED] 3(0.6%) 4873(0.5%) Casey [EMAIL PROTECTED] 3(0.6%) 2819(0.3%) Tom Chubb [EMAIL PROTECTED] 3(0.6%) 3728(0.4%) mathieu leddet [EMAIL PROTECTED] 3(0.6%) 5052(0.5%) Sean-Michael [EMAIL PROTECTED] 3(0.6%) 3182(0.3%) A.smith [EMAIL PROTECTED] 3(0.6%) 3111(0.3%) Dotan Cohen [EMAIL PROTECTED] 3(0.6%) 4201(0.4%) Richard [EMAIL PROTECTED] 3(0.6%) 3449(0.4%) T.Lensselink [EMAIL PROTECTED] 3(0.6%) 4133(0.4%) julian [EMAIL PROTECTED] 2(0.4%) 2182(0.2%) Paul Scott [EMAIL PROTECTED] 2(0.4%) 2793(0.3%) Janet N [EMAIL PROTECTED] 2(0.4%) 11021(1.1%) Jason Pruim [EMAIL PROTECTED] 2(0.4%) 1818(0.2%) Pierre Pintaric [EMAIL PROTECTED] 2(0.4%) 2855(0.3%) Churchill, Craig [EMAIL PROTECTED] 2(0.4%) 201342(20.6%) Improve Your Life Style[EMAIL PROTECTED] 2(0.4%) 2542(0.3%) Bastien Koert [EMAIL PROTECTED] 2(0.4%) 1002(0.1%) Silvio Porcellana [EMAIL PROTECTED] 2(0.4%) 2947(0.3%) Danny Brow [EMAIL PROTECTED] 2(0.4%) 4571(0.5%) Steve Edberg [EMAIL PROTECTED] 2(0.4%) 3259
RE: [PHP] Foreach
-Original Message- From: Eric Butera [mailto:[EMAIL PROTECTED] Sent: Friday, January 18, 2008 11:21 PM To: mike Cc: PHP eMail List Subject: Re: [PHP] Foreach On Jan 18, 2008 5:06 PM, mike [EMAIL PROTECTED] wrote: On 1/18/08, Eric Butera [EMAIL PROTECTED] wrote: Nonetheless as I keep re-iterating, people will copy and paste this stuff as is because they don't know better. It is the responsibility of people writing the answers to make sure their code is validated and as secure as possible unless there is some glaringly obvious comment saying {get your data here} with a link to how to validate it properly. I agree. Everyone should be pushing for the best code possible here... Using session based form tokens is a better approach to make sure the post came from within your application. Except if your sessions timeout while the user is filling out the form. I have a forum and sometimes people spend a LOT of time composing messages (copy/pasting replies to reply to them, etc) and if it's session-based, their session may timeout (depending on how it's configured) before they hit submit, resulting in a total loss of data. Unless the application understands to restart a session, but then what's the point of the token... I have non-user-specific tokens issued every request (with an expiry of 24 hours) per form so it can only be submitted once. It's worked pretty well, but as with everything there are a couple ways around it, but it would take some work to do that. That is a good point to consider. On our servers we have the session timeout set to when the browser is closed so I forget sometimes people put actual time limits on them. -- Please, don't get me wrong, I'm just curious, how does the server know when the browser is closed? Do you use javascript (AJAX) or something to notify the server? As far as I remember, sessions are: 1 - A cookie (or a GET/POST parameter that gets passed by from page to page) 2 - A session file So when the user closes the browser and opens it up again, a new cookie will be generated by the server if it didn't get one in the request (and a new session file will be created as well), but that doesn't delete the old session file. I mean, isn't it supposed to be a garbage collection feature in any session implementation (that is what the session timeout is for, isn't it)? Or is it just that I'm missing something? Regards, Rob PS. Yes, I know you can have persistent cookies, and you can store session data in there. But the data length has a limit of some KB AFAIK, and you'd have to encrypt/decrypt sensitive information. Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Expand variable in comparison
-Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Marcus Sent: Friday, January 18, 2008 9:56 PM To: php-general@lists.php.net Subject: [PHP] Re: Expand variable in comparison Andrés Robinet wrote: -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Marcus Sent: Friday, January 18, 2008 4:51 PM To: php-general@lists.php.net Subject: [PHP] Expand variable in comparison Hi! Is there any way to get the following snippet returning a true? ... $this-var = ? if ($this-var == $preDefinedStringToTestWith) return true; else false; The problem: I don't know, what $preDefinedStringToTestWith is! $this-var can be set to any string. I tried $this-var = ${preDefinedStringToTestWith} but this doesn't get expanded. Uh! Shouldn't it work? $this-var = $preDefinedStringToTestWith For certain reason $this-var can only be set to a string and not to a variable! Any suggestions? I don't understand what you are trying to do, but maybe you are trying to achieve something like: ?php class Test { var $var = ''; function Test() { $this-var = theVariableName; // Hold variable name $theVariableName = whatever you want; if (${$this-var} == $theVariableName) echo ${$this-var}. is equal to .$theVariableName; else echo bad dog! stop it!; } } new Test(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Don't search for domains on Network Solutions...
-Original Message- From: Eric Butera [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 2:57 PM To: php php Subject: [PHP] Don't search for domains on Network Solutions... ... otherwise this will happen: erics:~/Sites eric$ /opt/php5/bin/php networksolutions.php Starting at 01/16/2008 12:36pm.Result: ...snip... Your Domain Name Search Results Congratulations! The following domains are available eric-butera-for-php-general Then a few minutes later: erics:~ eric$ whois eric-butera-for-php-general.com ...snip... Domain Name: ERIC-BUTERA-FOR-PHP-GENERAL.COM Registrar: NETWORK SOLUTIONS, LLC. Whois Server: whois.networksolutions.com Referral URL: http://www.networksolutions.com Name Server: NS1.RESERVEDDOMAINNAME.COM Name Server: NS2.RESERVEDDOMAINNAME.COM Status: clientHold Updated Date: 16-jan-2008 Creation Date: 16-jan-2008 Expiration Date: 16-jan-2009 networksolutions.php: ?php printf(Starting at %s., date('m/d/Y h:ia')); $url= 'http://www.networksolutions.com/domainSearch.do'; $values = array( 'domainNames' = 'eric-butera-for-php-general', 'method-submit.x' = '', 'method-submit.y' = '', 'Search' = '/domain-name-registration/domain-name-search-results.jsp', 'allowBulk' = 'false', 'currentPage' = '/home.jsp?layoutIdIndex=0', 'formTargetPage' = '/domain-name-registration/index.jsp' ); // semi-borrowed from Ojas Ojasvi php.net/curl because my vanilla post was rejected $header[] = Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/pla in;q=0.8,image/png,*/*;q=0.5; $header[] = Cache-Control: max-age=0; $header[] = Connection: keep-alive; $header[] = Keep-Alive: 300; $header[] = Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7; $header[] = Accept-Language: en-us,en;q=0.5; $header[] = Pragma: ; $c = curl_init(); curl_setopt($c, CURLOPT_HTTPHEADER, $header); curl_setopt($c, CURLOPT_REFERER, 'http://www.networksolutions.com'); curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $values); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); echo Result:\n; echo curl_exec($c); A couple of days ago I've come across this: http://www.seomoz.org/blog/network-solutions-exploits-icanns-fiveday-refund- rule-to-hoard-domains So... I don't even think that network solutions is the only one doing it. I know this is not strictly related to PHP, but I thought it would be a good idea to throw the warning. I think this is I-CANN's fault. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] QNX build
-Original Message- From: Richard [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 12:48 PM To: php-general@lists.php.net Subject: [PHP] QNX build Hi, After installing PHP on a Windows machine I see a very small PHP-executable and several extension dll's that can be loaded. When I build PHP on a QNX machine I get one huge executable of 8.6 MB. Is it possible to build something similar to the Windows version? Regards, Richard -- Hi Richard, I have no clue on the QNX OS or the QNX programming environment, but maybe you can move some PECL extensions out of the PHP core by compiling them as shared extensions instead of compiling them statically into PHP http://ar.php.net/manual/en/install.pecl.php. Regards, Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] green bean question on singleton php5
-Original Message- From: Julian [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 3:37 PM To: Daniel Brown Cc: julian; php-general@lists.php.net Subject: Re: [PHP] green bean question on singleton php5 but that forces me to implement a large interface of functions that I prefer to avoid... the $dummy thing works... but I guess it is not by the book. I would like to understand what am I missing fom the concept Thanks. JCG Daniel Brown wrote: On Jan 16, 2008 12:57 PM, julian [EMAIL PROTECTED] wrote: Hi, I am implementing this [snip!] I'm heading out to lunch, so double-check this for errors, but I rewrote your class. You'll have to add your fetch handlers and such. ? class dbaccess{ static $db = null; static $conn = null; static $query = null; static $othervar = 33; private function self(){ dbaccess::$conn = new mysqli(HOST,DBNAME,PASS,USERNAME); if(mysqli_connect_errno()){ return False; } else { return dbaccess::$conn; } } public function query($query){ dbaccess::$query = mysqli_query(dbaccess::self(),$query); return dbaccess::$query; } public static function GetDb(){ if(dbaccess::$db==null){ dbaccess::$db= new dbaccess(); } return dbaccess::$db; } } $db=dbaccess::GetDb(); $db-query(..); // Your query here. ? dbaccess has no query method as you are not inheriting from mysqli. So dbaccess::$db will have no query method either. I don't even think you need to construct objects of type dbaccess to make this work, after all, you have only static methods and properties which are attached to the type and not the instances. Also, dbaccess::$db should be mysqli::db instead. Check the previous suggestions about creating either an inherited class, or an accessor. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] green bean question on singleton php5
-Original Message- From: Julian [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 3:39 PM Cc: php-general@lists.php.net Subject: Re: [PHP] green bean question on singleton php5 nope... only works if I change $dummy= new dbaccess(); and keep the rest . Thanks. ... hope it does not repeat... got undelivered... Eric Butera wrote: On Jan 16, 2008 12:57 PM, julian [EMAIL PROTECTED] wrote: Hi, I am implementing this class dbaccess{ static $db=null; static $othervar=33; private function dbaccess(){ dbaccess::$db= new mysqli(localhost,USER,PASSWD,DB); if(mysqli_connect_errno()){ echo no way; } } public static function GetDb(){ if(dbaccess::$db==null){ dbaccess::$db= new dbaccess(); } return dbaccess::$db; } } $db=dbaccess::GetDE(); $db-query(..); will fail...with Call to undefined method dbaccess::query() apparently $db is of type dbaccess... and thus has not does not have query implemented any hhelp appreciated. JCG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Try changing dbaccess to self inside the class. Look at this: http://us.php.net/manual/en/language.oop5.patterns.php Example#2 Singleton Function Not the ideal solution, but this is what I meant: class dbaccess { private static $db = null; public static function GetDb() { if (!isset(self::$db)) { self::$db = new mysqli(localhost, USER, PASSWD, DB); if(mysqli_connect_errno()) { die(Very bad, you need to handle errors better); } } return self::$db; } } $db = dbaccess::GetDb(); $stmt = $db-query('SHOW DATABASES'); print_r($stmt); // Outputs mysqli_result Object ( ) Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Don't search for domains on Network Solutions...
-Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 5:06 PM To: Eric Butera Cc: Andrés Robinet; php php Subject: Re: [PHP] Don't search for domains on Network Solutions... On Jan 16, 2008 2:29 PM, Eric Butera [EMAIL PROTECTED] wrote: It obviously isn't related to PHP. I figured that most of us are in the business of making web applications for clients that are accessed through a domain at some point, so I sent it as a general warning to people. My company has recommended people to use it as a simple starting point of figuring out what domain name they think they might like. Of course we never use them for anything other than that, but I guess the joke is on us in the end, right? :) Eric, If you're using a *nix system, try this. I just whipped it up now, so it's not going to be perfect, but it will give accurate results, without risking any kind of domain hoarding (which is ridiculous, and companies should be fined for it, in my opinion): ? if(!isset($argv[1])) { die(Usage: .$argv[0]. domain.com\n); } $domain = $argv[1]; exec('`which dig` '.$domain,$ret,$err); if($err) { die(ERROR: .$err.\n); } for($i=0;$icount($ret);$i++) { if(preg_match('/status: (.*),/Ui',$ret[$i],$status)) { switch($status[1]) { case NXDOMAIN: echo Domain is not registered.\n; break; case NOERROR: echo Domain is registered.\n; break; default: echo Unknown status.\n; break; } } } ? -- /Dan Daniel P. Brown Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since Nineteen-Seventy-[mumble]. Maybe one of these classes will do the trick if you have exec disabled (like in most of the shared hosting enviroments), anybody tried them? http://www.phpclasses.org/searchtag/whois/by/package/tag/whois/ Regards, Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Encryption failing
-Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 12:55 AM To: Ken Kixmoeller -- reply to [EMAIL PROTECTED]; php- [EMAIL PROTECTED] Subject: RE: [PHP] Encryption failing are you base64 encoding the resultant encryption string? I have found that there are problems with certain characters that can result from the encryption, usually a combination of characters that approximate a null or end of line bastien From: [EMAIL PROTECTED] Date: Tue, 15 Jan 2008 21:41:45 - 0600 To: php-general@lists.php.net Subject: Re: [PHP] Encryption failing On Jan 15, 2008, at 7:06 PM, Casey wrote: Maybe you could echo the results of the failed ones and compare. I did that at first, thinking that something about these strings might cause the problem. But then I realized: I can't blame the data. I don't have any control over what users use for passwords, for example. this thing is supposed to en/decrypt the strings I gige it, so there must be some kind of programming flaw. FWIW, there was no discernible pattern to the failed strings, at least not to me. (Not that it matters.) Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I second that, you should base64 encode values before encrypting and base64 decode them after decrypting to be safe. Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: [QUESTION] MAIL: Send a NOOP instead of DATA
-Original Message- From: mike [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 1:11 AM To: Wang Chen Cc: php-general@lists.php.net Subject: Re: [PHP] Re: [QUESTION] MAIL: Send a NOOP instead of DATA Why not look at phpmailer? Probably more robust than some random classes. http://phpmailer.codeworxtech.com/ Not to bash on Manuel, but I find phpclasses to be littered with lots of crappy code and is too ad-laden and hard to use for me to bother. On 1/15/08, Wang Chen [EMAIL PROTECTED] wrote: Manuel Lemos said the following on 2008-1-16 11:55: Maybe you are accessing a SMTP server with a grey listing or anti-spam/anti-virus frontend that sits on the front of the actual SMTP server and only passes information to the backend server when it is ready. It is possible that your message is malformed and the frontend server is expecting something that you are not sending correctly. Meanwhile the frontend server sends NOOP commands to the backend server to keep the connection opened. But it's strange that php should send a DATA command out, but tcpdump didn't capture this packet. :( You may want to try this SMTP class that is known to work correctly according to the mail standards. See if you can send the message properly. If so, the theory above is likely to be the case. http://www.phpclasses.org/smtpclass If you need authentication, you also need this: http://www.phpclasses.org/sasl Thanks Manuel, I will try this. Well, guess where did PHPMailer come from? This is the original author of PHPMailer (and the original package was posted there) http://www.phpclasses.org/browse/package/264.html Though, yes, the project is outdated at phpclasses.org; but that's what the download newest versions and documentation link is for. Aesthetically, I don't like the phpclasses.org website. I agree that there's too much garbage to be filtered out (well... that's what opensource and freedom is all about, just pick the one you want, I think). But who didn't get his hands dirty on some of these classes for a quick start, or even used some of them AS-IS once in his entire life? So, I'm sorry, despite the ads when you login (which I just close - and they don't try to open up again as in other websites) I like the idea and the website from the functional perspective. And I use it, and will keep using it. I find it even better than PEAR's classes, which are a pain to install and a pain to use on a shared hosting environment (specially, when your client's hosting provider has decided he hates PEAR). Most of the time you just have to adapt, refactor and recode some bits to get a class working as you want... and you don't have to think of all the specific details of dealing with mail, ftp, rss, etc. Yes, blindly using the black box is wrong, but not meeting a delivery date because you still don't get RFC 45698725-1a23 is worst. Anyway, I'm not Manuel's lawyer, but saying phpclasses.org is crap, is like saying this list is crap (and you can find more reasons to argue on the second one). There's people sharing their expertise for free, I appreciate that. It just needs to get cleaned up a bit... but last time I checked, the rating system was working, so maybe we can use it (just FYI, I'm very guilty of not using it, ever) Regards, Rob P.S.: I don't have any implied or not implied relationship with Manuel (except my brother in law, which is Juan Manuel, and it is not Lemos, and lives in Argentina ten blocks ahead of my house) P.S.2: I recommend and use PHPMailer as well, but just because it works fine so far and I don't need anything else. Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Encryption failing
-Original Message- From: mike [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 1:49 AM To: Ken Kixmoeller -- reply to [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] Encryption failing if ($EorD == D) { $text_out = mdecrypt_generic($cypher,$text); $text = base64_decode($text); shouldn't this be base64_decode($text_out) ? :) } else { $text= base64_encode($text); $text_out = mcrypt_generic($cypher,$text); reverse these... make sure $text is setup right } // endif ($EorD == D) if you want to use this via cookies, GET, POST, etc. i would encrypt base64 encode to decrypt: string replace to + base64 decode then decrypt Hi Ken, Just my 3 cents: 1 - Mike is right about first encrypting and then doing a base64_encode (then saving results to DB, cookies, etc). I don't know why replacing to + for decrypting, though. 2 - Mike is also right about $text = base64_decode($text) which should be $text = base64_decode($text_out) I think. 3 - You are trimming the results on return, according to one post in the manual notes this will remove null padding on the decrypted string. This is desired, most of the time, but if the original (cleartext message) string ended in nulls you will get a difference and that may be the cause of the errors you are getting. if ($EorD == D) { // Get the original encrypted string $text = base64_decode($text); // Decrypt, you will get null padding $text = mdecrypt_generic($cypher, $text); // Restore the original text, you must keep the original text length stored somewhere $text_out = substr($text, 0, $text_length); } else { $text_length = strlen($text); // base64 encode encrypted string, to avoid headaches with strange characters in db, variables, etc $text_out = base64_encode(mcrypt_generic($cypher, $text)); } // Do not trim results if the clear text message ends with nulls I'll have to work on something similar very soon, so I might have my own headaches later. If you have success (or even more trouble) any feedback would be much appreciated. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] re[PHP] gister_globals
-Original Message- From: tbt [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 3:22 AM To: php-general@lists.php.net Subject: [PHP] re[PHP] gister_globals Hi, I'm a newbie to php and i would like to set register_globals to 'on' from my php script itself(eg:- index.php). Is there any way of doing this. Thanks -- View this message in context: http://www.nabble.com/register_globals- tp14868899p14868899.html Sent from the PHP - General mailing list archive at Nabble.com. If your web server is Apache you can create a file named .htaccess and place it in the document root. Then set up the PHP configuration like this: # This is just for commenting / you can comment out settings you don't want to apply # Switch on or off and configure as you desire php_flag short_open_tag on php_flag register_globals off php_flag magic_quotes_gpc off php_flag magic_quotes_runtime off php_flag magic_quotes_sybase off php_flag display_errors on php_value error_reporting 2039 php_value max_execution_time 300 If your system is not apache or it doesn't support .htaccess files, then you are doomed about register_globals, when your script is run, it is too late for enabling it (but you can deal with other .ini settings using http://php.net/ini_set) The most you can do for register_globals is using extract on $_GET, $_POST and $_COOKIE at the very top (I wouldn't even enable register_globals but...) http://php.net/manual/en/function.extract.php or using a loop to populate $_GLOBALS with the $_GET, $_POST and $_COOKIE keys/values. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_GET and multiple spaces.
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 2:11 PM To: Jochem Maas Cc: clive; Churchill, Craig; php-general@lists.php.net Subject: Re: [PHP] $_GET and multiple spaces. On Mon, January 14, 2008 3:17 am, Jochem Maas wrote: I think actually the whole url should be urlencoded as a matter of course, not 100% sure about this (and it's way to early on a monday to bother checking up ;-) ... maybe someone else can chime in? Actually, after you urlencode() the values, you should htmlentities the whole URL, as it is being passed to HTML as a value to be output to HTML. The whole URL should *NOT* be URL-encoded, however. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? Like this? $url = htmlspecialchars('whatever.php?'.urlencode($name).'='.urlencode($value)); Regards, Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_GET and multiple spaces.
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 7:08 PM To: Andrés Robinet Cc: php-general@lists.php.net Subject: RE: [PHP] $_GET and multiple spaces. On Mon, January 14, 2008 1:33 pm, Andrés Robinet wrote: -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 2:11 PM To: Jochem Maas Cc: clive; Churchill, Craig; php-general@lists.php.net Subject: Re: [PHP] $_GET and multiple spaces. On Mon, January 14, 2008 3:17 am, Jochem Maas wrote: I think actually the whole url should be urlencoded as a matter of course, not 100% sure about this (and it's way to early on a monday to bother checking up ;-) ... maybe someone else can chime in? Actually, after you urlencode() the values, you should htmlentities the whole URL, as it is being passed to HTML as a value to be output to HTML. The whole URL should *NOT* be URL-encoded, however. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? Like this? $url = htmlspecialchars('whatever.php?'.urlencode($name).'='.urlencode($value) ); Yes, but if your $name is weird enough to need to be urlencoded, you probably are doing something Wrong from a stylistic programming stand-point... I'm not even sure of the rules for what can be in a $name, come to think of it... I think I can tell you what... it has just came to my mind (nirvana moment)... how about this? $name = 'mylist[myindex]'; -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Freebsd 6.2 amd64 PHP 5.2.5 Internal Server Error
-Original Message- From: Anjan Upadhya [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 7:18 PM To: php-general@lists.php.net Subject: [PHP] Freebsd 6.2 amd64 PHP 5.2.5 Internal Server Error Hello, I have a freebsd 6.2 server running amd64 version with php 5.2.5. The web server is Apache 1.3.39. The following bit of code works on the 32 bit version of php running on Freebsd 6.2 (32 bit), Apache 1.3.39 build but causes a 500 internal server error when run on the amd64 bit version. The amd64 bit version has the web application mounted as a nfs mount. $file_name = MOUNT_DIR . /test.txt; if (!$write_handle = fopen($file_name, 'w')) { return false; } //set conforming strings to true $ins_fields_sql = SET standard_conforming_strings to TRUE;; fwrite($write_handle, $text_to_write . \n); THIS WRITE HAPPENS TO THE FILE foreach ($ar_orders as $key = $value) { ### INTERNAL SERVER ERROR } Has anyone come across this? Any insight would be greatly appreciated. -- Regards, Anjan Upadhya V.P. of Software Development [EMAIL PROTECTED] ph: 954.332.7875 == www.sproutloud.com SproutLoud Media Networks, LLC. This is weird, and it's a bit odd that the code is causing a #500 error after you have successfully written the file. I would do the following: 1 - Check the apache logs (the overall error_log, and the specific domain's error log). What do they say about the error? 2 - If you are using mod_rewrite, that could be the cause (it's a good source for # 500 errors, and you can enable rewrite.log for debugging, if that's the case) 3 - If you can test it with several browsers do it (IE has caused me trouble at least on my development box, it was kind of throwing a GET request twice, and one of the times without the last part of the URL path... weird). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_GET and multiple spaces.
-Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 8:34 PM To: Andrés Robinet Cc: php-general@lists.php.net Subject: Re: [PHP] $_GET and multiple spaces. Andrés Robinet schreef: -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 7:08 PM To: Andrés Robinet Cc: php-general@lists.php.net Subject: RE: [PHP] $_GET and multiple spaces. On Mon, January 14, 2008 1:33 pm, Andrés Robinet wrote: -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 2:11 PM To: Jochem Maas Cc: clive; Churchill, Craig; php-general@lists.php.net Subject: Re: [PHP] $_GET and multiple spaces. On Mon, January 14, 2008 3:17 am, Jochem Maas wrote: I think actually the whole url should be urlencoded as a matter of course, not 100% sure about this (and it's way to early on a monday to bother checking up ;-) ... maybe someone else can chime in? Actually, after you urlencode() the values, you should htmlentities the whole URL, as it is being passed to HTML as a value to be output to HTML. The whole URL should *NOT* be URL-encoded, however. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? Like this? $url = htmlspecialchars('whatever.php?'.urlencode($name).'='.urlencode($value) ); Yes, but if your $name is weird enough to need to be urlencoded, you probably are doing something Wrong from a stylistic programming stand-point... I'm not even sure of the rules for what can be in a $name, come to think of it... I think I can tell you what... it has just came to my mind (nirvana moment)... how about this? $name = 'mylist[myindex]'; this is almost an invite to moan about how http_build_query() was 'fixed' in 5.1.3 to escape square brackets ... which makes php nolonger do one of the coolest, imho, with regard to incoming GET/POST values - namely auto-convert bracketed request var names into native arrays. at least if those strings are used in anything other than a URL context (form inputs anyone). I would have been nice to have the encoding as an optional switch/argument. Well, almost... the other part of the world that arguably wanted square brackets escaped in http_build_query will be very pleased (let me tell you I don't use http_build_query, but have my own as sometimes PHP 5 is not an option...). I guess they thought http_build_query would always be used in an URL context. But yes... escaping square brackets could be made optional and we get the best of both worlds. Anyway... my point was that names may need escaping, at least in some contexts. But let me ask you because maybe I'm wrong: a href=index.php?list%5Bindex%5D=valueClick/a Wouldn't this be translating into $_GET['list']['index'] == 'value'? As far as I've tested, it is... Also, it seems that [ and ] are unsafe characters according to http://www.ietf.org/rfc/rfc1738.txt Unsafe: Characters can be unsafe for a number of reasons. The space character is unsafe because significant spaces may disappear and insignificant spaces may be introduced when URLs are transcribed or typeset or subjected to the treatment of word-processing programs. The characters and are unsafe because they are used as the delimiters around URLs in free text; the quote mark () is used to delimit URLs in some systems. The character # is unsafe and should always be encoded because it is used in World Wide Web and in other systems to delimit a URL from a fragment/anchor identifier that might follow it. The character % is unsafe because it is used for encodings of other characters. Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters. These characters are {, }, |, \, ^, ~, [, ], and `. All unsafe characters must always be encoded within a URL Maybe that's why they chose to escape square brackets. I'm not a standards freak, but rather a pragmatic man. Just trying to prove a point. /* since php5.1.3 http_build_query() urlencodes square brackets - this does not please us at all, * this function fixes the problem the encoding causes us when using http_build_query() output * in hidden INPUT field names. */ function inputPostQueryUnBorker($s) { // first version - slower? more code! /* return preg_replace('#(\?|(?:amp;)?)([^=]*)=#eU', '\\1'.str_replace(array('%5B','%5D'), array('[',']'), '\\2').'=', $s); //*/ // second version - faster? more compact! (should work identically to the above statement. return preg_replace('#%5[bd](?=[^]*=)#ei', 'urldecode(\\0
RE: [PHP] PHP SOAP Client formats
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 7:21 PM To: Tim Traver Cc: Bastien Koert; PHP General List Subject: Re: [PHP] PHP SOAP Client formats On Wed, January 9, 2008 9:45 pm, Tim Traver wrote: Thank you for answering, but the issue is that the PHP SOAPClient classes actually create that xml to send, so I have no control over the xml that is sent with a call command to the SOAP object... I just wondered if there was any flags that I am missing that might bring the php stuff in line with what the server expects. If there are any such flags, they'd be documented in the manual. If there aren't, perhaps you can find another SOAP constructor tool in PHP. I know there have been at least 3 or 4 popular ones over the years. And while the built-in one in PHP 5 is by far the best/easiest to use generally, you might be better off using nuSoap or somesuch even if it's a PITA, because it might construct the kind of SOAP envelope the other server is expecting. I would definitely recommend abstracting it as much as possible, though, so you can upgrade easily to a better SOAP implementation if the other end changes their software. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? The only problem I had with nuSOAP was a name clash with the PHP 5 native extension. But they fixed it in November (there was a previous non-official fix also.. but can't remember the link right now). nuSOAP has been around for several years and it's working for PHP 4 or PHP 5. So far it's doing the job pretty well (what's more, for a SOAP API, chances are that nuSOAP is included along with the code samples). Though I didn't run any benchmarks, its speed is more than enough for my taste, when caching the WSDL object (in fact, most of the time will be spent in the server to server roundtrip). So... my vote for nuSOAP. However, if you are using the native extension and have specific needs for the XML request, you can override the __doRequest() method http://php.net/manual/en/function.soap-soapclient-dorequest.php (there's an example in the manual notes). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Guestbook
-Original Message- From: Børge Holen [mailto:[EMAIL PROTECTED] Sent: Sunday, January 13, 2008 7:48 AM To: php-general@lists.php.net Subject: Re: [PHP] Guestbook On Sunday 13 January 2008 01:32:53 Andrés Robinet wrote: Hi Guys, Anybody knows of a free and decent PHP Multilanguage guestbook (or at least supporting German and English)? I don't care if it is db-driven or uses flat files. I know how to write one, but it's for a website we didn't develop (but will now host) and I'm feeling a bit lazy... maybe someone has a hint. I don't care of how it looks, I can customize that, just want to write as less code as possible and avoid any security headaches as well (yeah... the good old lazy days :)). jup feeling lazy alright. Good thing google works Good... that will be my answer next time I don't have anything to say on a thread. And yeah... you can search for Free PHP whatever and you'll get some Ad-Oriented websites if you know what I mean... sometimes Google just sucks. And sometimes Yes, once I used which is reliable, simple and supports German... is not that hard to answer. If for every issue you come across you have to use Google alone, then get rid of the list... there were so many jerky questions that got answered here... Anyway, I'll just have to write my own and save it on our library, there's a German speaking woman in the company which will give me a hand. I personally hate guestbooks, but I prefer to have some reusable piece of our own, than to have to deal with some dirty code for which I don't have a recommendation. Pity, it is the first time I ask something to the list, I expected just a bit more (like a couple of names to research). Well... seems that I'll change my policy a bit next time someone needs a hand. Rob Thanks in advance, Rob ndrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo- diy.com -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Guestbook
Hi Guys, Anybody knows of a free and decent PHP Multilanguage guestbook (or at least supporting German and English)? I don't care if it is db-driven or uses flat files. I know how to write one, but it's for a website we didn't develop (but will now host) and I'm feeling a bit lazy... maybe someone has a hint. I don't care of how it looks, I can customize that, just want to write as less code as possible and avoid any security headaches as well (yeah... the good old lazy days :)). Thanks in advance, Rob ndrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP shell commands
Hi Lucas, This is it http://www.suphp.org/Home.html. However, please bear in mind that you may have some headaches after installing it. Some webmail scripts may break, as well as existing websites, so you'd better off researching what are the possible drawbacks. My recommendation would be that if you work with a panel (Plesk, cPanel, DirectAdmin, etc) you go to the panel's forums, because chances are high that someone has already built a script to do the job for you, and you'll also get answers to your questions before you run into trouble. Also, I think there was a way of installing both PHP 4 and 5, one as CGI (required by suPHP) and the other one as CLI so you could get the regular PHP behaviour by setting up the corresponding VirtualHost. For owr own domains we use PHP CLI only, as we control the code from top to bottom, but for shared hosting, suPHP is recommended despite of the headaches (mostly to your customers' poor PHP code, but in the end to your support department)... though many hosting providers, just don't care and run the risk (suPHP is not very old anyway). Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lucas Prado Melo Sent: Saturday, January 12, 2008 8:50 AM To: Andrés Robinet Cc: php-general@lists.php.net Subject: Re: [PHP] PHP shell commands On Jan 12, 2008 4:12 AM, Andrés Robinet [EMAIL PROTECTED] wrote: I guess what you are looking for is mod_suphp. STFW or ask the list, someone will give you good hints for sure (sorry, have little time right now). Rob Thanks, I will take a look. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP shell commands
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lucas Prado Melo Sent: Friday, January 11, 2008 8:50 PM To: Jim Lucas Cc: php-general@lists.php.net Subject: Re: [PHP] PHP shell commands On Jan 11, 2008 9:28 PM, Jim Lucas [EMAIL PROTECTED] wrote: What feature would you think about adding to it? I think we should be able to set (editing httpd.conf in apache) which folders are visible to any php script (including shell commands written in it). So, we could use Directory tags and set different rules to different sets of files. What do you think about it? I guess what you are looking for is mod_suphp. STFW or ask the list, someone will give you good hints for sure (sorry, have little time right now). Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: HTML form upload works, CURL fails when uploading file from c:
-Original Message- From: John Gunther [mailto:[EMAIL PROTECTED] Sent: Saturday, January 05, 2008 8:57 PM To: php-general@lists.php.net Subject: [PHP] Re: HTML form upload works, CURL fails when uploading file from c: Well, dope slap I think I understand the problem now: CURL is operating from the server so it knows nothing about C: on the client! So how do I solve my problem? I want to upload multiple files from C: to the server based on a single wildcard spec typed into an HTML form by the user. John Gunther wrote: PHP 5.2.1 on Apache/Linux. Client is Firefox and IE7 on Windows XP. Uploading C:\boot.ini works great from an HTML type=file form element but fails using what should be the equivalent: curl_setopt($ch,CURLOPT_POSTFIELDS,array('peru'='@C:/boot.ini')); CURL error is failed creating formpost data. Same CURL works when the test file resides on the PHP server: curl_setopt($ch,CURLOPT_POSTFIELDS,array('peru'='@/home/user/boot.ini' )); so problem seems to be in the '@C:/boot.ini' filespec. Substituting '@C:\boot.ini' or '@C:\\boot.ini' doesn't help. What am I doing wrong? You can't solve this issue with HTML+javascript+PHP alone. You will need plugin support (a Java applet, an ActiveX control, Flash). Google for swfupload, though there are similar projects, it seems to be one of the easiest solutions as it only requires you to know javascript (no guarantees anyway). Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] control browser with a href tag
-Original Message- From: Hiep Nguyen [mailto:[EMAIL PROTECTED] Sent: Thursday, December 27, 2007 11:51 AM To: php-general@lists.php.net Subject: Re: [PHP] control browser with a href tag Warren Vail [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] i have two pages: list.php and update.php list.php will have a hyper link that when click on, it will open a new window for user to update info. once user clicks update button on update.php page, i want to close update.php and return to list.php. however if user doesn't click update button, i don't want user to go back to list.php. in other word, freeze up list.php until user closes or clicks update button on update.php. is this possible to do with php? Yes and no, don't think you intend to, but you may be mixing technologies. You refer to hyperlinks, etc, which is web technologies and windows, which is not unless you use javascript or ajax. With PHP you can cause your browser to open a new browser by adding target=_blank to the hyperlink, but you cannot easily disable functionality of the old browser (It's still open, just usually covered up by the new browser), and if the user clicks your hyperlink again a 3rd browser will be opened. You could name your target (target=mypage) which means if the user clicks it a new browser will be opened, and if the user clicks the same link again, a 3rd window will not be opened, but the page in the mypage target will be refreshed. HTH, Warren Vail after read all your replies, i understand and want to redefine the problem. if user clicks on the hyperlink on list.php page, i want to open a new windows for user to update info. once user clicks update on update.php page, i want to close the update.php page automatically and refresh list.php page. i think this is possible. can someone give me suggestions how to do this? thanks Yes, you will need something like this http://www.wildbit.com/labs/modalbox/ or a regular javascript popup (window.open). Modalbox is based on prototype and scriptaculous, but there are other lightweight solutions over there too (someone mentioned jQuery and Thickbox I think, and there's also a Mootools version called MOOdalbox or something). This is something you need to program on the client-side (at least most of it), so it's not about PHP. Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sayonara PHP
and MySQL 3.23 (there are still some of those archaic hosting packages over there I dont need to tell you). So, I just had to get used to this new OOP of PHP 4 (which is almost no OOP at all). All in all, my fellow countryman, I guess that unless you have a huge positive bank account balance, and you drive a BMW (I dont like them anyway ) youd better off tolerating PHP for this little namespace issue if you want to stay in business. Unless, of course, that you have an incoming contract to develop a core system for an NSA mainframe. And if thats the case please tell them I prepare the most awesome mate (http://en.wikipedia.org/wiki/Mate_(beverage)) in the world, and that you cannot work without it. I know that, even if you wish to leave PHP forever, youll come back all the roads will lead you to it. So, youd better take a smart decision now than have no other choice in the future (... ok, that was kind of The Godfathers script, lol). Enjoy your holidays, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com From: Martin Alterisio [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 26, 2007 2:04 AM To: PHP Developers Mailing List; PHP General Subject: [PHP] Sayonara PHP Please let me do a little explanation of the title first. Japanese is an interesting language where context is vital to the meaning of a word. Sayonara usually means a simple good bye, but within a different context can mean we'll probably never meet again. To understand this mail you'll have to know that I was just another user of PHP, an user that was probably too eager. I wanted to get more involved with the development of PHP as I do believe in all the philosophy of open- source. In the end I found my attempts ended in frustration, but, nevertheless, I learned a lot in just a few months. I don't want this mail to be one where I get to display all my frustration, instead I want to leave here all my findings, the things I researched, the few things I managed to actually code, and mostly the ideas that someone else might find useful. To those who may want to involve in the php internals For those in the generals list that may ever try to venture in the internals of PHP, remember that you have to back your point of view with a patch. So, sit down, remember the old days in college using the c compiler, and code like a cowboy before trying to promote anything in the internals. It's the status quo of the PHP development community, as I did learn too late. Namespaces: function imports Here is the patch to add function imports to 5.3. To be consistent constants imports have to be added too: http://martinalterisio.com.ar/php5.3/use.function.v2b.patch If you don't know what imports are, they are just a way to refer to a longer name with a shorter name. For example: ?php class MyRowset extends Zend::Db::Table::Rowset::Abstract { ... or with imports: ?php use Zend::Db::Table::Rowset::Abstract as Rowset; class MyRowset extends Rowset { ... The use statement behavior currently supports only class names aliasing. Functions and constants have to referred with full name, although these too can be namespaced. Import statement is broken, why, how can be fixed While doing the previous patch I realized that the use statement is broken. It should generate and error when you try to override an existing name. But the use statement is handled at compile, where it's unknown if a name will be overridden or not. What happens is that the error might be triggered depending on the conditions and order of compilation. If you have an opcode cache, this error may not appear until the cache is invalidated. On a suggestion by Dmitry, which I really don't know if he knew about this issue with use or not, but, anyway, his idea solved this issue, I made this patch: http://martinalterisio.com.ar/php5.3/file.scope.use.patch With this the use statement is checked only against the names used in the current file (or namespace if using multiple namespaces per file). Since the imports only affect the current file, this is more sensible, and the issue mentioned before disappears. Name clash and ambiguity issue introduced by namespaces There's another pending issue with namespaces, there's a name clash that currently goes undetected, and makes static methods partially unavailable. This is due to the fact that using :: as namespace separator generates ambiguity. foo::bar() can refer to the static method bar in class foo, or to the function bar in the namespace foo. This is an issue to php library developers. Someone can inject a namespaced function
RE: [PHP] Connecting to MySQL database
For a quick installation, try this http://www.apachefriends.org/en/xampp.html (XAMPP for windows). You will also have mercury mail and FileZilla FTP Server (watchout your firewall and change the passwords... you're warned). Your PHP.INI will be at xamp-dir/apache/php.ini, but for the most part, you won't need to modify it. Rob -Original Message- From: Balaji A [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 26, 2007 1:19 AM To: php-general@lists.php.net Subject: [PHP] Connecting to MySQL database Hi, I have installed following things on windows machine. 1. Apache HTTP Server 2.2.4 2. PHP 5.2.3 3. MySQL 5.0.45 I am getting mysql_connect() not found. I have downloaded libmysql.dll, php_mysql.dll php_mysqli.dll and copied to c:\php\ext. I have uncommented these dll files in php.ini and still getting the same issue. I am not able to see mysql table in phpinfo(), and seeing only mysqli. Could anybody help me on this issue? Not able to resolve this from past 3 days. Any help/suggestions appreciated. Thanks Balaji -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Writing text into images, and setting text size [SOLVED]
Hi Dave, Thanks for the compliment! :) About TTF support in shared hosting... every decent hosting option should support it. Though it is kind of an optional feature, it is as common as GD itself (at least 9 out of 10 CAPTCHA scripts will rely on it). So if TTF support is not installed, the hosting provider should install it. How they should install it is up to them, and varies from system to system. In other words, if TTF support is not installed and your hosting provider is not willing to install it (or wants to charge you for that), either they don't have a clue, or they want to take advantage of your needs... in both cases the service sucks. We use CentOS boxes with DirectAdmin, and installing GD with TTF support is part of the standard setup. You cannot rely on ImageMagick, or the PHP ImageMagick extension being installed, though some hosting companies support it. But GD with TTF, Freetype, JPG and PNG support is pretty standard, like mbstring, cURL, or the sockets extension. Best Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -Original Message- From: Dave M G [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 19, 2007 7:49 AM To: Andrés Robinet Cc: 'PHP List' Subject: Re: [PHP] Writing text into images, and setting text size [SOLVED] Rob, Thank you for helping me through this. '--enable-gd-native-ttf' '--with-ttf' This was the key information. I thought that having the GD modules installed meant I had TTF support. But after I saw that, I realized that TTF support was a separate module within the GD library. On my home Ubuntu environment, placing TTF support simply meant installing the right package from the repository (which I found in Synaptic by searching for PHP TTF). I'm hoping that TTF support is reasonably common on web hosting services, since I'm aspiring for my code to be portable. In any case, you've helped me get to the point that I needed to get to, so I am very grateful for your support. Thanks. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Writing text into images, and setting text size
Hi Dave, Take a look http://www.bestplace.biz/unittest/ttf/PrintImage.php ... and replace PrintImage.php with info.php in the URL to get the phpinfo. See the CONFIGURE COMMAND line for the phpinfo (at the very beginning): '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-png-dir=/usr/local/lib' You might need to change /usr/local/lib according to your system configuration (this is a CentOS 4 box with DirectAdmin as the hosting control panel) and recompile PHP. However, before you run into an unnecessary mess... 1 - Add this line to the very beginning of the script and remove the code that outputs the image (all the header stuff and the imagepng($im) sentence): error_reporting(E_ALL); I guess you have already don that but just in case... If there's an error you should see it with E_ALL 2 - If you find out that the problem is definitely PHP, you'd better off using the provided upgrade methods of your hosting control panel, or a standard or custom script provided at the hosting control panel's website. That will make your life easier (For DirectAdmin, there's custombuild, for others... I don't know)... otherwise, you'll have to edit the configure script, and run ./configure, make and make install as usual (and troubleshoot as usual). Hope you get it working, :) Rob -Original Message- From: Dave M G [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 18, 2007 7:06 AM To: Andrés Robinet Cc: 'PHP List' Subject: Re: [PHP] Writing text into images, and setting text size Rob, Thank you for responding. Try the following: ... you load PrintImage.php into your browser and you'll get a nice gray rectangle with the word Works! in the center of it. If you don't get that... then you have a problem that is not related to path or to PHP per-se... Wow... thank you so much for providing that code to help me test my environment. I ran your script - with the corrections you provided - and did not get the text that says Works!. I've checked with various fonts, and checked that they worked in OpenOffice and other apps, so I don't think fonts are the problem. As for GD support, phpinfo() it says: GD Supportenabled GD Version2.0 or higher FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.1.9 T1Lib Support enabled GIF Read Support enabled GIF Create Supportenabled JPG Support enabled PNG Support enabled WBMP Support enabled GetText Support enabled Am I missing a necessary module? Hope this helps It helps very much. Thank you. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] control browser with a href tag
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 18, 2007 11:57 PM To: Hiep Nguyen Cc: php-general@lists.php.net Subject: Re: [PHP] control browser with a href tag On Tue, December 18, 2007 12:23 pm, Hiep Nguyen wrote: hi friends, i have two pages: list.php and update.php list.php will have a hyper link that when click on, it will open a new window for user to update info. once user clicks update button on update.php page, i want to close update.php and return to list.php. however if user doesn't click update button, i don't want user to go back to list.php. in other word, freeze up list.php until user closes or clicks update button on update.php. is this possible to do with php? It's not even possible with a browser and HTTP, whether PHP is in the picture or not... You're describing a desktop application behaviour. Stop doing that; You'll just make yourself and your users miserable. Write a web application. It's different. Don't popup a new window unless you absolutely have to. If I want a new window, I'll use right-click and do it myself. Don't try to freeze up the list (you can't anyway) cuz I might want to look at other things in the list to decide how to correctly update the original anyway. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- I agree on the point that you should not try to achieve the behavior with PHP alone, for the rest of it... I disagree. Why do users have to rethink application behavior? Sure, the web environment is different, there is a clear barrier between client and server... but what do end users have to do with all of that? Moreover, why we, developers, have to rethink UI and application design when we switch from desktop to the web? I think we shouldn't... it's only the legacy stuff we had to tolerate year after year, once the web became a massive thing. But now things are evolving, do things like Web 2.0, Ajax, Adobe Air, Mono, Silverlight, and the .Net Framework sound familiar to you (yes, the last two are created by the crappy M$ that we all know)? Because as far as I can see, an effort is been made everywhere to shorten the desktop-web distance. Why is CSS, XML and JavaScript so popular these days? We hated them some years ago, didn't we? They help to shorten the distance now, don't they? Yes, browsers are a mess to deal with, but they are not as much of a mess as they where some time ago, and we have some good abstraction layers such as PrototypeJS, JQuery and Mootools; and... at least we have now IE 7, which is a big step forward for M$ (despite being buggy as EVERY BROWSER IS), and Firefox and Opera... or are you going to tell me you still use HTML 3, PHP 3, MySQL 2 and put This site looks better in Firefox, Get Firefox Now! buttons in your websites? Have you tried ExtJS or the Yahoo UI?... Why is everyone using this geeky stuff?. I believe we should take the desktop-web distance as a temporary fact that can be fixed to some extent, and keep that in mind... but THAT'S ALL. We must also be prepared for evolution, listen to the trends, and try a bit with the new kids on the block...because evolution will happen, and we'll either be in or out of the standard... because the standard will change. All the above sh_t said to Richard (just an opinion, hope you don't take it wrong), this last paragraph is for the original user. I would search in a JavaScript forum for a way to mask the existing contents, open a DHTML window on top with a form in it, validate the form (maybe Ajax, maybe only JavaScript, it depends on what you need to validate) and then if it passes the test remove the mask and return to the old contents. Otherwise, for a straightforward solution, that makes use of this mask thing give a try to the form components in ExtJS (if you feel like you can handle JavaScript very well... of course). If you don't find your way... then you are not ready and you'd probably better off by creating two pages, so you make the user move from one to the other and back again... so unless the user fills in the correct data, you don't display the original form again, but the data input form every time. A last resort, may involve using a regular pop-up window, but the only way to make it truly modal is in IE for the PC (I think). Happy coding (and read more, so you'll ask better questions ;)) Rob P.S. You'll see no links in this email... but you can use google to find the resources -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Writing text into images, and setting text size
-Original Message- From: Dave M G [mailto:[EMAIL PROTECTED] Sent: Monday, December 17, 2007 6:47 AM To: Casey Cc: PHP List Subject: Re: [PHP] Writing text into images, and setting text size Casey, Thank you for replying. Try imagettftext(). I did, as explained: $font = '/usr/share/fonts/truetype/freefonts/FreeSans.ttf'; $imagettftext($image, 20, 0, $x, $y-10, $textColour, $font, $text); So my questions remain: 1. 'FreeSans.ttf' is in my /usr/share/fonts/truetype/freefonts directory. But specifying it doesn't seem to work. How do I get the system to find the font? I wouldn't. First, I don't know of any standard fonts for linux, though there might be (As you have Arial or Times New Roman for windows). Second, It might be a safe_mode / open_base_dir issue, or a problem in GD or the freetype libraries if the path is right and the font exist. I would try something like dirname(__FILE__).'/fonts/Arial.ttf'... of course that would mean you need to create a fonts directory and copy Arial.ttf from your system to that location (violating the copywrite? ;) )... anyway, you can check that with any other font. 2. I need the scripts I'm writing to be portable, so can I be sure of what fonts will be available, and will I be able to locate them? Deploy the fonts along with your scripts... that's the only way I know. 3. I'm not really concerned about what font it is, just that it's large and readable. If there are other options than what I've explored here, then I would be open to those too. You can get some free fonts, and deploy them along with every project. I do so for a custom CAPTCHA script I've made. Thank you for any advice. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Writing text into images, and setting text size
I'm tempted to say that the problem is that the system is not finding the font... you'd need to include the full path to the font (and it must be readable for the user PHP runs on behalf). Try the following: Just for testing put the font and the script that generates the image in the SAME directory, so let's say you have something like this: arial.ttf (-- I just copied it from my windows fonts folder) PrintImage.php BOTH IN THE SAME DIRECTORY... Then, the code for PrintImage.php would look like the following... ?php // /* Begin PrintImage.php */ // dirname(__FILE__) means the full path to the directory where this file PrintImage.php is sitting $fontFile = dirname(__FILE__).'/arial.ttf'; $imW = 200; $imH = 100; $im = imagecreatetruecolor($imgW, $imgH); $bgColor = imagecolorallocate($im, 238, 239, 239); $borderColor = imagecolorallocate($im, 208, 208, 208); $textColor = imagecolorallocate($im, 46, 60, 31); $whiteColor = imagecolorallocate($im, 255, 255, 255); $fontSize = 18; $textAngle = 0; $codeString = 'Works!'; // Print rectangle imagefilledrectangle($im, 0, 0, $imgW, $imgH, $bgColor); imagerectangle($im, 0, 0, $imW-1, $imH-1, $borderColor); // Print Text (Calculate Position) $box = imagettfbbox($fontSize, $fontAngle, $fontFile, $codeString); $x = (int)($imgW - $box[4]) / 2; $y = (int)($imgH - $box[5]) / 2; imagettftext($im, $fontSize, $fontAngle, $x, $y, $textColor, $fontFile, $codeString); // Output... no caching header(Content-type: image/png); header(Cache-Control: no-cache, must-revalidate); header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); imagepng($im); /* End PrintImage.php */ /**/ ? Then you know what you do... you load PrintImage.php into your browser and you'll get a nice gray rectangle with the word Works! in the center of it. If you don't get that... then you have a problem that is not related to path or to PHP per-se... maybe it's a GD issue, or the font is broken... or whatever other issue... but this code works in windows and linux provided that you get the arial.ttf in the same directory as PrintImage.php. And... use dirname(__FILE__) or similar (meaning ABSOLUTE PATHS), as much as possible to reference other files for inclusion or processing... doing ./myfile.php or ../myfile.php leads to headaches... and usually in the moment you can't take a headache (which is project deadlines). Hope this helps, Rob -Original Message- From: Dave M G [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 18, 2007 12:31 AM To: Andrés Robinet Cc: 'PHP List' Subject: Re: [PHP] Writing text into images, and setting text size Andrés, Thank you for responding. Deploy the fonts along with your scripts... that's the only way I know. ... I do so for a custom CAPTCHA script I've made. This sounds like a good solution. I'm having a little trouble implementing it, however. I have what I believe is a freely distributable font called FreeSans.ttf, and I put it in a directory called fonts in the base directory of my site. However, this seems not to work: $font = 'fonts/FreeSans.ttf'; imagettftext($image, 20, 0, $x, $y, $textColour, $font, $text); Putting a slash in front to specify starting from the base directory - '/fonts/FreeSans.ttf' - does not seem to work either. Looking in the manual, it seemed that maybe I needed to set the font path with putenv: $path = realpath('fonts'); putenv('GDFONTPATH=' . $path); But this yielded no results. Am I still getting the syntax wrong somehow? Thank you for any advice. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Writing text into images, and setting text size
Just a correction... Replace at the beginning of the script (I had some typos, while extracting the code from the original script) $imW = 200; $imH = 100; By this.. $imgW = 200; $imgH = 100; Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 18, 2007 1:33 AM To: 'Dave M G' Cc: 'PHP List' Subject: RE: [PHP] Writing text into images, and setting text size I'm tempted to say that the problem is that the system is not finding the font... you'd need to include the full path to the font (and it must be readable for the user PHP runs on behalf). Try the following: Just for testing put the font and the script that generates the image in the SAME directory, so let's say you have something like this: arial.ttf (-- I just copied it from my windows fonts folder) PrintImage.php BOTH IN THE SAME DIRECTORY... Then, the code for PrintImage.php would look like the following... ?php // /* Begin PrintImage.php */ // dirname(__FILE__) means the full path to the directory where this file PrintImage.php is sitting $fontFile = dirname(__FILE__).'/arial.ttf'; $imW = 200; $imH = 100; $im = imagecreatetruecolor($imgW, $imgH); $bgColor = imagecolorallocate($im, 238, 239, 239); $borderColor = imagecolorallocate($im, 208, 208, 208); $textColor = imagecolorallocate($im, 46, 60, 31); $whiteColor = imagecolorallocate($im, 255, 255, 255); $fontSize = 18; $textAngle = 0; $codeString = 'Works!'; // Print rectangle imagefilledrectangle($im, 0, 0, $imgW, $imgH, $bgColor); imagerectangle($im, 0, 0, $imW-1, $imH-1, $borderColor); // Print Text (Calculate Position) $box = imagettfbbox($fontSize, $fontAngle, $fontFile, $codeString); $x = (int)($imgW - $box[4]) / 2; $y = (int)($imgH - $box[5]) / 2; imagettftext($im, $fontSize, $fontAngle, $x, $y, $textColor, $fontFile, $codeString); // Output... no caching header(Content-type: image/png); header(Cache-Control: no-cache, must-revalidate); header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); imagepng($im); /* End PrintImage.php */ /**/ ? Then you know what you do... you load PrintImage.php into your browser and you'll get a nice gray rectangle with the word Works! in the center of it. If you don't get that... then you have a problem that is not related to path or to PHP per-se... maybe it's a GD issue, or the font is broken... or whatever other issue... but this code works in windows and linux provided that you get the arial.ttf in the same directory as PrintImage.php. And... use dirname(__FILE__) or similar (meaning ABSOLUTE PATHS), as much as possible to reference other files for inclusion or processing... doing ./myfile.php or ../myfile.php leads to headaches... and usually in the moment you can't take a headache (which is project deadlines). Hope this helps, Rob -Original Message- From: Dave M G [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 18, 2007 12:31 AM To: Andrés Robinet Cc: 'PHP List' Subject: Re: [PHP] Writing text into images, and setting text size Andrés, Thank you for responding. Deploy the fonts along with your scripts... that's the only way I know. ... I do so for a custom CAPTCHA script I've made. This sounds like a good solution. I'm having a little trouble implementing it, however. I have what I believe is a freely distributable font called FreeSans.ttf, and I put it in a directory called fonts in the base directory of my site. However, this seems not to work: $font = 'fonts/FreeSans.ttf'; imagettftext($image, 20, 0, $x, $y, $textColour, $font, $text); Putting a slash in front to specify starting from the base directory - '/fonts/FreeSans.ttf' - does not seem to work either. Looking in the manual, it seemed that maybe I needed to set the font path with putenv: $path = realpath('fonts'); putenv('GDFONTPATH=' . $path); But this yielded no results. Am I still getting the syntax wrong somehow? Thank you for any advice. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FW: ezmlm warning
I've just got this message... I also see no updates here http://news.php.net/php.general/ since Friday. Any clues on what's going on?? Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, December 15, 2007 11:55 AM To: [EMAIL PROTECTED] Subject: ezmlm warning Hi! This is the ezmlm program. I'm managing the php-general@lists.php.net mailing list. I'm working for my owner, who can be reached at [EMAIL PROTECTED] Messages to you from the php-general mailing list seem to have been bouncing. I've attached a copy of the first bounce message I received. If this message bounces too, I will send you a probe. If the probe bounces, I will remove your address from the php-general mailing list, without further notice. I've kept a list of which messages from the php-general mailing list have bounced from your address. Copies of these messages may be in the archive. To retrieve a set of messages 123-145 (a maximum of 100 per request), send an empty message to: [EMAIL PROTECTED] To receive a subject and author list for the last 100 or so messages, send an empty message to: [EMAIL PROTECTED] Here are the message numbers: 265427 265424 265428 265425 265429 265426 265421 265430 265431 265432 265422 265420 265423 265433 265436 265443 265442 265440 265441 265444 265447 265445 265446 265438 265435 265437 265439 265434 265448 265449 --- Enclosed is a copy of the bounce message I received. Return-Path: Received: (qmail 51006 invoked by uid 1010); 3 Dec 2007 20:22:32 - Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: (qmail 50986 invoked from network); 3 Dec 2007 20:22:32 - Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Dec 2007 20:22:32 - Return-Path: Received: from [127.0.0.1] ([local]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with INTERNAL id 34/55-25012-88564574 for ; Mon, 03 Dec 2007 15:22:32 -0500 From: Mail Delivery System [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Mail Delivery Failure Message-Id: E2/[EMAIL PROTECTED] Date: Mon, 03 Dec 2007 15:22:32 -0500 This message was created automatically by the mail system (ecelerity). A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: [EMAIL PROTECTED] (after RCPT TO): 550 Unknown User -- This is a copy of the headers of the original message. -- Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Received: from [216.92.131.4] ([216.92.131.4:8304] helo=lists.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/55-25012-78564574 for [EMAIL PROTECTED]; Mon, 03 Dec 2007 15:22:31 -0500 Received: (qmail 50743 invoked by uid 1010); 3 Dec 2007 20:22:22 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Received: (qmail 50734 invoked by uid 1010); 3 Dec 2007 20:22:22 - Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Authentication-Results: pb1.pair.com [EMAIL PROTECTED]; sender-id=unknown Authentication-Results: pb1.pair.com [EMAIL PROTECTED]; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pocket.com from 64.129.48.252 cause and error) X-PHP-List-Original-Sender: [EMAIL PROTECTED] X-Host-Fingerprint: 64.129.48.252 mail.pocket.com Windows 2000 SP4, XP SP1 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Mon, 3 Dec 2007 14:22:16 -0600 Message-ID: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP] Banned from #php Thread-Index: Acg16F9UQeyFwd5sQO6iyRiMqco8PQAAb81g From: Jay Blanchard [EMAIL PROTECTED] To: Brenden Wilson [EMAIL PROTECTED], php-general@lists.php.net Subject: RE: [PHP] Banned from #php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [SOLVED] [PHP] FW: ezmlm warning
I know what's the issue now. The mailing list software was sending me a notification about some bounces, dated Dec 4th (which I didn't notice at first). That's ok since we had an issue with Exim and we stopped it some time for maintenance. I thought it was a recent issue, because I got this message today. Since yesterday we've enabled RBL checking in Exim I thought it was that, but then I went to the online version of the list and I noticed there were no posts for today, so the list could also be the problem. Now I know it's neither of them, it's just a delayed warning. Thank you all, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, December 15, 2007 7:04 PM To: Andrés Robinet Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php- [EMAIL PROTECTED] Subject: Re: [PHP] FW: ezmlm warning On Dec 15, 2007 12:10 PM, Andrés Robinet [EMAIL PROTECTED] wrote: I've just got this message... I also see no updates here http://news.php.net/php.general/ since Friday. Any clues on what's going on?? Looks to me like there was some reason that the emails being sent to you were bouncing, Rob. As for the news page, I just sent a help response a few moments ago and that's already archived at the bottom of the page, so that seems to be working fine. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] safe_mode_include_dir
-Original Message- From: Tony Beyers [mailto:[EMAIL PROTECTED] Sent: Thursday, December 13, 2007 4:56 PM To: PHP General list Subject: Re: [PHP] safe_mode_include_dir No luck with these solutions. What does work is: require_once(dirname(__FILE__) . '/../php/support.php'); but I still don't understand why the relative link doesn't work. On Dec 12, 2007 6:38 PM, Andrés Robinet [EMAIL PROTECTED] wrote: -Original Message- From: Tony Beyers [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 5:55 PM To: PHP General list Subject: Re: [PHP] safe_mode_include_dir Sorry about the double posting. I thought I sent the first email before I was subscribed. I definitely should've pointed out that the code works with safe_mode off so I know the paths are correct. I'm actually not the author of the code. I'm a sys admin trying to upgrade the site with safe_mode on. The target directory is a real world readable directory. On Dec 12, 2007 3:43 PM, Daniel Brown [EMAIL PROTECTED] wrote: Tony, Calm down. It may take us 21 minutes to respond sometimes, but we will. No need to repost. ;-P On Dec 12, 2007 3:26 PM, Tony Beyers [EMAIL PROTECTED] wrote: I'm running php 5.2.5 with these settings in a virtualhost block in apache 2.0.61: php_admin_flag safe_mode on php_admin_value include_path /afs/msu.edu/.../web php_admin_value safe_mode_include_dir /afs/msu.edu/.../web I've got an index.php file in web/support/ that does a require_once(../includes/support.php); Is there a specific reason you're using require_once() instead of include_once() ? There actually is a difference include() and include_once() will only include the file if that line of code is executed, whereas require() and require_once() will include the file even if the line is inside of an if() {} block for which the condition(s) are never matched. Being in afs with write access from multiple people, the uids of the files do not match and I get an error stating that. So I put the safe_mode_include_dir line above in but it did not fix the problem until I used the absolute path in the require_once line. Is there a way to include files with relative paths? Of course there is. For example, say you're in a laterally- equal directory as one from which you want to include a file. ? include('../otherdir/file.php'); ? As long as you have permissions to read the files, you're good to go. My guess is that you may have done the relative linking improperly. Is the file actually `web/includes/support.php` called from `web/index.php`? The other thing I would suggest is making sure your target include directory is a real directory and not a symlinked directory. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Tony, Please keep in mind that the use of php_admin_value include_path /afs/msu.edu/.../web ...will prevent a user from changing the include_path because of the admin part (this is ok for the safe mode include dir, but not for the include_path setting I think). So, I'd say you keep the safe_mode_include_dir, and change the include path to: php_value include_path /afs/msu.edu/.../web Also, it is likely that while using relative paths you run into problems because the current directory can be anything except the expected one, so I'd rather use absolute paths (if it's my own code) or fix it using .htaccess files (this is your case as you are a sysadmin) like this: php_value include_path /one/path;/another/path;./ ... but for that to work you must not use php_admin_value in the virtualhost config (notice that this is not related to safe mode security, if safe_mode is well configured, it doesn't mind what you are using as include_dir). If anyone has more ideas... please throw them (and fix my errors). Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo- diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Tony
RE: [PHP] safe_mode_include_dir
-Original Message- From: Tony Beyers [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 5:55 PM To: PHP General list Subject: Re: [PHP] safe_mode_include_dir Sorry about the double posting. I thought I sent the first email before I was subscribed. I definitely should've pointed out that the code works with safe_mode off so I know the paths are correct. I'm actually not the author of the code. I'm a sys admin trying to upgrade the site with safe_mode on. The target directory is a real world readable directory. On Dec 12, 2007 3:43 PM, Daniel Brown [EMAIL PROTECTED] wrote: Tony, Calm down. It may take us 21 minutes to respond sometimes, but we will. No need to repost. ;-P On Dec 12, 2007 3:26 PM, Tony Beyers [EMAIL PROTECTED] wrote: I'm running php 5.2.5 with these settings in a virtualhost block in apache 2.0.61: php_admin_flag safe_mode on php_admin_value include_path /afs/msu.edu/.../web php_admin_value safe_mode_include_dir /afs/msu.edu/.../web I've got an index.php file in web/support/ that does a require_once(../includes/support.php); Is there a specific reason you're using require_once() instead of include_once() ? There actually is a difference include() and include_once() will only include the file if that line of code is executed, whereas require() and require_once() will include the file even if the line is inside of an if() {} block for which the condition(s) are never matched. Being in afs with write access from multiple people, the uids of the files do not match and I get an error stating that. So I put the safe_mode_include_dir line above in but it did not fix the problem until I used the absolute path in the require_once line. Is there a way to include files with relative paths? Of course there is. For example, say you're in a laterally-equal directory as one from which you want to include a file. ? include('../otherdir/file.php'); ? As long as you have permissions to read the files, you're good to go. My guess is that you may have done the relative linking improperly. Is the file actually `web/includes/support.php` called from `web/index.php`? The other thing I would suggest is making sure your target include directory is a real directory and not a symlinked directory. -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Tony, Please keep in mind that the use of php_admin_value include_path /afs/msu.edu/.../web ...will prevent a user from changing the include_path because of the admin part (this is ok for the safe mode include dir, but not for the include_path setting I think). So, I'd say you keep the safe_mode_include_dir, and change the include path to: php_value include_path /afs/msu.edu/.../web Also, it is likely that while using relative paths you run into problems because the current directory can be anything except the expected one, so I'd rather use absolute paths (if it's my own code) or fix it using .htaccess files (this is your case as you are a sysadmin) like this: php_value include_path /one/path;/another/path;./ ... but for that to work you must not use php_admin_value in the virtualhost config (notice that this is not related to safe mode security, if safe_mode is well configured, it doesn't mind what you are using as include_dir). If anyone has more ideas... please throw them (and fix my errors). Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Generating Random Numbers with Normal Distribution
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 6:35 PM To: PHP General list Subject: RE: [PHP] Generating Random Numbers with Normal Distribution At 3:42 PM -0500 12/12/07, Robert Cummings wrote: Yes, but what if my disorder was random? How could you prove it is random? Give me an example of something you can put into disorder that doesn't use the premise of order? For instance throwing a handful of sand into the air is expected to obey the establish laws of physics. These laws of physics suggest order in the universe even when we perceive disorder. Cheers, Rob. Yes, but now we're getting back to artificial rules of the mind. We perceive the laws of physics to work a certain way because we have established rules as to how they should work. But, what happens when they don't work? Then we change the rules. We are now at string theory and things still remain disordered. All our efforts to put order to things still fall short. Also, when we do change our rules, nature hasn't changed. Nature hasn't suddenly changed to our view, but rather we change our thinking to adapt to observation. And it's in those terms of observation that order and disorder of things comes about and not in nature. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Ok... I guess you have too much free time to run into such a philosophical meditation, lol. Anyway, being an existentialist and empiricist... I won't believe in a random number until I see it, smell it, hear it, taste it and touch it here and now! lol Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to install ISAPI version on Vista IIS 6
-Original Message- From: SED [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 12:25 AM To: php-general@lists.php.net Subject: [PHP] How to install ISAPI version on Vista IIS 6 Hello, I'm running Vista Ultimate on my computer with IIS 6.0. I'm trying to manually install PHP 5 (ISAPI) on IIS but in the Handler mappings I get this message: One or more of the modules specified for this handler does not exist in the modules list. If you are trying to add a script map the IsapiModule or the CgiModule is not prensent in the modules list. I have Googled this but did not find any answers. Even on php.net there is no mention on Vista. Can you point me to guidance for installing PHP 5 on Vista running IIS 6.0? Regards, SED Hope you don't get offended but... check http://www.apple.com/getamac/ads/ (the last one choose a vista is very instructive). I've never had a Mac, but I've laughed a lot... and I'm every day thinking more and more certain of not upgrading my XP. Hope you smile at least for 30 seconds. :) Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to install ISAPI version on Vista IIS 6
I think I found a solution for you... or at least a step closer. One correction though, you are likely running IIS 7.0 and not IIS 6.0, right? Check this out http://www.phpbuilder.com/board/showthread.php?t=10344435highlight=php+5.2. 3 It seems that the default installation of windows IIS 7.0 for Vista does not include the CGI and ISAPI modules. You need to include at least the one you'll be using for PHP, I guess ISAPI but I've read about some problems with extensions, so... give it a try, it's a pity I don't have a Vista box to try it and tell you. Anyway... hope you manage to get it installed, and when you do... POST IT BACK, there will surely be other people willing to know about it in this list. Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -Original Message- From: SED [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 1:44 AM To: 'Andrés Robinet' Cc: php-general@lists.php.net Subject: RE: [PHP] How to install ISAPI version on Vista IIS 6 Hi Rob, I'm not offended, I'm pistoff with Microsoft. Paying so much for VISTA and so many troubles and so litle support... I have other computers running various others systems but I need to solve this case. Your comment, only makes me smile, over how stupid I was to pay for Vista. Regards, SED -Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: 12. desember 2007 04:08 To: php-general@lists.php.net Subject: RE: [PHP] How to install ISAPI version on Vista IIS 6 -Original Message- From: SED [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 12:25 AM To: php-general@lists.php.net Subject: [PHP] How to install ISAPI version on Vista IIS 6 Hello, I'm running Vista Ultimate on my computer with IIS 6.0. I'm trying to manually install PHP 5 (ISAPI) on IIS but in the Handler mappings I get this message: One or more of the modules specified for this handler does not exist in the modules list. If you are trying to add a script map the IsapiModule or the CgiModule is not prensent in the modules list. I have Googled this but did not find any answers. Even on php.net there is no mention on Vista. Can you point me to guidance for installing PHP 5 on Vista running IIS 6.0? Regards, SED Hope you don't get offended but... check http://www.apple.com/getamac/ads/ (the last one choose a vista is very instructive). I've never had a Mac, but I've laughed a lot... and I'm every day thinking more and more certain of not upgrading my XP. Hope you smile at least for 30 seconds. :) Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo- diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mysqli support - test or complain?
-Original Message- From: Per Jessen [mailto:[EMAIL PROTECTED] Dave M G wrote: One is based on the assumption that mysqli is as likely not to be available as it is to be installed. In this case I should write my scripts to test whether it exists and then use either mysqli or straight mysql commands as appropriate. If this is the way to go, what do I do to test for the existence of mysqli from within a PHP script? In my opinion, that is overkill. If you need mysqli and a provider does not provide it, simply chose another provider. A lot less effort. The other is to assume that recent installs and upgrades of PHP 5 should have mysqli because that's the currently preferred way of doing things, and therefore I should contact the web host and ask that they install it, or I find a different host. Which assumption should I be proceeding with? Find a provider/hoster that meets your requirements. You're the customer. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yes but what about development clients that have their hosting accounts elsewhere?... you cannot push them to change from hosting provider. I would rephrase Dave's questions like this: 1 - What is the chance your clients have PHP 5 nowadays? 2 - What is the change that a PHP 5 hosting provider has mysqli installed? Multiply both and you get the chance of getting mysqli installed when a new development client arrives asking for a development quote... If you are a company, you can provide the PHP 5 hosting yourself, and have a PHP 5 Required rule in the TOS for development projects. But if you are a freelancer... you risk loosing the client with such a requirement. Despite the EOL for PHP 4 has been announced, I still see webhosts bundled with PHP 4.1 and MySQL 3.23. Anyway... it depends on your target, and the real need for mysqli. Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include config.php does not work anymore after PHP 5.2
-Original Message- From: wmac [mailto:[EMAIL PROTECTED] Sent: Sunday, December 02, 2007 6:35 AM To: php-general@lists.php.net Subject: Re: [PHP] include config.php does not work anymore after PHP 5.2 Thank you People. Someone mentioned the problem. It is the starting PHP tag. I never never thought my config.php might have problem. I have used this config.php for almost 6 years and never had problem (the first time I have forgotten to add it 6 years ago because I had migrated from ASP. I have copied this wrong config.php to some other projects. Throughout the years I have upgraded PHP and Apache (on windows and Linux) and I have never had this problem. It's strange that how PHP has never had problem with it and finally now it has found the problem! I am now doing J2EE for 3 years and this bug caught me finally. (I think I need to update a few delivered projects before they come up with the problem) Thank you again. Mac -- View this message in context: http://www.nabble.com/include- %22config.php%22-does-not-work-anymore-after-PHP-5.2- tf4930800.html#a14113764 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Mac, You don't need to sacrifice your coding practices if your apache installation allows .htaccess files. Try the following in an .htaccess file: php_flag short_open_tag on That will allow you to have ? as the starting tag for PHP code and will allow for ?=$myvar? instead of ?php echo $myvar ? Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP/AJAX File DragDrop
You can also use the FileReference ActionScript class in flash. This will not allow you to drop a file and get it uploaded (will it?) but it supports multiple file selection. There are some implementations in javascript that make use of this flash feature to upload multiple files interactively (search for SWFUpload in google, but there are others as well). But surely enough... if you require such a thing as drag and drop for files your best bet is a Java Applet. Rob -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: Friday, November 30, 2007 9:40 PM To: php-general@lists.php.net Subject: [PHP] Re: PHP/AJAX File DragDrop Unfortunatly javascript can't access the filesystem so it can't get filenames. The closest way you could do something like this would be to use Java (not javascript, totally different). It's a permissions thing, just the way JS and everything else is designed. - Dan Andrei Verovski (aka MacGuru) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi ! Anyone knows PHP/AJAX library which allows to get full path of file dropped into web browser's window area? It is required for document archiving system in order to avoid multiple (or to be more precise, almost endless) usage of open file dialogs from the browser. Library should be compatible with Firefox (Lin, Win, Mac), IE and Safary. Thanks in advance for any suggestion(s). Andrei -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php