Re: [PHP] whoami explanation
PJ wrote: Per Jessen wrote: PJ wrote: forgot to add: What's the difference between back ticks or quotes and regular single quotes? text in back ticks is executed via a shell, text in single quotes isn't. Ok, but how does this relate to a command passed from a php Web page? I don't understand the processus. I use bash on my FreeBSD and have not needed a back quote yet that I can recall... and on WinXP? In your bash shell, you can use backticks in a similar way to how PHP uses them - to assign the output of a command to a variable. For example: LIST=`find . -name '*.php'` will fill up the shell variable $LIST with all the files with extension .php below the current directory. You could then do something with that variable, like for FILE in $LIST do cp $FILE $FILE.bak done to make a backup copy of each of the files. In PHP, something like ?php $list = `find . -name '*.php'`; foreach (explode(' ',$list) as $file) { copy ($file,{$file}.bak); } ? should do much the same thing (if permissions etc. allow...) Note that in both of these examples, filenames with spaces in them will blow the whole thing up :( -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Conclusion of use strict...
Concluding, and one idea...I think I received satisfying advices on everything but first question (Detection of typos and other simple mistakes). And we were talking also about being able to catch them at compile time, then if php at all has compile time etc. Today one thing crossed my mind -- if there is compiler for php maybe it can catch these errors natively, like java compiler for java? Unfortunatelly there is no recent version available for windows so I can't test it myself (http://www.roadsend.com/home/index.php?pageID=compiler). I am interesting if someone is using it, and if it can detect this simple mistakes (I am using eclipse + php plugin, but I feel there is something wrong in depending on editor to detect programming errors :-) ) Regards to all, --- On Thu, 2/26/09, Ovidiu Rosoiu ovidiu.ros...@gmail.com wrote: From: Ovidiu Rosoiu ovidiu.ros...@gmail.com Subject: Re: [PHP] use strict or similar in PHP? To: Hans Schultz h.schult...@yahoo.com Cc: php-general@lists.php.net Date: Thursday, February 26, 2009, 9:14 PM Hans Schultz wrote: Hello, I am beginner with PHP and prior to PHP I have worked with java for some time and with perl for very short period. I can't help to notice some things that are little annoyance for me with PHP, but I am sure someone more experienced can help me :-) Is there in PHP something like use strict from perl? I find it pretty annoying to need to run script over and over again just to find out that I made typo in variable name. Is there some way for PHP to cache some data on the page? I like very much PHP's speed but it would be even better to be able to cache some frequently used data from database? Also regarding databases, I liked a lot java's way of sending data to database using parameters (select * from user where username = ? and then passing parameter separately with database doing necessary escaping and everything). Is there something like PHPDBC similar to JDBC?
Re: [PHP] ruby / rails within a php site
Would this work? $contents = file_get_contents(' http://localhost/path_to_ruby_installation/rubyfile'); then print out the contents wherever you want to? or something similar, basically, we get the html output of the ruby file over http, since this will run your ruby/rails installation the way it expects to be run... Thoughts? Luke. On Wed, Mar 4, 2009 at 9:02 AM, dg dane...@bluerodeo.com wrote: If it's html that Ruby generates, you could probably call that file as an include? Something like... $ruby = file_get_contents('rubyfile.html'); then where ever in the document you want that content use: ?php print $ruby; ?- Show quoted text - On Mar 3, 2009, at 9:56 PM, ravi Ruddarraju wrote: I have a regular php site. I also have a ruby / rails application. Now I want to put the HTML generated by ruby / rails application within a div section of a php page. This should be similar to like calling a php function within a div section, which would produce the HTML output of the php function. Is such a thing possible between php and ruby / rails? Any help will be appreciated. Thanks ravi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DEV] How expensive are function_exists() calls?
..not an internals question me thinks ... redirecting to generals mailing list mike schreef: I am trying to figure out a strategy for multiple output formats on a site, and it seems like I can have functions defined by default, but have them defined -after- I've included the targetted format first. However that would require file1.php: function foo() {} file2.php if(!function_exists('foo')) { function foo() {} } Is this a very expensive thing to do? There would be a good number of functions that would be leveraging this. Is it a no-no? or is it pretty cheap? it busts opcode caches. so I wouldn't recommend it at all, don't do conditional includes or function/class definitions if you can help it. idea: use some kind of registry pattern to register outputters, the the code requiring an outputter can request it from the register. 1. I would think about using a class for each outputter (instead of a function) ... chances are you will have need for more than just 'foo' 2. register all the default outputters 3. register some optional, overriding outputters dependent on the context. ?php abstract class OutputRegistry { private $objs; static function register($key, $obj) { self::$objs[$key] = $obj; } static function get($key) { return self::$objs[$key]; } } // default OutputRegistry::register('renderer', new HTMLRenderer); // overriding (in some other file) to allow creating JSON output OutputRegistry::register('renderer', new JSONRenderer); Thanks - mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about template systems
On Tue, 2009-03-03 at 21:18 -0600, Shawn McKenzie wrote: Matthew Croud wrote: Hello, First post here, I'm in the process of learning PHP , I'm digesting a few books as we speak. I'm working on a content heavy website that provides a lot of information, a template system would be great and so i've been looking at ways to create dynamic data with a static navigation system. So far, using the require_once(); function seems to fit the bill in order to bring in the same header html file on each page. I've also looked at Smartys template system. I wondered how you folk would go about creating a template system ? My second question might be me jumping the gun here, I haven't come across this part in my book but i'll ask about it anyway. I often see websites that have a dynamic body and static header, and their web addresses end like this: index.php?id=445 where 445 i presume is some my file reference. What is this called ? It seems like the system i'm after but it doesn't appear in my book, If anyone could let me know what this page id subject is called i can do some research on the subject. Thanks for any help you can provide :) Matt. I have written a popular theme/template system for some CMS systems. In my opinion, templating is only needed for those that are totally ignorant of the concept of programming languages in general. I'm not sure... but I'm pretty sur eyou just called me ignorant. Blanket statements like that one above are themselves ignorant. 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
Re: [PHP] Strange charecters
On Wed, Mar 4, 2009 at 2:10 AM, Paul Scott psc...@uwc.ac.za wrote: On Wed, 2009-03-04 at 10:09 +0530, Chetan Rane wrote: I am using ob_start() in my application. However I am getting this error about headers already sent. _Any_ output will set that error off. Check for Notices, Warnings, echo's, prints and var_dumps in your code. -- Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php check for a blank space above the ?php of your files -- Bastien Cat, the other other white meat
Re: [PHP] whoami explanation
Peter Ford wrote: PJ wrote: Per Jessen wrote: PJ wrote: forgot to add: What's the difference between back ticks or quotes and regular single quotes? text in back ticks is executed via a shell, text in single quotes isn't. Ok, but how does this relate to a command passed from a php Web page? I don't understand the processus. I use bash on my FreeBSD and have not needed a back quote yet that I can recall... and on WinXP? In your bash shell, you can use backticks in a similar way to how PHP uses them - to assign the output of a command to a variable. For example: LIST=`find . -name '*.php'` will fill up the shell variable $LIST with all the files with extension .php below the current directory. You could then do something with that variable, like for FILE in $LIST do cp $FILE $FILE.bak done which works as long as you can guarantee that none your file names contain spaces ... ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: compiling php with libjpg64
google is your friend (and with friends like that who needs enemies): try what's mentioned here: http://www.linuxquestions.org/questions/linux-software-2/compiling-php-on-rhel-5-64-bit-685606/ otherwise: http://www.google.com/search?q=compile+php+64+bit+libs Merlin Morgenstern schreef: Hi everybody, I have to compile from source for several reasons. Any idea on how to fix this particular problem with the lib64? Regards, merlin Shawn McKenzie schrieb: Ashley Sheridan wrote: On Fri, 2009-02-27 at 12:43 -0600, Shawn McKenzie wrote: Merlin Morgenstern wrote: Hi there, I am trying to get a 64 bit suse 10.3 system to run with php 5. Somehow it does not recognize the libjpg which is definatelly in place: server:/home/sw/php-5.2.9 # './configure' '--enable-fastcgi' '--with-mysql=/usr/local/mysql' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-mbstring' '--with-pdo-mysql=/usr/local/mysql/' '--enable-soap' '--with-zlib-dir=/usr/lib64' '--with-freetype-dir=/usr/lib64' '--with-gd' '--with-jpeg-dir=/usr/lib64' '--with-png-dir=/usr/lib64' '--enable-exif' '--with-pdflib=/usr/local' configure.txt configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 (found: none). configure: warning: flex versions supported for regeneration of the Zend/PHP parsers: 2.5.4 (found: 2.5.33) configure: warning: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. configure: error: libjpeg.(a|so) not found. but: # locate libjpeg.so /usr/lib64/libjpeg.so /usr/lib64/libjpeg.so.62 /usr/lib64/libjpeg.so.62.0.0 # locate libjpeg.a /usr/lib64/libjpeg.a I am kind of lost with this one. I can not find the error. Has somebody an idea how to fix this? Thank you for any help, Merlin Might try adding: --with-libdir=lib64 -- Thanks! -Shawn http://www.spidean.com I've got Suse10.3 on my laptop, all 64-bit, and running the correct graphics libraries which I use for GD. I used Yast to install the whole thing, as it sorts out everything for me. For Suse, I'd recommend it, as it really is a great admin tool, albeit a little slow when building repository lists when you install things! Ash www.ashleysheridan.co.uk Yes, I always use a package from whatever distro (ubuntu for my desktop for several years and fedora on my web host). I've never needed to compile apache/php/mysql or most anything else. Sometimes there's something that I want that you can only get from source, but normally that builds easily for me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_FILES empty, trouble with uploading
Hello people. I have some trouble with an upload script. It was working until the last 2 weeks. Whenever I tried to upload a file to a remote server, the $_FILES array is empty. I print global at start of the script there's nothing. Here's the form form action=http://random.server.com/video/upload.php; method=post enctype=multipart/form-data input type=hidden name=sessid value=yada input type=hidden name=ugroup value=xfr input type=hidden name=memberid value=25798 input type=hidden name=referrer value=server.com labelTitle:/labelinput type=text name=video_title value=N/A size=20 maxlenght=30 labelDescription:/labelinput type=text name=video_desc value=N/A size=20 maxlenght=255 labelCategory:/label select name=video_category option value=1yada/option option value=5yada2/option /select input type=hidden name=MAX_FILE_SIZE value=209715200 / input name=vid_files type=file size=30 /br / input type=submit name=upload class=sbtn value=Go! / /form So it's a basic form, I do have the enctype. the print_r($GLOBALS) return me [_FILES] = Array ( ) PHP Version 5.2.6file_uploads is On post_max_size 200M upload_max_filesize 200M upload_tmp_dir no value (it use /tmp) the /tmp folder is writable by apache (chmod 777) with 197G of space left. So, obviously, I'm lost as why I can't upload file anymore. Anyone had a similar problem ? What could I do to find/fix the problem ? Is it even related to PHP ? Thanks, Karl _ Share photos with friends on Windows Live Messenger http://go.microsoft.com/?linkid=9650734
RE: [PHP] whoami explanation
-Original Message- From: PJ [mailto:af.gour...@videotron.ca] Sent: Tuesday, March 03, 2009 5:56 PM To: Boyd, Todd M. Cc: php-general@lists.php.net Subject: Re: [PHP] whoami explanation Boyd, Todd M. wrote: -Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Tuesday, March 03, 2009 2:07 PM To: PJ Cc: Daniel Brown; Per Jessen; php-general@lists.php.net Subject: Re: [PHP] whoami explanation On Tue, 2009-03-03 at 11:16 -0500, PJ wrote: Daniel Brown wrote: On Tue, Mar 3, 2009 at 10:57, PJ af.gour...@videotron.ca wrote: forgot to add: What's the difference between back ticks or quotes and regular single quotes? How does one enter back quotes from the keyboard? Welcome to the Internet! The first place you should look when you have a question is on Google. The first result that comes up for backtick operator is the PHP manual itself: http://php.net/language.operators.execution If you don't know where a key is on your keyboard, please look down. I don't think it's necessary to be sarcastic... Hate to disappoint you, but on my computer (FreeBSD 7.0) on Firefox Google does not go directly to the php manual... it goes to some nitwit site thinkexist.com So, this list is a much better source of information that waddling through the crap that's thrown at you on G. And I find that Googie is getting pretty garbagy even if there is nothing better around ;-) As for the keyboard, this is the first time I have ever, ever needed the back quote key although I have occasionally needed the ~ key for Windows stuff. -- Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com You tinker on Unix and you only ever use ~ for Windows?! I realize this thread is old and dead and buried, but I have to get my licks in on the new guy, too... but Ash beat me to it. I was going to talk about how ~ was an alias for the current user context's home directory in any POSIX system I've ever used. :) Welcome aboard, PJ. Gee, thanks. So, when was I supposed to have used this alias? Hell, I can live with my ignorance. What's a POSIX system and why is it a POSIX - a language, I think I heard But I'm sorry I missed the fun earlier about the American foibles... unfortunately that should go on some other list and I wish I knew which one - one that had some smarts to it (like this one) and I'd like to really hear what people think about us and what's really going on in the world... oooh, well http://lmgtfy.com/?q=posix ;) // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: compiling php with libjpg64
Hello JOchem, thank you for your help. That worked out. Regards, Merlin Jochem Maas wrote: google is your friend (and with friends like that who needs enemies): try what's mentioned here: http://www.linuxquestions.org/questions/linux-software-2/compiling-php-on-rhel-5-64-bit-685606/ otherwise: http://www.google.com/search?q=compile+php+64+bit+libs Merlin Morgenstern schreef: Hi everybody, I have to compile from source for several reasons. Any idea on how to fix this particular problem with the lib64? Regards, merlin Shawn McKenzie schrieb: Ashley Sheridan wrote: On Fri, 2009-02-27 at 12:43 -0600, Shawn McKenzie wrote: Merlin Morgenstern wrote: Hi there, I am trying to get a 64 bit suse 10.3 system to run with php 5. Somehow it does not recognize the libjpg which is definatelly in place: server:/home/sw/php-5.2.9 # './configure' '--enable-fastcgi' '--with-mysql=/usr/local/mysql' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-mbstring' '--with-pdo-mysql=/usr/local/mysql/' '--enable-soap' '--with-zlib-dir=/usr/lib64' '--with-freetype-dir=/usr/lib64' '--with-gd' '--with-jpeg-dir=/usr/lib64' '--with-png-dir=/usr/lib64' '--enable-exif' '--with-pdflib=/usr/local' configure.txt configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 (found: none). configure: warning: flex versions supported for regeneration of the Zend/PHP parsers: 2.5.4 (found: 2.5.33) configure: warning: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. configure: error: libjpeg.(a|so) not found. but: # locate libjpeg.so /usr/lib64/libjpeg.so /usr/lib64/libjpeg.so.62 /usr/lib64/libjpeg.so.62.0.0 # locate libjpeg.a /usr/lib64/libjpeg.a I am kind of lost with this one. I can not find the error. Has somebody an idea how to fix this? Thank you for any help, Merlin Might try adding: --with-libdir=lib64 -- Thanks! -Shawn http://www.spidean.com I've got Suse10.3 on my laptop, all 64-bit, and running the correct graphics libraries which I use for GD. I used Yast to install the whole thing, as it sorts out everything for me. For Suse, I'd recommend it, as it really is a great admin tool, albeit a little slow when building repository lists when you install things! Ash www.ashleysheridan.co.uk Yes, I always use a package from whatever distro (ubuntu for my desktop for several years and fedora on my web host). I've never needed to compile apache/php/mysql or most anything else. Sometimes there's something that I want that you can only get from source, but normally that builds easily for me.
Re: [PHP] whoami explanation
[Inhales] On Wed, Mar 4, 2009 at 01:01, PJ af.gour...@videotron.ca wrote: Ok. You asked for it... I have to rant a bit get this off my chest as it has been bugging me for a while and this is not directed at anyone in particular. I'm noting for a while here I do not appreciate it when there is doubt cast on my credibility. If I say that I am getting a different output from Google, for example, the that is what I am getting! And I certainly do not need to be told in sopohomoric terms what Google is or how it works - I am not that ignorant. Perhaps one should check as to what the input to Google was - to compare and find why there might be a discrepancy. This is jumping to conclusions without proper empirical research. First of all, Sally (it's not directed at you, PJ), if you want to say that you're not casting this toward anyone, don't make it so blindingly obvious. I'm the one who said it, and I stand absolutely, completely, and FIRMLY behind it. You are just one of many, many, many people who come through here asking extremely basic questions on a list that assumes - yes, *assumes* - some prior technical knowledge. It is a technical list, not a Complete Idiot's Guide to Keyboard Character Mapping. Now, by no means whatsoever does that insinuate that I think you're an idiot, so if you're not familiar with the series of books, don't take the title to heart; the publisher was not thinking of you and your feelings when they put it on paper. Secondly, if you are getting a different response from Google, Sally, then you didn't use the same input, and thus you may very well need an explanation as to what a search engine is and how to use it --- and it may very well make you ignorant. People use ignorant interchangeably with moronic or inept, when it means nothing more than that you were unaware or uninformed. Ignorance is not always the fault of the ignorant. Thirdly: Perhaps one should check as to what the input to Google was - to compare and find why there might be a discrepancy. This is jumping to conclusions without proper empirical research. Considering I *gave* PJ the search term to use at input, I'll consider my research to be done, complete and accurate, to the best of my knowledge and the collective knowledge of the community, as it's publicly-archived in its entirety. It's not jumping to conclusions when the conclusions were already at our feet from the beginning. The answer was there before he even asked the question. Now, that I am started, I do notice that sometimes, in response to my questions, responders have not grasped the entire problem and pick on some small detail as a typo and forget the larger picture. I understand the importance of the details and the consequences of misplaced dots and other glitches (see Brazil the movie). I know I am rather impatient and thus make hasty typos; but I must note that I have also had answers that were flawed and where glitches were not caught; luckily, I did resolve problem by trying various alternatives. I guess I just don't like to be thought of as some bimbo. I read through all 157 of your posts to the various lists. Yes, exactly 157. The responses you got from the PHP list in particular in your rare and sporadic posts since 2007 were technical responses, perhaps of varying quality, but DAMN good for an all-volunteer community. If you made a typo, big deal --- it happens. If someone chooses to pick on it, then go have a nice cry and come back fresh. It's not at all minimizing your skill and ability, nor making you look like a bimbo. If you expect to receive *only* high-quality answers and will criticize those who give you answers that are flawed and where glitches were not caught, then I highly suggest that you continue to resolve problems by trying various alternatives, because I can speak very loudly for the community and say that you would never be welcome here with an attitude like that, unless your words haven't properly captured what you're trying to convey. This list has people in a wide array of stages in the programming and development education life-cycle, from just doing the research to this is the sixth programming language I've truly mastered and use daily. Further, everyone here is a VOLUNTEER --- a word that has to be kept in mind. If you don't like a response and have a gripe, hire someone to help you and then you can be more than justified in complaining. In defense of my non-bimbo-ism, I have may accomplishments to my credit [snip=irrelevant] so, there... :-P Yeah. And now for the cherry on top of the cake [snip=politics] I may agree, I may disagree, or align/counter-align with different points, but I have no issue in that. I love the argument of politics regardless of the angle, if a person is willing to debate back and forth and not just assert their beliefs as the *only* answer (which you did not, by
Re: [PHP] whoami explanation
Daniel Brown wrote: [Inhales] On Wed, Mar 4, 2009 at 01:01, PJ af.gour...@videotron.ca wrote: Ok. You asked for it... I have to rant a bit get this off my chest as it has been bugging me for a while and this is not directed at anyone in particular. I'm noting for a while here I do not appreciate it when there is doubt cast on my credibility. If I say that I am getting a different output from Google, for example, the that is what I am getting! And I certainly do not need to be told in sopohomoric terms what Google is or how it works - I am not that ignorant. Perhaps one should check as to what the input to Google was - to compare and find why there might be a discrepancy. This is jumping to conclusions without proper empirical research. First of all, Sally (it's not directed at you, PJ), if you want to say that you're not casting this toward anyone, don't make it so blindingly obvious. I'm the one who said it, and I stand absolutely, completely, and FIRMLY behind it. You are just one of many, many, many people who come through here asking extremely basic questions on a list that assumes - yes, *assumes* - some prior technical knowledge. It is a technical list, not a Complete Idiot's Guide to Keyboard Character Mapping. Now, by no means whatsoever does that insinuate that I think you're an idiot, so if you're not familiar with the series of books, don't take the title to heart; the publisher was not thinking of you and your feelings when they put it on paper. Secondly, if you are getting a different response from Google, Sally, then you didn't use the same input, and thus you may very well need an explanation as to what a search engine is and how to use it --- and it may very well make you ignorant. People use ignorant interchangeably with moronic or inept, when it means nothing more than that you were unaware or uninformed. Ignorance is not always the fault of the ignorant. Thirdly: Perhaps one should check as to what the input to Google was - to compare and find why there might be a discrepancy. This is jumping to conclusions without proper empirical research. Considering I *gave* PJ the search term to use at input, I'll consider my research to be done, complete and accurate, to the best of my knowledge and the collective knowledge of the community, as it's publicly-archived in its entirety. It's not jumping to conclusions when the conclusions were already at our feet from the beginning. The answer was there before he even asked the question. Now, that I am started, I do notice that sometimes, in response to my questions, responders have not grasped the entire problem and pick on some small detail as a typo and forget the larger picture. I understand the importance of the details and the consequences of misplaced dots and other glitches (see Brazil the movie). I know I am rather impatient and thus make hasty typos; but I must note that I have also had answers that were flawed and where glitches were not caught; luckily, I did resolve problem by trying various alternatives. I guess I just don't like to be thought of as some bimbo. I read through all 157 of your posts to the various lists. Yes, exactly 157. The responses you got from the PHP list in particular in your rare and sporadic posts since 2007 were technical responses, perhaps of varying quality, but DAMN good for an all-volunteer community. If you made a typo, big deal --- it happens. If someone chooses to pick on it, then go have a nice cry and come back fresh. It's not at all minimizing your skill and ability, nor making you look like a bimbo. If you expect to receive *only* high-quality answers and will criticize those who give you answers that are flawed and where glitches were not caught, then I highly suggest that you continue to resolve problems by trying various alternatives, because I can speak very loudly for the community and say that you would never be welcome here with an attitude like that, unless your words haven't properly captured what you're trying to convey. This list has people in a wide array of stages in the programming and development education life-cycle, from just doing the research to this is the sixth programming language I've truly mastered and use daily. Further, everyone here is a VOLUNTEER --- a word that has to be kept in mind. If you don't like a response and have a gripe, hire someone to help you and then you can be more than justified in complaining. In defense of my non-bimbo-ism, I have may accomplishments to my credit [snip=irrelevant] so, there... :-P Yeah. And now for the cherry on top of the cake [snip=politics] I may agree, I may disagree, or align/counter-align with different points, but I have no issue in that. I love the argument of politics regardless
Re: [PHP] Re: whoami explanation
Robert Cummings schreef: On Tue, 2009-03-03 at 11:27 -0500, PJ wrote: Shawn McKenzie wrote: PJ wrote: This really needs some explanation I found this on the web: ?php echo `whoami`; ? with it there was the comment the direction of those single-quotes matters (WHY ?) and it works But this (_*FROM THE PHP MANUAL***_ * - exec()* executes the given /command/ ) does not, COPIED AND PASTED: |?php // outputs the username that owns the running php/httpd process // (on a system with the whoami executable in the path) echo exec('whoami'); ? | What is going on here? And I often find such discrepancies in examples - and some wonder why I seem to be so stupid... and don't know the fundamentals... :-\ Others have shown how exec() returns the output. If you use shell_exec() it's the same as using the backticks: ?php echo `whoami`; ? -or- ?php echo shell_exec(whoami); ? You can use single quotes here also, i used double so you can easily tell they are not backticks What is not clear to me is why would I need to use a shell? What kind of situations call for it's use? You must be a point and clicker. a PACman. Many, many, many people use the shell to perform basic system administration, edit config files, even edit source code. There are thousands of shell commands available at the touch of your fingertips while in a shell. Using the backticks or exec() function allows one to utilize these programs as part of a larger program. of course the real answer is no-one can explain who you are, you have to find out for yourself Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? It's a really interesting property, by the way; ancient Egypt, Mesopotamia, and that region enthralls me. Those folks were truly inspiring, and put the civil engineers of the 20th and 21st centuries to utter shame. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Daniel Brown wrote: The way I see it, life is little more than a game played in a dream; win or lose, it's still going to end, so enjoy it while it lasts. Speak for yourself THERE CAN BE ONLY ONE!!! *chops off Dan's head* *runs away while lightning bolts strike him over and over* 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
Re: [PHP] whoami explanation
On Wed, Mar 4, 2009 at 10:52, Robert Cummings rob...@interjinn.com wrote: *runs away while lightning bolts strike him over and over* Would the sound to accompany this mental image be one of a Daffy Duck or Woody Woodpecker nature? -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Conclusion of use strict...
You got it all wrong. As explained, php dont have real compile time like other languages. And if you want to learn a language, you have to start the way it acts. the E_STRICT setting will tell you most of the errors possible from a php script. At production level programmers keep the errors away from visitors eyes by redirecting them all to log files. If you use PDT like NetBeans (which is regarded as the best one yet... there's one version of Visual PHP for Visual Studio developers as well) As you have got to check the errors for typos its the best way to get aid of the PDT IDEs. Thats my personal opinion. Lenin www.twitter.com/nine_L www.lenin9l.wordpress.com --- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door without any cost. Visit : www.ubuntu.com -- On Wed, Mar 4, 2009 at 4:03 PM, Hans Schultz h.schult...@yahoo.com wrote: Concluding, and one idea...I think I received satisfying advices on everything but first question (Detection of typos and other simple mistakes). And we were talking also about being able to catch them at compile time, then if php at all has compile time etc. Today one thing crossed my mind -- if there is compiler for php maybe it can catch these errors natively, like java compiler for java? Unfortunatelly there is no recent version available for windows so I can't test it myself ( http://www.roadsend.com/home/index.php?pageID=compiler). I am interesting if someone is using it, and if it can detect this simple mistakes (I am using eclipse + php plugin, but I feel there is something wrong in depending on editor to detect programming errors :-) ) Regards to all, --- On Thu, 2/26/09, Ovidiu Rosoiu ovidiu.ros...@gmail.com wrote: From: Ovidiu Rosoiu ovidiu.ros...@gmail.com Subject: Re: [PHP] use strict or similar in PHP? To: Hans Schultz h.schult...@yahoo.com Cc: php-general@lists.php.net Date: Thursday, February 26, 2009, 9:14 PM Hans Schultz wrote: Hello, I am beginner with PHP and prior to PHP I have worked with java for some time and with perl for very short period. I can't help to notice some things that are little annoyance for me with PHP, but I am sure someone more experienced can help me :-) Is there in PHP something like use strict from perl? I find it pretty annoying to need to run script over and over again just to find out that I made typo in variable name. Is there some way for PHP to cache some data on the page? I like very much PHP's speed but it would be even better to be able to cache some frequently used data from database? Also regarding databases, I liked a lot java's way of sending data to database using parameters (select * from user where username = ? and then passing parameter separately with database doing necessary escaping and everything). Is there something like PHPDBC similar to JDBC?
RE: [PHP] whoami explanation
-Original Message- From: paras...@gmail.com [mailto:paras...@gmail.com] On Behalf Of Daniel Brown Sent: Wednesday, March 04, 2009 10:16 AM To: Robert Cummings Cc: PJ; Boyd, Todd M.; php-general@lists.php.net Subject: Re: [PHP] whoami explanation On Wed, Mar 4, 2009 at 10:52, Robert Cummings rob...@interjinn.com wrote: *runs away while lightning bolts strike him over and over* Would the sound to accompany this mental image be one of a Daffy Duck or Woody Woodpecker nature? I think it's a Queen song, actually... ;) // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 11:15 -0500, Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:52, Robert Cummings rob...@interjinn.com wrote: *runs away while lightning bolts strike him over and over* Would the sound to accompany this mental image be one of a Daffy Duck or Woody Woodpecker nature? I'd go with Woody :) 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
Re: [PHP] whoami explanation
On Wed, Mar 4, 2009 at 11:20, Boyd, Todd M. tmbo...@ccis.edu wrote: I think it's a Queen song, actually... Mama-mia. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Cracking response Dan, and I agree fully with most of it. A while back I was a far more active contributor to the PHP lists than I am now (promotion == more responsibility == less spare time) and the reason I do it is because it never seems like work - it's fun!! But I feel I must correct you on one point... 2009/3/4 Daniel Brown danbr...@php.net Thirdly: Perhaps one should check as to what the input to Google was - to compare and find why there might be a discrepancy. This is jumping to conclusions without proper empirical research. Considering I *gave* PJ the search term to use at input, I'll consider my research to be done, complete and accurate, to the best of my knowledge and the collective knowledge of the community, as it's publicly-archived in its entirety. It's not jumping to conclusions when the conclusions were already at our feet from the beginning. The answer was there before he even asked the question. The results returned by Google are not constant. They vary based on your location, which domain you're using, which index instance you hit and a number of other things, most of which are not public. It is more than possible that PJ did get different results to you from the same search term. Hell, I get different results on my machine than the guy the other side of the office. That was all. -Stuart -- http://stut.net/
Re: [PHP] whoami explanation
On Wed, Mar 4, 2009 at 11:31, Stuart stut...@gmail.com wrote: The results returned by Google are not constant. They vary based on your location, which domain you're using, which index instance you hit and a number of other things, most of which are not public. It is more than possible that PJ did get different results to you from the same search term. Hell, I get different results on my machine than the guy the other side of the office. Yeah, that's true. In the original message I noted locale and other preference settings, but I did fail to mention it again here. The other option is that I'm wrong, but as we all know, that is such a rare occurrence that it may as well be a nonexistent option. If it were the case, though, I would certainly need to concede the point It's interesting that you mention getting different results from someone on the other side of the same office. I would guess that it's the difference between preferences, perhaps even default language settings, but in all honesty, I don't purport to understand more than a fraction of the Google algorithms I'm just glad they're there. And finally, you may not contribute (nearly!) as often as you once did, but your responses haven't lessened in quality by any means. It's Stut, Concentrated. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about template systems
Robert Cummings wrote: On Tue, 2009-03-03 at 21:18 -0600, Shawn McKenzie wrote: Matthew Croud wrote: Hello, First post here, I'm in the process of learning PHP , I'm digesting a few books as we speak. I'm working on a content heavy website that provides a lot of information, a template system would be great and so i've been looking at ways to create dynamic data with a static navigation system. So far, using the require_once(); function seems to fit the bill in order to bring in the same header html file on each page. I've also looked at Smartys template system. I wondered how you folk would go about creating a template system ? My second question might be me jumping the gun here, I haven't come across this part in my book but i'll ask about it anyway. I often see websites that have a dynamic body and static header, and their web addresses end like this: index.php?id=445 where 445 i presume is some my file reference. What is this called ? It seems like the system i'm after but it doesn't appear in my book, If anyone could let me know what this page id subject is called i can do some research on the subject. Thanks for any help you can provide :) Matt. I have written a popular theme/template system for some CMS systems. In my opinion, templating is only needed for those that are totally ignorant of the concept of programming languages in general. I'm not sure... but I'm pretty sur eyou just called me ignorant. Blanket statements like that one above are themselves ignorant. Cheers, Rob. Well then you're ignorant because I didn't call you ignorant! Didn't you write your own template system? Seriously though, I should have worded that differently. I guess the second paragraph was more what I was after. But to clarify the first paragraph, I would suspect if they are anything like me, many of those that know and use PHP prefer to do control type things in PHP (loops, ifs, includes, etc.). I know I do. I like templating in that I use a template (HTML file) and add echos, or use simple templating logic so that {somevar} echoes $somevar, but why replicate what PHP can do with a separate language? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
2009/3/4 Daniel Brown danbr...@php.net On Wed, Mar 4, 2009 at 11:31, Stuart stut...@gmail.com wrote: The results returned by Google are not constant. They vary based on your location, which domain you're using, which index instance you hit and a number of other things, most of which are not public. It is more than possible that PJ did get different results to you from the same search term. Hell, I get different results on my machine than the guy the other side of the office. Yeah, that's true. In the original message I noted locale and other preference settings, but I did fail to mention it again here. The other option is that I'm wrong, but as we all know, that is such a rare occurrence that it may as well be a nonexistent option. If it were the case, though, I would certainly need to concede the point That is indeed unlikely your Royal Smart Arse! ;-) It's interesting that you mention getting different results from someone on the other side of the same office. I would guess that it's the difference between preferences, perhaps even default language settings, but in all honesty, I don't purport to understand more than a fraction of the Google algorithms I'm just glad they're there. As I understand it, and like you I certainly don't claim to know for sure, clusters within the Google infrastructure sometimes fall behind with their copy of the the index which can mean different results even between page reloads. Never seen that but I've certainly seen different results within the same office. Could be dependent on the browser I guess - my CEO uses IE, I use Safari and Firefox. And finally, you may not contribute (nearly!) as often as you once did, but your responses haven't lessened in quality by any means. It's Stut, Concentrated. I'm trying to save the environment. Stut, concentrated - less packaging, more power!! -Stuart -- http://stut.net/
Re: [PHP] whoami explanation
On Wed, Mar 4, 2009 at 12:28, Stuart stut...@gmail.com wrote: As I understand it, and like you I certainly don't claim to know for sure, clusters within the Google infrastructure sometimes fall behind with their copy of the the index which can mean different results even between page reloads. Never seen that but I've certainly seen different results within the same office. Could be dependent on the browser I guess - my CEO uses IE, I use Safari and Firefox. Based upon the point of clusters not being in synchrony (data replication and IP-geolocation-based load-balancing comes immediately to mind), it's enough of a reason for me to retract my original statement. Excellent point, and one I admit I didn't consider. I'm trying to save the environment. Stut, concentrated - less packaging, more power!! Just wait: some day the Green folks will claim that high amounts of email using googolplexes of processor cycles worldwide, leading to greater carbon emissions, is a leading cause of global warming. I'd say that you're just doing your part by reducing your carbon footprint. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about template systems
On Wed, 2009-03-04 at 10:55 -0600, Shawn McKenzie wrote: Robert Cummings wrote: On Tue, 2009-03-03 at 21:18 -0600, Shawn McKenzie wrote: Matthew Croud wrote: Hello, First post here, I'm in the process of learning PHP , I'm digesting a few books as we speak. I'm working on a content heavy website that provides a lot of information, a template system would be great and so i've been looking at ways to create dynamic data with a static navigation system. So far, using the require_once(); function seems to fit the bill in order to bring in the same header html file on each page. I've also looked at Smartys template system. I wondered how you folk would go about creating a template system ? My second question might be me jumping the gun here, I haven't come across this part in my book but i'll ask about it anyway. I often see websites that have a dynamic body and static header, and their web addresses end like this: index.php?id=445 where 445 i presume is some my file reference. What is this called ? It seems like the system i'm after but it doesn't appear in my book, If anyone could let me know what this page id subject is called i can do some research on the subject. Thanks for any help you can provide :) Matt. I have written a popular theme/template system for some CMS systems. In my opinion, templating is only needed for those that are totally ignorant of the concept of programming languages in general. I'm not sure... but I'm pretty sur eyou just called me ignorant. Blanket statements like that one above are themselves ignorant. Cheers, Rob. Well then you're ignorant because I didn't call you ignorant! Didn't you write your own template system? Seriously though, I should have worded that differently. I guess the second paragraph was more what I was after. But to clarify the first paragraph, I would suspect if they are anything like me, many of those that know and use PHP prefer to do control type things in PHP (loops, ifs, includes, etc.). I know I do. I like templating in that I use a template (HTML file) and add echos, or use simple templating logic so that {somevar} echoes $somevar, but why replicate what PHP can do with a separate language? To punt what is repeated over and over during runtime to a single compilation phase when building the template target. To simplify the use of parameters so that they can be used in arbitrary order with default values. To allow for the encapsulation of complex content in tag format that benefits from building at compile time and from being encapsulated in custom tags that integrate well with the rest of the HTML body. To remove the necessaity of constantly moving in and out of PHP tags. To speed up a site. To speed up development. To make easier to use for non-developers. To integrate standards compliance checks into the build phase. To do sooo many things that are just inconvenient and tedious using intermingled PHP code with fixed parameters order (or alternatively a big fugly array). 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
Re: [PHP] whoami explanation
This really needs some explanation I found this on the web: ?php echo `whoami`; ? with it there was the comment the direction of those single-quotes matters (WHY ?) and it works But this (_*FROM THE PHP MANUAL***_ * - exec()* executes the given /command/ ) does not, COPIED AND PASTED: |?php // outputs the username that owns the running php/httpd process // (on a system with the whoami executable in the path) echo exec('whoami'); ? | What is going on here? And I often find such discrepancies in examples - and some wonder why I seem to be so stupid... and don't know the fundamentals... :-\ Didn't have the time to read the whole thread. Sorry for being so lame. I will have to mention that whoami is actually id -un and probably if you need to get user information from the shell IMHO you should better use the id command or a better solution could be the posix_getuid() function. If you need to find the owner of the current script you could use something like get_current_user(). ?php echo 'Current script owner: ' . get_current_user(); echo brCurrent proccess id from the shell: ; echo `id`; echo brCurrent proccess id from the posix getuid: ; echo posix_getuid(); ? btw I think it would be nice to have a function that can give you the user that actually runs the script (apache ,www) instead of using the command line. The posix functions AFAIK can give you only the ids (uid,gid etc) about a process. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn and just plain stupidity, appreciation of common sense and then, of course, programming knowledge - we'll be using a log of video clips - flash probably streaming - oh yes, and not to forget, a sense of adventure, the thrill of a challenge (to do something different if not off the wall) and, well, some time to risk for this great opportunity. 8-) I get the impression that this (list) is where we'll find such great minds, wits and dreamers - for you gotta have a vision! It's a really interesting property, by the way; ancient Egypt, Mesopotamia, and that region enthralls me. Those folks were truly inspiring, and put the civil engineers of the 20th and 21st centuries to utter shame. Indeed. Makes you wonder, doesn't it. -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Stuart wrote: Cracking response Dan, and I agree fully with most of it. A while back I was a far more active contributor to the PHP lists than I am now (promotion == more responsibility == less spare time) and the reason I do it is because it never seems like work - it's fun!! But I feel I must correct you on one point... 2009/3/4 Daniel Brown danbr...@php.net mailto:danbr...@php.net   Thirdly:     Perhaps one should check as to what the input to Google was -     to compare and find why there might be a discrepancy. This is jumping to     conclusions without proper empirical research.   Considering I *gave* PJ the search term to use at input, I'll consider my research to be done, complete and accurate, to the best of my knowledge and the collective knowledge of the community, as it's publicly-archived in its entirety.  It's not jumping to conclusions when the conclusions were already at our feet from the beginning.  The answer was there before he even asked the question. The results returned by Google are not constant. They vary based on your location, which domain you're using, which index instance you hit and a number of other things, most of which are not public. It is more than possible that PJ did get different results to you from the same search term. Hell, I get different results on my machine than the guy the other side of the office. That was all. am I vindicated ;-) -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sending multipart/form-data request with PECL.
I am trying to submit a request to an HTTP server with multipart/form-data encoded data. I'm using PECL's HttpRequest (although I'm open to alternatives). I am using PHP5. I noticed that if you call addPostFile to add a file, PECL will send the file, and all other post parameters, with multipart/form-data encoding, so I know PECL has the capability to do it. If you simply call addPostFields but never call addPostFile, it uses standard post encoding. Is there a way to force PECL to use multipart/form-data encoding for all post fields added with addPostFields, even when you are not calling addPostFile to add a file? If not, is there another good way to encode multipart data with PHP? Thanks! Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn What? Monsanto makes great weed killers and what the hell is wrong with corn?!?! Have you seriously never roated a cob in the husk over a wood fire and then submerged the cob into a vat of melted butter? Plus pigs, cows and chickens eat it. Mmmm... and just plain stupidity, appreciation of common sense and then, of course, programming knowledge - we'll be using a log of video clips - flash probably streaming - oh yes, and not to forget, a sense of adventure, the thrill of a challenge (to do something different if not off the wall) and, well, some time to risk for this great opportunity. 8-) I get the impression that this (list) is where we'll find such great minds, wits and dreamers - for you gotta have a vision! It's a really interesting property, by the way; ancient Egypt, Mesopotamia, and that region enthralls me. Those folks were truly inspiring, and put the civil engineers of the 20th and 21st centuries to utter shame. Indeed. Makes you wonder, doesn't it. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, Mar 4, 2009 at 13:31, PJ af.gour...@videotron.ca wrote: am I vindicated ;-) Eh. Whether or not it is true in practice, in theory it certainly sounds plausible to have varying results. However, your argument, verbatim, wasn't entirely with merit. ;-P All in all, sure. At the least, it shows that I (probably) was not entirely correct in my statement of how Google's results are uniform even without user-defined influence. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Thodoris wrote: Didn't have the time to read the whole thread. Sorry for being so lame. Obviously, or you would have known that this thread has very little if anything to do with whoami! :-) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about template systems
Robert Cummings wrote: On Wed, 2009-03-04 at 10:55 -0600, Shawn McKenzie wrote: Robert Cummings wrote: On Tue, 2009-03-03 at 21:18 -0600, Shawn McKenzie wrote: Matthew Croud wrote: Hello, First post here, I'm in the process of learning PHP , I'm digesting a few books as we speak. I'm working on a content heavy website that provides a lot of information, a template system would be great and so i've been looking at ways to create dynamic data with a static navigation system. So far, using the require_once(); function seems to fit the bill in order to bring in the same header html file on each page. I've also looked at Smartys template system. I wondered how you folk would go about creating a template system ? My second question might be me jumping the gun here, I haven't come across this part in my book but i'll ask about it anyway. I often see websites that have a dynamic body and static header, and their web addresses end like this: index.php?id=445 where 445 i presume is some my file reference. What is this called ? It seems like the system i'm after but it doesn't appear in my book, If anyone could let me know what this page id subject is called i can do some research on the subject. Thanks for any help you can provide :) Matt. I have written a popular theme/template system for some CMS systems. In my opinion, templating is only needed for those that are totally ignorant of the concept of programming languages in general. I'm not sure... but I'm pretty sur eyou just called me ignorant. Blanket statements like that one above are themselves ignorant. Cheers, Rob. Well then you're ignorant because I didn't call you ignorant! Didn't you write your own template system? Seriously though, I should have worded that differently. I guess the second paragraph was more what I was after. But to clarify the first paragraph, I would suspect if they are anything like me, many of those that know and use PHP prefer to do control type things in PHP (loops, ifs, includes, etc.). I know I do. I like templating in that I use a template (HTML file) and add echos, or use simple templating logic so that {somevar} echoes $somevar, but why replicate what PHP can do with a separate language? To punt what is repeated over and over during runtime to a single compilation phase when building the template target. To simplify the use of parameters so that they can be used in arbitrary order with default values. To allow for the encapsulation of complex content in tag format that benefits from building at compile time and from being encapsulated in custom tags that integrate well with the rest of the HTML body. To remove the necessaity of constantly moving in and out of PHP tags. To speed up a site. To speed up development. To make easier to use for non-developers. To integrate standards compliance checks into the build phase. To do sooo many things that are just inconvenient and tedious using intermingled PHP code with fixed parameters order (or alternatively a big fugly array). Cheers, Rob. Is that it? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about template systems
On Wed, 2009-03-04 at 12:46 -0600, Shawn McKenzie wrote: Robert Cummings wrote: On Wed, 2009-03-04 at 10:55 -0600, Shawn McKenzie wrote: Robert Cummings wrote: On Tue, 2009-03-03 at 21:18 -0600, Shawn McKenzie wrote: Matthew Croud wrote: Hello, First post here, I'm in the process of learning PHP , I'm digesting a few books as we speak. I'm working on a content heavy website that provides a lot of information, a template system would be great and so i've been looking at ways to create dynamic data with a static navigation system. So far, using the require_once(); function seems to fit the bill in order to bring in the same header html file on each page. I've also looked at Smartys template system. I wondered how you folk would go about creating a template system ? My second question might be me jumping the gun here, I haven't come across this part in my book but i'll ask about it anyway. I often see websites that have a dynamic body and static header, and their web addresses end like this: index.php?id=445 where 445 i presume is some my file reference. What is this called ? It seems like the system i'm after but it doesn't appear in my book, If anyone could let me know what this page id subject is called i can do some research on the subject. Thanks for any help you can provide :) Matt. I have written a popular theme/template system for some CMS systems. In my opinion, templating is only needed for those that are totally ignorant of the concept of programming languages in general. I'm not sure... but I'm pretty sur eyou just called me ignorant. Blanket statements like that one above are themselves ignorant. Cheers, Rob. Well then you're ignorant because I didn't call you ignorant! Didn't you write your own template system? Seriously though, I should have worded that differently. I guess the second paragraph was more what I was after. But to clarify the first paragraph, I would suspect if they are anything like me, many of those that know and use PHP prefer to do control type things in PHP (loops, ifs, includes, etc.). I know I do. I like templating in that I use a template (HTML file) and add echos, or use simple templating logic so that {somevar} echoes $somevar, but why replicate what PHP can do with a separate language? To punt what is repeated over and over during runtime to a single compilation phase when building the template target. To simplify the use of parameters so that they can be used in arbitrary order with default values. To allow for the encapsulation of complex content in tag format that benefits from building at compile time and from being encapsulated in custom tags that integrate well with the rest of the HTML body. To remove the necessaity of constantly moving in and out of PHP tags. To speed up a site. To speed up development. To make easier to use for non-developers. To integrate standards compliance checks into the build phase. To do sooo many things that are just inconvenient and tedious using intermingled PHP code with fixed parameters order (or alternatively a big fugly array). Cheers, Rob. Is that it? No... I could have gone on :) 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
Re: [PHP] whoami explanation
2009/3/4 PJ af.gour...@videotron.ca Stuart wrote: Cracking response Dan, and I agree fully with most of it. A while back I was a far more active contributor to the PHP lists than I am now (promotion == more responsibility == less spare time) and the reason I do it is because it never seems like work - it's fun!! But I feel I must correct you on one point... 2009/3/4 Daniel Brown danbr...@php.net mailto:danbr...@php.net   Thirdly:     Perhaps one should check as to what the input to Google was -     to compare and find why there might be a discrepancy. This is jumping to     conclusions without proper empirical research.   Considering I *gave* PJ the search term to use at input, I'll consider my research to be done, complete and accurate, to the best of my knowledge and the collective knowledge of the community, as it's publicly-archived in its entirety.  It's not jumping to conclusions when the conclusions were already at our feet from the beginning.  The answer was there before he even asked the question. The results returned by Google are not constant. They vary based on your location, which domain you're using, which index instance you hit and a number of other things, most of which are not public. It is more than possible that PJ did get different results to you from the same search term. Hell, I get different results on my machine than the guy the other side of the office. That was all. am I vindicated ;-) Not really, because the results were there you just didn't put in enough effort. Precision Googling should be taught at school - it's a life skill that keeps boring questions from recurring on lists like this with painful regularity. And by Googling I don't necessarily mean by using Google - other search engines are available. -Stuart -- http://stut.net/
[PHP] Re: Sending multipart/form-data request with PECL.
Jason Cipriani wrote: I am trying to submit a request to an HTTP server with multipart/form-data encoded data. I'm using PECL's HttpRequest (although I'm open to alternatives). I am using PHP5. I noticed that if you call addPostFile to add a file, PECL will send the file, and all other post parameters, with multipart/form-data encoding, so I know PECL has the capability to do it. If you simply call addPostFields but never call addPostFile, it uses standard post encoding. Is there a way to force PECL to use multipart/form-data encoding for all post fields added with addPostFields, even when you are not calling addPostFile to add a file? If not, is there another good way to encode multipart data with PHP? Thanks! Jason Try: setContentType() -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about template systems
On Wed, Mar 4, 2009 at 11:51 AM, Robert Cummings rob...@interjinn.comwrote: On Wed, 2009-03-04 at 12:46 -0600, Shawn McKenzie wrote: Robert Cummings wrote: On Wed, 2009-03-04 at 10:55 -0600, Shawn McKenzie wrote: Robert Cummings wrote: On Tue, 2009-03-03 at 21:18 -0600, Shawn McKenzie wrote: Matthew Croud wrote: Hello, First post here, I'm in the process of learning PHP , I'm digesting a few books as we speak. I'm working on a content heavy website that provides a lot of information, a template system would be great and so i've been looking at ways to create dynamic data with a static navigation system. So far, using the require_once(); function seems to fit the bill in order to bring in the same header html file on each page. I've also looked at Smartys template system. I wondered how you folk would go about creating a template system ? My second question might be me jumping the gun here, I haven't come across this part in my book but i'll ask about it anyway. I often see websites that have a dynamic body and static header, and their web addresses end like this: index.php?id=445 where 445 i presume is some my file reference. What is this called ? It seems like the system i'm after but it doesn't appear in my book, If anyone could let me know what this page id subject is called i can do some research on the subject. Thanks for any help you can provide :) Matt. I have written a popular theme/template system for some CMS systems. In my opinion, templating is only needed for those that are totally ignorant of the concept of programming languages in general. I'm not sure... but I'm pretty sur eyou just called me ignorant. Blanket statements like that one above are themselves ignorant. Cheers, Rob. Well then you're ignorant because I didn't call you ignorant! Didn't you write your own template system? Seriously though, I should have worded that differently. I guess the second paragraph was more what I was after. But to clarify the first paragraph, I would suspect if they are anything like me, many of those that know and use PHP prefer to do control type things in PHP (loops, ifs, includes, etc.). I know I do. I like templating in that I use a template (HTML file) and add echos, or use simple templating logic so that {somevar} echoes $somevar, but why replicate what PHP can do with a separate language? To punt what is repeated over and over during runtime to a single compilation phase when building the template target. To simplify the use of parameters so that they can be used in arbitrary order with default values. To allow for the encapsulation of complex content in tag format that benefits from building at compile time and from being encapsulated in custom tags that integrate well with the rest of the HTML body. To remove the necessaity of constantly moving in and out of PHP tags. To speed up a site. To speed up development. To make easier to use for non-developers. To integrate standards compliance checks into the build phase. To do sooo many things that are just inconvenient and tedious using intermingled PHP code with fixed parameters order (or alternatively a big fugly array). Cheers, Rob. Is that it? No... I could have gone on :) a bit ot, but id like to ask about TemplateJinn, Rob. do you have to run the compile pass, or can it fall back to runtime content inclusion? and no, ive not yet finished, RTFM :) also, morbidly curious, have you looked at blitz; thoughts ? thx, -nathan
Re: [PHP] whoami explanation
Thodoris wrote: Didn't have the time to read the whole thread. Sorry for being so lame. Obviously, or you would have known that this thread has very little if anything to do with whoami! :-) Indeed nonetheless it will be something useful for the archives (at least I think that). After that I had to read the whole thing!! Blast I though I could get away with it :-) -- Thodoris
Re: [PHP] Re: Question about template systems
On Wed, 2009-03-04 at 12:15 -0700, Nathan Nobbe wrote: On Wed, Mar 4, 2009 at 11:51 AM, Robert Cummings rob...@interjinn.comwrote: On Wed, 2009-03-04 at 12:46 -0600, Shawn McKenzie wrote: Robert Cummings wrote: On Wed, 2009-03-04 at 10:55 -0600, Shawn McKenzie wrote: Robert Cummings wrote: On Tue, 2009-03-03 at 21:18 -0600, Shawn McKenzie wrote: Matthew Croud wrote: Hello, First post here, I'm in the process of learning PHP , I'm digesting a few books as we speak. I'm working on a content heavy website that provides a lot of information, a template system would be great and so i've been looking at ways to create dynamic data with a static navigation system. So far, using the require_once(); function seems to fit the bill in order to bring in the same header html file on each page. I've also looked at Smartys template system. I wondered how you folk would go about creating a template system ? My second question might be me jumping the gun here, I haven't come across this part in my book but i'll ask about it anyway. I often see websites that have a dynamic body and static header, and their web addresses end like this: index.php?id=445 where 445 i presume is some my file reference. What is this called ? It seems like the system i'm after but it doesn't appear in my book, If anyone could let me know what this page id subject is called i can do some research on the subject. Thanks for any help you can provide :) Matt. I have written a popular theme/template system for some CMS systems. In my opinion, templating is only needed for those that are totally ignorant of the concept of programming languages in general. I'm not sure... but I'm pretty sur eyou just called me ignorant. Blanket statements like that one above are themselves ignorant. Cheers, Rob. Well then you're ignorant because I didn't call you ignorant! Didn't you write your own template system? Seriously though, I should have worded that differently. I guess the second paragraph was more what I was after. But to clarify the first paragraph, I would suspect if they are anything like me, many of those that know and use PHP prefer to do control type things in PHP (loops, ifs, includes, etc.). I know I do. I like templating in that I use a template (HTML file) and add echos, or use simple templating logic so that {somevar} echoes $somevar, but why replicate what PHP can do with a separate language? To punt what is repeated over and over during runtime to a single compilation phase when building the template target. To simplify the use of parameters so that they can be used in arbitrary order with default values. To allow for the encapsulation of complex content in tag format that benefits from building at compile time and from being encapsulated in custom tags that integrate well with the rest of the HTML body. To remove the necessaity of constantly moving in and out of PHP tags. To speed up a site. To speed up development. To make easier to use for non-developers. To integrate standards compliance checks into the build phase. To do sooo many things that are just inconvenient and tedious using intermingled PHP code with fixed parameters order (or alternatively a big fugly array). Cheers, Rob. Is that it? No... I could have gone on :) a bit ot, but id like to ask about TemplateJinn, Rob. do you have to run the compile pass, or can it fall back to runtime content inclusion? and no, ive not yet finished, RTFM :) You can manually run the compile pass (one or more pages or entire site). Or if enabled via configuration it can automatically detect page dependency changes and recompile as necessary (great for development since reloading in browser causes auto recompile). On live servers I disable the auto compile option usually. The templates allow embedding PHP code if you so wish, so you could embed run-time includes if you wanted. Or you could create a tag that performs a run-time include... I've used both methods for different projects. Legacy code or non-native systems sometimes warrant chunking... so can compile content chunks that benefit from custom tags but can themselves be included at runtime via traditional include philosophies (header.php, footer.php, etc). I've done this for generating custom MediaWiki/WordPress layouts. It's very flexible... you can pretty much do what you want while benefitting from custom tag engine (you're not limited to tags btw, it provides a generic pre/post processing system that allows other stuff (I usually remove unnecessary whitespace at a post process stage and for some sites fire off a check on the W3C XHTML validator). also, morbidly curious, have you looked at blitz; thoughts ? I
[PHP] Re: [PHP-DEV] How expensive are function_exists() calls?
On Wed, Mar 4, 2009 at 4:01 AM, Jochem Maas joc...@iamjochem.com wrote: ..not an internals question me thinks ... redirecting to generals mailing list Actually, I do think it is somewhat internals related. I want to know from the internals/experts angle if this is a good function to be relying on, or if it is one of those things like the @ operator which I've been told is expensive and to me is one of those things to stay away from. Now if this breaks opcode caches like APC, I will have to find another way. Also - I write procedural, not OOP. So that won't help here. Would creating functions such as output_foo_html() output_foo_rss() output_foo_json() Then depending on the output, using something like this? Would this be breaking opcode caches as well then? if(function_exists('output_foo_'.$format)) { call_user_func('output_foo_'.$format); } else { output_foo_html(); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange charecters
On Wed, 2009-03-04 at 08:02 -0500, Bastien Koert wrote: On Wed, Mar 4, 2009 at 2:10 AM, Paul Scott psc...@uwc.ac.za wrote: On Wed, 2009-03-04 at 10:09 +0530, Chetan Rane wrote: I am using ob_start() in my application. However I am getting this error about headers already sent. _Any_ output will set that error off. Check for Notices, Warnings, echo's, prints and var_dumps in your code. -- Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php check for a blank space above the ?php of your files Or a trailing space after the ? of any include files. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-DEV] How expensive are function_exists() calls?
On Wed, 2009-03-04 at 11:45 -0800, mike wrote: On Wed, Mar 4, 2009 at 4:01 AM, Jochem Maas joc...@iamjochem.com wrote: ..not an internals question me thinks ... redirecting to generals mailing list Actually, I do think it is somewhat internals related. I want to know from the internals/experts angle if this is a good function to be relying on, or if it is one of those things like the @ operator which I've been told is expensive and to me is one of those things to stay away from. Now if this breaks opcode caches like APC, I will have to find another way. Also - I write procedural, not OOP. So that won't help here. Would creating functions such as output_foo_html() output_foo_rss() output_foo_json() Then depending on the output, using something like this? Would this be breaking opcode caches as well then? if(function_exists('output_foo_'.$format)) { call_user_func('output_foo_'.$format); } else { output_foo_html(); } Perfectly fine. Shouldn't break an opcode cache. the opcode cache will store the opcodes to do what you've done above and also will store opcodes for the function wherever it was declared. Then when it runs off it will go. For what it's worth... functions have global scope... all functions are store in some kind of lookup table. Associative arrays have O( lg n ) lookup time. Let's imagine you had 1 million defined functions... We're talking at most 19 node traversals on a balanced binary tree (yes I know it's a hashing algorithm). A billion declared functions 29 steps. Is it fast? Yes. 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
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 10:23 -0500, Daniel Brown wrote: Secondly, if you are getting a different response from Google, Sally, then you didn't use the same input I'd beg to differ. It's well known that Google gives out different results based on geographical location and previous search history. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, Mar 4, 2009 at 15:03, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Wed, 2009-03-04 at 10:23 -0500, Daniel Brown wrote: Secondly, if you are getting a different response from Google, Sally, then you didn't use the same input I'd beg to differ. It's well known that Google gives out different results based on geographical location and previous search history. Read the whole thread first, Ash. I mentioned that at two different points therein. ;-P Good to see you back, by the way either it was just me, or you went on a hiatus of sorts. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 15:02 -0500, Daniel Brown wrote: On Wed, Mar 4, 2009 at 15:03, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Wed, 2009-03-04 at 10:23 -0500, Daniel Brown wrote: Secondly, if you are getting a different response from Google, Sally, then you didn't use the same input I'd beg to differ. It's well known that Google gives out different results based on geographical location and previous search history. Read the whole thread first, Ash. I mentioned that at two different points therein. ;-P Good to see you back, by the way either it was just me, or you went on a hiatus of sorts. Yeah, been crazily busy with both my regular job and freelance stuff. I think I'm booked up to Armageddon now :-/ Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How Much Data Can Be Written to a Database In One Instance?
Hi, I am working on a series of long files that contain 4 or 5 MB each, each of them is encoded in UTF-8 saved as .dat format. However, I have noticed that when I do insert statements, the file only reads up to around 1MB and then would stop. If I split the file into 3 or 4 files, that would hold no more than 1.2 MB each, then I won't have problems. Is there a limitation on how much data can be read and written in PHP within one instance? Thanks for your help. Alice _ Search from any Web page with powerful protection. Get the FREE Windows Live Toolbar Today! http://get.live.com/toolbar/overview
Re: [PHP] $_FILES empty, trouble with uploading
On Wed, 2009-03-04 at 09:02 -0500, Karl St-Jacques wrote: Hello people. I have some trouble with an upload script. It was working until the last 2 weeks. Whenever I tried to upload a file to a remote server, the $_FILES array is empty. I print global at start of the script there's nothing. Here's the form form action=http://random.server.com/video/upload.php; method=post enctype=multipart/form-data input type=hidden name=sessid value=yada input type=hidden name=ugroup value=xfr input type=hidden name=memberid value=25798 input type=hidden name=referrer value=server.com labelTitle:/labelinput type=text name=video_title value=N/A size=20 maxlenght=30 labelDescription:/labelinput type=text name=video_desc value=N/A size=20 maxlenght=255 labelCategory:/label select name=video_category option value=1yada/option option value=5yada2/option /select input type=hidden name=MAX_FILE_SIZE value=209715200 / input name=vid_files type=file size=30 /br / input type=submit name=upload class=sbtn value=Go! / /form So it's a basic form, I do have the enctype. the print_r($GLOBALS) return me [_FILES] = Array ( ) PHP Version 5.2.6file_uploads is On post_max_size 200M upload_max_filesize 200M upload_tmp_dir no value (it use /tmp) the /tmp folder is writable by apache (chmod 777) with 197G of space left. So, obviously, I'm lost as why I can't upload file anymore. Anyone had a similar problem ? What could I do to find/fix the problem ? Is it even related to PHP ? Thanks, Karl _ Share photos with friends on Windows Live Messenger http://go.microsoft.com/?linkid=9650734 Has your php.ini file been changed at all? If the max upload setting and memory settings have been reduced, it will affect uploads. How large is the file you are trying to upload? And lastly, does the script work on a local testing server? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, Mar 4, 2009 at 15:07, Ashley Sheridan a...@ashleysheridan.co.uk wrote: Yeah, been crazily busy with both my regular job and freelance stuff. I think I'm booked up to Armageddon now :-/ Good for you. It means you're definitely doing something right. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How Much Data Can Be Written to a Database In One Instance?
On Wed, 2009-03-04 at 15:05 -0500, Alice Wei wrote: Hi, I am working on a series of long files that contain 4 or 5 MB each, each of them is encoded in UTF-8 saved as .dat format. However, I have noticed that when I do insert statements, the file only reads up to around 1MB and then would stop. If I split the file into 3 or 4 files, that would hold no more than 1.2 MB each, then I won't have problems. Is there a limitation on how much data can be read and written in PHP within one instance? See this setting in your php.ini: memory_limit = ???M 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
Re: [PHP] How Much Data Can Be Written to a Database In One Instance?
On Wed, Mar 4, 2009 at 15:26, Robert Cummings rob...@interjinn.com wrote: See this setting in your php.ini: memory_limit = ???M Also let us know what you're using for the database and how you're doing it. You mention that the .dat files are 4-5MB, but don't say if that's the database you're using, or if you're reading from those and entering the data in MySQL, or what. For example, if you're inserting data from there into MySQL, it's probably a MySQL issue that could be fixed by adjusting the packet size in your /etc/my.cnf (or equivalent) configuration file. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Much Data Can Be Written to a Database In One Instance?
Subject: Re: [PHP] How Much Data Can Be Written to a Database In One Instance? From: rob...@interjinn.com To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Wed, 4 Mar 2009 15:26:38 -0500 On Wed, 2009-03-04 at 15:05 -0500, Alice Wei wrote: Hi, I am working on a series of long files that contain 4 or 5 MB each, each of them is encoded in UTF-8 saved as .dat format. However, I have noticed that when I do insert statements, the file only reads up to around 1MB and then would stop. If I split the file into 3 or 4 files, that would hold no more than 1.2 MB each, then I won't have problems. Is there a limitation on how much data can be read and written in PHP within one instance? See this setting in your php.ini: memory_limit = ???M Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP Weird, I had memory_limit = 128M ; Maximum amount of memory a script may consume (128MB) However, the file that I was trying to read from was 5MB of text file. I tried to read it line by line and also ran one query for each line along the way before I got it to the database. If I have a file that is around 1MB, I have no problems, but once it passes that, a lot of lines go missing. Alice _ Express yourself with gadgets on Windows Live Spaces http://discoverspaces.live.com?source=hmtag1loc=us
RE: [PHP] How Much Data Can Be Written to a Database In One Instance?
Subject: Re: [PHP] How Much Data Can Be Written to a Database In One Instance? From: rob...@interjinn.com To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Wed, 4 Mar 2009 15:26:38 -0500 On Wed, 2009-03-04 at 15:05 -0500, Alice Wei wrote: Hi, I am working on a series of long files that contain 4 or 5 MB each, each of them is encoded in UTF-8 saved as .dat format. However, I have noticed that when I do insert statements, the file only reads up to around 1MB and then would stop. If I split the file into 3 or 4 files, that would hold no more than 1.2 MB each, then I won't have problems. Is there a limitation on how much data can be read and written in PHP within one instance? See this setting in your php.ini: memory_limit = ???M Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP Weird, I had memory_limit = 128M ; Maximum amount of memory a script may consume (128MB) However, the file that I was trying to read from was 5MB of text file. I tried to read it line by line and also ran one query for each line along the way before I got it to the database. If I have a file that is around 1MB, I have no problems, but once it passes that, a lot of lines go missing. Alice _ Check the weather nationwide with MSN Search: Try it now! http://search.msn.com/results.aspx?q=weatherFORM=WLMTAG
RE: [PHP] How Much Data Can Be Written to a Database In One Instance?
_ Use Messenger to talk to your IM friends, even those on Yahoo! http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Conclusion of use strict...
Thanks for reply, I completely understood your answer even in previous thread, but you should understand few very simple things1. I am not working alone, so I can't make other people use tools I use (eclipse + PDT at the moment) 2. even if somehow I manage to do number 1 we also have some legacy code from where ocassionally popup some idiotic bug (like that I mentioned with typo in property name)I hope (because of 1 and 2) you can understand that eclipse + PDT is not answer to my problem. Now, since I need some way to do these checks for all code paths (and not just currently running one) that is why I am more interested for something able to do those checks in compile time (ie, my javac will report to me uninitialized variable if I have some code path that could miss initialization of variable I am using later); since almost everyone agreed that could be done by some compiler I found php compiler (that for fact really exist, and I even posted llnk to it), since I need to use windows for development and compiler has trial version for linux I was curious if someone used it and if it could help me with my problems.. So, question is NOT whether php is interpreted or compiled, or is there a compiler, question is rather is that compiler useful for my problem.Best regards --- On Wed, 3/4/09, 9el le...@phpxperts.net wrote: From: 9el le...@phpxperts.net Subject: Re: [PHP] Conclusion of use strict... To: h.schult...@yahoo.com Cc: php-general@lists.php.net Date: Wednesday, March 4, 2009, 4:20 PM You got it all wrong. As explained, php dont have real compile time like other languages. And if you want to learn a language, you have to start the way it acts. the E_STRICT setting will tell you most of the errors possible from a php script. At production level programmers keep the errors away from visitors eyes by redirecting them all to log files. If you use PDT like NetBeans (which is regarded as the best one yet... there's one version of Visual PHP for Visual Studio developers as well) As you have got to check the errors for typos its the best way to get aid of the PDT IDEs. Thats my personal opinion. Lenin www.twitter.com/nine_L www.lenin9l.wordpress.com --- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door without any cost. Visit : www.ubuntu.com -- On Wed, Mar 4, 2009 at 4:03 PM, Hans Schultz h.schult...@yahoo.com wrote: Concluding, and one idea...I think I received satisfying advices on everything but first question (Detection of typos and other simple mistakes). And we were talking also about being able to catch them at compile time, then if php at all has compile time etc. Today one thing crossed my mind -- if there is compiler for php maybe it can catch these errors natively, like java compiler for java? Unfortunatelly there is no recent version available for windows so I can't test it myself (http://www.roadsend.com/home/index.php?pageID=compiler). I am interesting if someone is using it, and if it can detect this simple mistakes (I am using eclipse + php plugin, but I feel there is something wrong in depending on editor to detect programming errors :-) ) Regards to all, --- On Thu, 2/26/09, Ovidiu Rosoiu ovidiu.ros...@gmail.com wrote: From: Ovidiu Rosoiu ovidiu.ros...@gmail.com Subject: Re: [PHP] use strict or similar in PHP? To: Hans Schultz h.schult...@yahoo.com Cc: php-general@lists.php.net Date: Thursday, February 26, 2009, 9:14 PM Hans Schultz wrote: Hello, I am beginner with PHP and prior to PHP I have worked with java for some time and with perl for very short period. I can't help to notice some things that are little annoyance for me with PHP, but I am sure someone more experienced can help me :-) Is there in PHP something like use strict from perl? I find it pretty annoying to need to run script over and over again just to find out that I made typo in variable name. Is there some way for PHP to cache some data on the page? I like very much PHP's speed but it would be even better to be able to cache some frequently used data from database? Also regarding databases, I liked a lot java's way of sending data to database using parameters (select * from user where username = ? and then passing parameter separately with database doing necessary escaping and everything). Is there something like PHPDBC similar to JDBC?
[PHP] Re: [PHP-DEV] How expensive are function_exists() calls?
mike schreef: On Wed, Mar 4, 2009 at 4:01 AM, Jochem Maas joc...@iamjochem.com wrote: ..not an internals question me thinks ... redirecting to generals mailing list Actually, I do think it is somewhat internals related. internals is about engine development. always ask on the generals list first, you can always escalate the question if no-one there can offer any help. I want to know from the internals/experts angle if this is a good function to be relying on, or if it is one of those things like the @ operator which I've been told is expensive and to me is one of those things to stay away from. Now if this breaks opcode caches like APC, I will have to find another way. Also - I write procedural, not OOP. So that won't help here. whatever. sounds like a limited way of looking at things, nonetheless it's perfectly feasable to write the registry pattern using functions a/some global var(s). Would creating functions such as output_foo_html() output_foo_rss() output_foo_json() Then depending on the output, using something like this? Would this be breaking opcode caches as well then? no, the thing that breaks the opcode cache is when you declare a function conditionally because the function declaration has to be deferred until runtime. there are plenty of detailed posts on the internals list about this (try searching for 'APC' will likely turn up quite alot). if(function_exists('output_foo_'.$format)) { call_user_func('output_foo_'.$format); } else { output_foo_html(); } you don't need call_user_func() here (which is very handy but also slow): $func = 'output_foo_'.$format; if (function_exists($func)) $func(); else output_foo_html(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn What? Monsanto makes great weed killers and what the hell is wrong with corn?!?! Have you seriously never roated a cob in the husk over a wood fire and then submerged the cob into a vat of melted butter? Plus pigs, cows and chickens eat it. Mmmm... Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... just think for a minute: according to the current business models in just about everything including and especially the food industry... how do you think they boost their profits... certainly not by raising prices... nooh, that would not be cool... they just downgrade the quality of the ingredients and the workers so that if ;you are not eating shit by the time it gets to your enteron (that is a word - one that Enron paid some 6 million smackers fo an agency and then found out that that is the the entire digestive tract right from one input hole to the output hole) :-D , it is a miracle glad to have this opportunity to rile - that is exactly the kind of thing that we want to do with the site that we are starting to develop... to destroy ignorance about food - to enllighten, inform and teach to have a greater society of well fed and healthy individuals... don't foget, you are what you eat - the name escapes me at the moment, but it was a great French chef of the 18th century who said that... I could go on at great length on that subject... but I have to goet some work done... and just plain stupidity, appreciation of common sense and then, of course, programming knowledge - we'll be using a log of video clips - flash probably streaming - oh yes, and not to forget, a sense of adventure, the thrill of a challenge (to do something different if not off the wall) and, well, some time to risk for this great opportunity. 8-) I get the impression that this (list) is where we'll find such great minds, wits and dreamers - for you gotta have a vision! It's a really interesting property, by the way; ancient Egypt, Mesopotamia, and that region enthralls me. Those folks were truly inspiring, and put the civil engineers of the 20th and 21st centuries to utter shame. Indeed. Makes you wonder, doesn't it. -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 16:16 -0500, PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn What? Monsanto makes great weed killers and what the hell is wrong with corn?!?! Have you seriously never roated a cob in the husk over a wood fire and then submerged the cob into a vat of melted butter? Plus pigs, cows and chickens eat it. Mmmm... Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... just think for a minute: according to the current business models in just about everything including and especially the food industry... how do you think they boost their profits... certainly not by raising prices... nooh, that would not be cool... they just downgrade the quality of the ingredients and the workers so that if ;you are not eating shit by the time it gets to your enteron (that is a word - one that Enron paid some 6 million smackers fo an agency and then found out that that is the the entire digestive tract right from one input hole to the output hole) :-D , it is a miracle glad to have this opportunity to rile - that is exactly the kind of thing that we want to do with the site that we are starting to develop... to destroy ignorance about food - to enllighten, inform and teach to have a greater society of well fed and healthy individuals... don't foget, you are what you eat - the name escapes me at the moment, but it was a great French chef of the 18th century who said that... I could go on at great length on that subject... but I have to goet some work done... My wife bakes bread from scratch... delicious. I'm so lucky to have such an awesome woman. She cooks most meals from basic ingredients. Her favourite book is the Joy of Cooking. 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
Re: [PHP] whoami explanation
for FILE in $LIST do cp $FILE $FILE.bak done which works as long as you can guarantee that none your file names contain spaces ... ;) Which he already said: Note that in both of these examples, filenames with spaces in them will blow the whole thing up :( ;) -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn What? Monsanto makes great weed killers and what the hell is wrong with corn?!?! Have you seriously never roated a cob in the husk over a wood fire and then submerged the cob into a vat of melted butter? Plus pigs, cows and chickens eat it. Mmmm... Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... just think for a minute: according to the current business models in just about everything including and especially the food industry... how do you think they boost their profits... certainly not by raising prices... nooh, that would not be cool... they just downgrade the quality of the ingredients and the workers so that if ;you are not eating shit by the time it gets to your enteron (that is a word - one that Enron paid some 6 million smackers fo an agency and then found out that that is the the entire digestive tract right from one input hole to the output hole) :-D , it is a miracle glad to have this opportunity to rile - that is exactly the kind of thing that we want to do with the site that we are starting to develop... to destroy ignorance about food - to enllighten, inform and teach to have a greater society of well fed and healthy individuals... don't foget, you are what you eat - the name escapes me at the moment, but it was a great French chef of the 18th century who said that... I could go on at great length on that subject... but I have to goet some work done... Not ignorance but indifference to some of what you shout :-) I don't enjoy/eat macdonalds or other fast food and use pre-packaged stuff on rare occasion. We buy fresh ingredients from local meat markets/farmers markets etc. This includes corn. Corn is yummy, chickens, pigs and cows eat corn and chickens, pigs and cows are yummy! Hell, cornbread is yummy! I do however cringe at the practice of burning our food in internal combustion engines. As for monsanto, I don't know much about them, but I know they have many different products/businesses. The only one I use is roundup (I think this is monsanto). It's great to kill the weeds in the cracks in the driveway and sidewalks. Also, if it's not windy I use it in the mulched flower beds and sometimes in the areas filled with river rocks. I guess I should read more about it. Did this come about before or after wal-mart started ruining the planet? What about the communists contaminating our precious bodily fluids? Whatever you do, please, please, please, for the love of all that is holy, please, do not vilify potatoes! ...or the Irish :-) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 15:48 -0600, Shawn McKenzie wrote: PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn What? Monsanto makes great weed killers and what the hell is wrong with corn?!?! Have you seriously never roated a cob in the husk over a wood fire and then submerged the cob into a vat of melted butter? Plus pigs, cows and chickens eat it. Mmmm... Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... just think for a minute: according to the current business models in just about everything including and especially the food industry... how do you think they boost their profits... certainly not by raising prices... nooh, that would not be cool... they just downgrade the quality of the ingredients and the workers so that if ;you are not eating shit by the time it gets to your enteron (that is a word - one that Enron paid some 6 million smackers fo an agency and then found out that that is the the entire digestive tract right from one input hole to the output hole) :-D , it is a miracle glad to have this opportunity to rile - that is exactly the kind of thing that we want to do with the site that we are starting to develop... to destroy ignorance about food - to enllighten, inform and teach to have a greater society of well fed and healthy individuals... don't foget, you are what you eat - the name escapes me at the moment, but it was a great French chef of the 18th century who said that... I could go on at great length on that subject... but I have to goet some work done... Not ignorance but indifference to some of what you shout :-) I don't enjoy/eat macdonalds or other fast food and use pre-packaged stuff on rare occasion. We buy fresh ingredients from local meat markets/farmers markets etc. This includes corn. Corn is yummy, chickens, pigs and cows eat corn and chickens, pigs and cows are yummy! Hell, cornbread is yummy! I do however cringe at the practice of burning our food in internal combustion engines. As for monsanto, I don't know much about them, but I know they have many different products/businesses. The only one I use is roundup (I think this is monsanto). It's great to kill the weeds in the cracks in the driveway and sidewalks. Also, if it's not windy I use it in the mulched flower beds and sometimes in the areas filled with river rocks. I guess I should read more about it. Did this come about before or after wal-mart started ruining the planet? What about the communists contaminating our precious bodily fluids? Whatever you do, please, please, please, for the love
Re: [PHP] whoami explanation
On Wed, Mar 04, 2009 at 04:16:40PM -0500, PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: snip Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - And it's yummy, too! it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... And this is bad why? High fructose corn syrup is its own food group! Yay! While you're ranting about megacorporations, you might want to have a shot at pharmaceutical companies, after reading the lists of side effects for any prescription drug you care to name. even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... McDonald's is my *favorite* fast food! Are you saying there's something less than healthy about it? Sorry, I used to live in LA, and I had health food people up to here. They were the sickest people I knew. So I took it as my personal mission to smoke, drink and eat as much crappy food as I could just to prove I'd outlast them. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Robert Cummings wrote: On Wed, 2009-03-04 at 16:16 -0500, PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn What? Monsanto makes great weed killers and what the hell is wrong with corn?!?! Have you seriously never roated a cob in the husk over a wood fire and then submerged the cob into a vat of melted butter? Plus pigs, cows and chickens eat it. Mmmm... Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... just think for a minute: according to the current business models in just about everything including and especially the food industry... how do you think they boost their profits... certainly not by raising prices... nooh, that would not be cool... they just downgrade the quality of the ingredients and the workers so that if ;you are not eating shit by the time it gets to your enteron (that is a word - one that Enron paid some 6 million smackers fo an agency and then found out that that is the the entire digestive tract right from one input hole to the output hole) :-D , it is a miracle glad to have this opportunity to rile - that is exactly the kind of thing that we want to do with the site that we are starting to develop... to destroy ignorance about food - to enllighten, inform and teach to have a greater society of well fed and healthy individuals... don't foget, you are what you eat - the name escapes me at the moment, but it was a great French chef of the 18th century who said that... I could go on at great length on that subject... but I have to goet some work done... My wife bakes bread from scratch... delicious. I'm so lucky to have such an awesome woman. She cooks most meals from basic ingredients. Her favourite book is the Joy of Cooking. That's ok, great for a start... there are so many books out there that are really great; but unfortunately there are far more that are done by schlubs and total idiots. As Benjie Franklin said, out of 100% you can figure 8% is silver and the remaining 2 is gold. And as Julia Child told my wife, They sure do get in our way, don't they! It is a rare cookbook that is true and has functional recipes. Too many chefs (or rather those that pretend to be) lack the true essence of a great human being and that is sharing their knowledge and giving pleasure to others. One of the greatest living thefs is a froggie by the name of Michel Kerever who, last I knew, had and probably still has a restaurant in Paris called Les Deux Colonnes; he has a book out of some 600 pages with no illustrations and all his recipes work. A miracle. If we keep this
Re: [PHP] whoami explanation
Shawn McKenzie wrote: PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn What? Monsanto makes great weed killers and what the hell is wrong with corn?!?! Have you seriously never roated a cob in the husk over a wood fire and then submerged the cob into a vat of melted butter? Plus pigs, cows and chickens eat it. Mmmm... Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... just think for a minute: according to the current business models in just about everything including and especially the food industry... how do you think they boost their profits... certainly not by raising prices... nooh, that would not be cool... they just downgrade the quality of the ingredients and the workers so that if ;you are not eating shit by the time it gets to your enteron (that is a word - one that Enron paid some 6 million smackers fo an agency and then found out that that is the the entire digestive tract right from one input hole to the output hole) :-D , it is a miracle glad to have this opportunity to rile - that is exactly the kind of thing that we want to do with the site that we are starting to develop... to destroy ignorance about food - to enllighten, inform and teach to have a greater society of well fed and healthy individuals... don't foget, you are what you eat - the name escapes me at the moment, but it was a great French chef of the 18th century who said that... I could go on at great length on that subject... but I have to goet some work done... Not ignorance but indifference to some of what you shout :-) I don't enjoy/eat macdonalds or other fast food and use pre-packaged stuff on rare occasion. We buy fresh ingredients from local meat markets/farmers markets etc. This includes corn. Corn is yummy, chickens, pigs and cows eat corn and chickens, pigs and cows are yummy! Hell, cornbread is yummy! I do however cringe at the practice of burning our food in internal combustion engines. As for monsanto, I don't know much about them, but I know they have many different products/businesses. The only one I use is roundup (I think this is monsanto). It's great to kill the weeds in the cracks in the driveway and sidewalks. Also, if it's not windy I use it in the mulched flower beds and sometimes in the areas filled with river rocks. I guess I should read more about it. Did this come about before or after wal-mart started ruining the planet? What about the communists contaminating our precious bodily fluids? Whatever you do, please, please, please, for the love of all that is
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 15:48 -0600, Shawn McKenzie wrote: Whatever you do, please, please, please, for the love of all that is holy, please, do not vilify potatoes! ...or the Irish :-) Potatoes are best served sliced into sticks, pan-fried, covered in cheese curds, and then finally doused in beef gravy!! 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
Re: [PHP] whoami explanation
Ashley Sheridan wrote: On Wed, 2009-03-04 at 15:48 -0600, Shawn McKenzie wrote: PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: Right on. Good comments. No offense taken and none intended. I am enoying the list and will continue to participate, if i may. I have learned a great deal already and really do appreciate the help. So you mentioned your involvement in television production and briefly touched on cooking shows and such what brought you into the insanity of web programming? New stage in life, or specifically to work on your daughter's site? Her necessity and my curiosity coupled with an interesting challenge. :-) After this, there's the other site http://www.chiccantine.com - that's just a start for now... we're aiming for a really great site on food that will be instuctional as well as enlightening for all to learn how to really deal with great food - what it is all really about take a look at the link below the signature. You might learn something about vanilla. BTW, we'll be looking for great programmers and designers who will want to participate in the adventure (as that is what it will be) - we'll surely be doing this as a non-profit thing and hope to develop something profitable along the way. The startup will require dedication and some time with the hope of worthwhile earnings once things are rolling. Requirements are: love of food (the real, natural stuff), a hate for Monsanto, corn What? Monsanto makes great weed killers and what the hell is wrong with corn?!?! Have you seriously never roated a cob in the husk over a wood fire and then submerged the cob into a vat of melted butter? Plus pigs, cows and chickens eat it. Mmmm... Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... just think for a minute: according to the current business models in just about everything including and especially the food industry... how do you think they boost their profits... certainly not by raising prices... nooh, that would not be cool... they just downgrade the quality of the ingredients and the workers so that if ;you are not eating shit by the time it gets to your enteron (that is a word - one that Enron paid some 6 million smackers fo an agency and then found out that that is the the entire digestive tract right from one input hole to the output hole) :-D , it is a miracle glad to have this opportunity to rile - that is exactly the kind of thing that we want to do with the site that we are starting to develop... to destroy ignorance about food - to enllighten, inform and teach to have a greater society of well fed and healthy individuals... don't foget, you are what you eat - the name escapes me at the moment, but it was a great French chef of the 18th century who said that... I could go on at great length on that subject... but I have to goet some work done... Not ignorance but indifference to some of what you shout :-) I don't enjoy/eat macdonalds or other fast food and use pre-packaged stuff on rare occasion. We buy fresh ingredients from local meat markets/farmers markets etc. This includes corn. Corn is yummy, chickens, pigs and cows eat corn and chickens, pigs and cows are yummy! Hell, cornbread is yummy! I do however cringe at the practice of burning our food in internal combustion engines. As for monsanto, I don't know much about them, but I know they have many different products/businesses. The only one I use is roundup (I think this is monsanto). It's great to kill the weeds in the cracks in the driveway and sidewalks. Also, if it's not windy I use it in the mulched flower beds and sometimes in the areas filled with river rocks. I guess I should read more about it. Did this come about before or after wal-mart started ruining the planet? What about the communists contaminating our precious bodily
Re: [PHP] Conclusion of use strict...
Hans Schultz schreef: Thanks for reply, I completely understood your answer even in previous thread, but you should understand few very simple things1. I am not working alone, so I can't make other people use tools I use (eclipse + PDT at the moment) 2. even if somehow I manage to do number 1 we also have some legacy code from where ocassionally popup some idiotic bug (like that I mentioned with typo in property name)I hope (because of 1 and 2) you can understand that eclipse + PDT is not answer to my problem. Now, since I need some way to do these checks for all code paths (and not just currently running one) that is why I am more interested for something able to do those checks in compile time (ie, my javac will report to me uninitialized variable if I have some code path that could miss initialization of variable I am using later); since almost everyone agreed that could be done by some compiler I found php compiler (that for fact really exist, and I even posted llnk to it), since I need to use windows for development and compiler has trial version for linux I was curious if someone used it and if it could help me with my problems.. So, question is NOT whether php is interpreted or compiled, or is there a compiler, question is rather is that compiler useful for my problem.Best regards 1. you should *try* to standardize everyone on a single IDE/tool-chain 2. a decent IDE will give warnings about vars that are [seemingly] uninitialized or used only once. 3. a compiler can't cover all situations (variable variables, vars defined in optional includes, etc) 4. there is no silver bullet. 5. try to compartmentalize code so that the scope of a var doesn't exceed the number of lines you can view in a single screen (makes it easier to spot typos, etc) 6. I am not a number. --- On Wed, 3/4/09, 9el le...@phpxperts.net wrote: From: 9el le...@phpxperts.net Subject: Re: [PHP] Conclusion of use strict... To: h.schult...@yahoo.com Cc: php-general@lists.php.net Date: Wednesday, March 4, 2009, 4:20 PM You got it all wrong. As explained, php dont have real compile time like other languages. And if you want to learn a language, you have to start the way it acts. the E_STRICT setting will tell you most of the errors possible from a php script. At production level programmers keep the errors away from visitors eyes by redirecting them all to log files. If you use PDT like NetBeans (which is regarded as the best one yet... there's one version of Visual PHP for Visual Studio developers as well) As you have got to check the errors for typos its the best way to get aid of the PDT IDEs. Thats my personal opinion. Lenin www.twitter.com/nine_L www.lenin9l.wordpress.com --- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door without any cost. Visit : www.ubuntu.com -- On Wed, Mar 4, 2009 at 4:03 PM, Hans Schultz h.schult...@yahoo.com wrote: Concluding, and one idea...I think I received satisfying advices on everything but first question (Detection of typos and other simple mistakes). And we were talking also about being able to catch them at compile time, then if php at all has compile time etc. Today one thing crossed my mind -- if there is compiler for php maybe it can catch these errors natively, like java compiler for java? Unfortunatelly there is no recent version available for windows so I can't test it myself (http://www.roadsend.com/home/index.php?pageID=compiler). I am interesting if someone is using it, and if it can detect this simple mistakes (I am using eclipse + php plugin, but I feel there is something wrong in depending on editor to detect programming errors :-) ) Regards to all, --- On Thu, 2/26/09, Ovidiu Rosoiu ovidiu.ros...@gmail.com wrote: From: Ovidiu Rosoiu ovidiu.ros...@gmail.com Subject: Re: [PHP] use strict or similar in PHP? To: Hans Schultz h.schult...@yahoo.com Cc: php-general@lists.php.net Date: Thursday, February 26, 2009, 9:14 PM Hans Schultz wrote: Hello, I am beginner with PHP and prior to PHP I have worked with java for some time and with perl for very short period. I can't help to notice some things that are little annoyance for me with PHP, but I am sure someone more experienced can help me :-) Is there in PHP something like use strict from perl? I find it pretty annoying to need to run script over and over again just to find out that I made typo in variable name. Is there some way for PHP to cache some data on the page? I like very much PHP's speed but it would be even better to be able to cache some frequently used data from database? Also regarding databases, I liked a lot java's way of sending data to
Re: [PHP] whoami explanation
Paul M Foster wrote: On Wed, Mar 04, 2009 at 04:16:40PM -0500, PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: snip Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - And it's yummy, too! it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... And this is bad why? High fructose corn syrup is its own food group! Yay! While you're ranting about megacorporations, you might want to have a shot at pharmaceutical companies, after reading the lists of side effects for any prescription drug you care to name. even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... McDonald's is my *favorite* fast food! Are you saying there's something less than healthy about it? Sorry, I used to live in LA, and I had health food people up to here. They were the sickest people I knew. So I took it as my personal mission to smoke, drink and eat as much crappy food as I could just to prove I'd outlast them. Paul Yuck. But then there are people who are more resistant to crap than cockroaches. But we will not outlast them! You might try to get informed... Unfortunately, Americans are a sad and uninformed race... let's hope that Obama can bring about some positive change... Can you imagine an intelligent scientist, a physicist to boot, and, in this case a she, who believes that the world is flat. It's rather sad but true... only in America... probably the midwest of Bible belt ... it's really religulous :-D -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Robert Cummings wrote: On Wed, 2009-03-04 at 15:48 -0600, Shawn McKenzie wrote: Whatever you do, please, please, please, for the love of all that is holy, please, do not vilify potatoes! ...or the Irish :-) Potatoes are best served sliced into sticks, pan-fried, covered in cheese curds, and then finally doused in beef gravy!! Cheers, Rob. My god, where did you get that recipe... mind you, if all the ingredients are top quality, I'm with you... but it sounds more like something you'd get here inn Quebec it's called poutine (NO, IT IS NOT RUSSIAN) and it is absolutely disgusting. Wouldn't be caught dead eating that crap. -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending multipart/form-data request with PECL.
Hello, on 03/04/2009 03:33 PM Jason Cipriani said the following: I am trying to submit a request to an HTTP server with multipart/form-data encoded data. I'm using PECL's HttpRequest (although I'm open to alternatives). I am using PHP5. I noticed that if you call addPostFile to add a file, PECL will send the file, and all other post parameters, with multipart/form-data encoding, so I know PECL has the capability to do it. If you simply call addPostFields but never call addPostFile, it uses standard post encoding. Is there a way to force PECL to use multipart/form-data encoding for all post fields added with addPostFields, even when you are not calling addPostFile to add a file? If not, is there another good way to encode multipart data with PHP? I have no idea because I do not use PECL extensions. I use this HTTP client class for emulating browser form submission. Take a look at the test_http_post.php that has examples of how to upload forms using POST requests: http://www.phpclasses.org/httpclient -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 17:43 -0500, PJ wrote: Robert Cummings wrote: On Wed, 2009-03-04 at 15:48 -0600, Shawn McKenzie wrote: Whatever you do, please, please, please, for the love of all that is holy, please, do not vilify potatoes! ...or the Irish :-) Potatoes are best served sliced into sticks, pan-fried, covered in cheese curds, and then finally doused in beef gravy!! Cheers, Rob. My god, where did you get that recipe... mind you, if all the ingredients are top quality, I'm with you... but it sounds more like something you'd get here inn Quebec it's called poutine (NO, IT IS NOT RUSSIAN) and it is absolutely disgusting. Wouldn't be caught dead eating that crap. Ummm... I live in Ottawa... I know what it's called :) And poutine rocks! 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
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 21:55 +, Ashley Sheridan wrote: Whilst we're on the subject, what about cows, pigs and sheep, which are the biggest contributors to global warming through their, erm, gases? Global warming is a huge problem, so I call upon all vegetarians to eat as much meat as possible to rectify this problem! ;) It depends on where you live... for instance the Scotts would say that the sheep gives the most warmth on a cold night :B 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] if elseif elseif elseif....
This is probably a mysql question, but their list is rather dull - I think they don't appreciate my humor. Beside this list is fun ... and informative. Anyway, I can't figure this out. I am trying to verify inputs on a form and even if I have all the required fields right, I still get the error that there are empty obligatory fields. This is what I am using... but I'm open to anything that works or is more efficient: if (strlen($_POST[titleIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[first_nameIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[publisherIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[copyrightIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[ISBNIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[languageIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[categoriesIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } I've tried closing with else ($obligatoryFiieldNot Present = 0); end; but that give me a blank page - haven't figure out how to check for parsing or scripting errors Thanks for any suggestions. -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Robert Cummings wrote: On Wed, 2009-03-04 at 17:43 -0500, PJ wrote: Robert Cummings wrote: On Wed, 2009-03-04 at 15:48 -0600, Shawn McKenzie wrote: Whatever you do, please, please, please, for the love of all that is holy, please, do not vilify potatoes! ...or the Irish :-) Potatoes are best served sliced into sticks, pan-fried, covered in cheese curds, and then finally doused in beef gravy!! Cheers, Rob. My god, where did you get that recipe... mind you, if all the ingredients are top quality, I'm with you... but it sounds more like something you'd get here inn Quebec it's called poutine (NO, IT IS NOT RUSSIAN) and it is absolutely disgusting. Wouldn't be caught dead eating that crap. Ummm... I live in Ottawa... I know what it's called :) And poutine rocks! Cheers, Rob. Like I said, if it's made with top quality ingredients it can be great... otherwise... it's a matter of personal taste, I suppose... :-( -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if elseif elseif elseif....
On Wed, Mar 4, 2009 at 17:51, PJ af.gour...@videotron.ca wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else? -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 17:46 -0500, Robert Cummings wrote: On Wed, 2009-03-04 at 21:55 +, Ashley Sheridan wrote: Whilst we're on the subject, what about cows, pigs and sheep, which are the biggest contributors to global warming through their, erm, gases? Global warming is a huge problem, so I call upon all vegetarians to eat as much meat as possible to rectify this problem! ;) It depends on where you live... for instance the Scotts would say that the sheep gives the most warmth on a cold night :B Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP I'm pretty sure that's the Welsh. The Scots just fill the sheeps' stomachs with offal and oats and when not cooking this concoction, roll them down hills for sport... Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 17:40 -0500, PJ wrote: Paul M Foster wrote: On Wed, Mar 04, 2009 at 04:16:40PM -0500, PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: snip Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - And it's yummy, too! it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... And this is bad why? High fructose corn syrup is its own food group! Yay! While you're ranting about megacorporations, you might want to have a shot at pharmaceutical companies, after reading the lists of side effects for any prescription drug you care to name. even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... McDonald's is my *favorite* fast food! Are you saying there's something less than healthy about it? Sorry, I used to live in LA, and I had health food people up to here. They were the sickest people I knew. So I took it as my personal mission to smoke, drink and eat as much crappy food as I could just to prove I'd outlast them. Paul Yuck. But then there are people who are more resistant to crap than cockroaches. But we will not outlast them! You might try to get informed... Unfortunately, Americans are a sad and uninformed race... let's hope that Obama can bring about some positive change... Can you imagine an intelligent scientist, a physicist to boot, and, in this case a she, who believes that the world is flat. It's rather sad but true... only in America... probably the midwest of Bible belt ... it's really religulous :-D -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php What, you mean it isn't a flat disc supported on the back of four elephants who ride on the great turtle A'Tuin?! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question about template systems
Robert Cummings wrote: To punt what is repeated over and over during runtime to a single compilation phase when building the template target. To simplify the use of parameters so that they can be used in arbitrary order with default values. To allow for the encapsulation of complex content in tag format that benefits from building at compile time and from being encapsulated in custom tags that integrate well with the rest of the HTML body. I can't speak to those (and I have no opinion on template systems having never used any of them. To remove the necessaity of constantly moving in and out of PHP tags. php does not require that you constantly move in and out of PHP tags. There's at least one and possibly several pure php solutions that allow one to never write a line of html but get beautiful dynamic html output. To speed up a site. I'm curious about that one, how so? -=-=-=- And I've got a question. Part of my page involves dynamically generated JavaScript. The JavaScript will rarely change but it will change. By having php generate it, when my database is updated the js automatically will be too (yes I give the no-cache headers when sending the js. Actually I allow it to be cached for a day.) Switching between php and JavaScript really sucks - moreso than switching between php and html as it is much easier to get lost in which language mode you are in. Anyone know of a slick way to dynamically create javascript with php? One thought I had - if there was an xml way to describe javascript and a filter to then create the actual javascript from the xml, I could create the js as xml and run it through the filter when sent to the browser. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 23:02 +, Ashley Sheridan wrote: On Wed, 2009-03-04 at 17:40 -0500, PJ wrote: Yuck. But then there are people who are more resistant to crap than cockroaches. But we will not outlast them! You might try to get informed... Unfortunately, Americans are a sad and uninformed race... let's hope that Obama can bring about some positive change... Can you imagine an intelligent scientist, a physicist to boot, and, in this case a she, who believes that the world is flat. It's rather sad but true... only in America... probably the midwest of Bible belt ... it's really religulous :-D What, you mean it isn't a flat disc supported on the back of four elephants who ride on the great turtle A'Tuin?! Earthquakes are caused by farting... I blame the elephants for global warming due to all that methane!!! 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
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 18:16 -0500, PJ wrote: Ashley Sheridan wrote: On Wed, 2009-03-04 at 17:40 -0500, PJ wrote: Paul M Foster wrote: On Wed, Mar 04, 2009 at 04:16:40PM -0500, PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: snip Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - And it's yummy, too! it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... And this is bad why? High fructose corn syrup is its own food group! Yay! While you're ranting about megacorporations, you might want to have a shot at pharmaceutical companies, after reading the lists of side effects for any prescription drug you care to name. even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... McDonald's is my *favorite* fast food! Are you saying there's something less than healthy about it? Sorry, I used to live in LA, and I had health food people up to here. They were the sickest people I knew. So I took it as my personal mission to smoke, drink and eat as much crappy food as I could just to prove I'd outlast them. Paul Yuck. But then there are people who are more resistant to crap than cockroaches. But we will not outlast them! You might try to get informed... Unfortunately, Americans are a sad and uninformed race... let's hope that Obama can bring about some positive change... Can you imagine an intelligent scientist, a physicist to boot, and, in this case a she, who believes that the world is flat. It's rather sad but true... only in America... probably the midwest of Bible belt ... it's really religulous :-D -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php What, you mean it isn't a flat disc supported on the back of four elephants who ride on the great turtle A'Tuin?! Ash www.ashleysheridan.co.uk This is just too hilarious...that's good, very good... Hehe, it's a Discworld thing! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 18:14 -0500, PJ wrote: Ashley Sheridan wrote: On Wed, 2009-03-04 at 17:46 -0500, Robert Cummings wrote: On Wed, 2009-03-04 at 21:55 +, Ashley Sheridan wrote: Whilst we're on the subject, what about cows, pigs and sheep, which are the biggest contributors to global warming through their, erm, gases? Global warming is a huge problem, so I call upon all vegetarians to eat as much meat as possible to rectify this problem! ;) It depends on where you live... for instance the Scotts would say that the sheep gives the most warmth on a cold night :B Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP I'm pretty sure that's the Welsh. The Scots just fill the sheeps' stomachs with offal and oats and when not cooking this concoction, roll them down hills for sport... Ash www.ashleysheridan.co.uk :-D ;-) :-D ;-) :-D :'( :-D :'( For the record, I'm actually quite a big fan of Haggis! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sending multipart/form-data request with PECL.
On Wed, Mar 4, 2009 at 2:10 PM, Shawn McKenzie nos...@mckenzies.net wrote: Jason Cipriani wrote: Is there a way to force PECL to use multipart/form-data encoding for all post fields added with addPostFields, even when you are not calling addPostFile to add a file? Try: setContentType() Thanks! But, I tried that, and according to my packet sniffer, calling setContentType() actually seems to have no effect whatsoever on the request! Is there something I have to enable? Here's an example, it's just a fake request, used to see what HttpRequest outputs: $fields = array(field=value,other=something) $http_req = new HttpRequest('http://localhost:/resource'); $http_req-setMethod(HTTP_METH_POST); $http_req-setContentType('multipart/form-data'); $http_req-addPostFields($fields); $http_req-send(); Here is what it produces, it's still application/x-www-form-urlencoded: === BEGIN REQUEST === POST /resource HTTP/1.1 User-Agent: PECL::HTTP/1.6.1-dev (PHP/5.2.6) Host: localhost: Accept: */* Content-Length: 27 Content-Type: application/x-www-form-urlencoded field=valueother=something === END REQUEST === Even if I call setContentType with some made up content type, it doesn't affect the output; am I doing something wrong there? Thanks! Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sending multipart/form-data request with PECL.
Jason Cipriani wrote: On Wed, Mar 4, 2009 at 2:10 PM, Shawn McKenzie nos...@mckenzies.net wrote: Jason Cipriani wrote: Is there a way to force PECL to use multipart/form-data encoding for all post fields added with addPostFields, even when you are not calling addPostFile to add a file? Try: setContentType() Thanks! But, I tried that, and according to my packet sniffer, calling setContentType() actually seems to have no effect whatsoever on the request! Is there something I have to enable? Here's an example, it's just a fake request, used to see what HttpRequest outputs: $fields = array(field=value,other=something) $http_req = new HttpRequest('http://localhost:/resource'); $http_req-setMethod(HTTP_METH_POST); $http_req-setContentType('multipart/form-data'); $http_req-addPostFields($fields); $http_req-send(); Here is what it produces, it's still application/x-www-form-urlencoded: === BEGIN REQUEST === POST /resource HTTP/1.1 User-Agent: PECL::HTTP/1.6.1-dev (PHP/5.2.6) Host: localhost: Accept: */* Content-Length: 27 Content-Type: application/x-www-form-urlencoded field=valueother=something === END REQUEST === Even if I call setContentType with some made up content type, it doesn't affect the output; am I doing something wrong there? Thanks! Jason I don't know. I just looked it up in the manual. If it doesn't work then it may be a bug. Hard to tell because the documentation for httprequest is very light. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Ashley Sheridan wrote: On Wed, 2009-03-04 at 17:46 -0500, Robert Cummings wrote: On Wed, 2009-03-04 at 21:55 +, Ashley Sheridan wrote: Whilst we're on the subject, what about cows, pigs and sheep, which are the biggest contributors to global warming through their, erm, gases? Global warming is a huge problem, so I call upon all vegetarians to eat as much meat as possible to rectify this problem! ;) It depends on where you live... for instance the Scotts would say that the sheep gives the most warmth on a cold night :B Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP I'm pretty sure that's the Welsh. The Scots just fill the sheeps' stomachs with offal and oats and when not cooking this concoction, roll them down hills for sport... Ash www.ashleysheridan.co.uk :-D ;-) :-D ;-) :-D :'( :-D :'( -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if elseif elseif elseif....
Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ af.gour...@videotron.ca wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else? That's where the problem lies... the algorhythm is if any one of a series is empty, then it's an error, but if they are all ls then we go on... So the last one should show up as 0... I tried else $obligatoryFieldNotPresent = 0; but that doesn't want to work. I tried echo $obligatoryFieldNotPresent; just get a blank page... I can't figure out how to determine if anything is in the String... perhaps I should be checking for null elseif ($obligatoryFiledNotPresent == ) { $obligatoryFieldNotPresent = 0; } I tried that too, but same result... -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Ashley Sheridan wrote: On Wed, 2009-03-04 at 17:40 -0500, PJ wrote: Paul M Foster wrote: On Wed, Mar 04, 2009 at 04:16:40PM -0500, PJ wrote: Shawn McKenzie wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 10:42, PJ af.gour...@videotron.ca wrote: snip Ooooh, boy now this is really serious... :o I think your ignorance will be forgiven, maybe! And this is not meant disparagingly but you'd better find out about Monsanto and corn and how they are probably the greatest destructors of the the environment and our own bodies? Google it and get a hold of some books, like try Michael Pollan; do you have any idea of what Monsanto does and to whom and how? Do you know how corn is destroying whole economies of countries? Corn is sweeping continents because of human greed - And it's yummy, too! it is being used to create all sorts of artificial food ingredients and even to produce petrol (oil) substitutes... And this is bad why? High fructose corn syrup is its own food group! Yay! While you're ranting about megacorporations, you might want to have a shot at pharmaceutical companies, after reading the lists of side effects for any prescription drug you care to name. even your own body is probably so full of corn derivatives that it is surprising that you haven't turned into a corn cob by now -- especially if you are not paying attention, and I mean great attention, to what you eat... like MacDos and pre-packaged prepared foods... McDonald's is my *favorite* fast food! Are you saying there's something less than healthy about it? Sorry, I used to live in LA, and I had health food people up to here. They were the sickest people I knew. So I took it as my personal mission to smoke, drink and eat as much crappy food as I could just to prove I'd outlast them. Paul Yuck. But then there are people who are more resistant to crap than cockroaches. But we will not outlast them! You might try to get informed... Unfortunately, Americans are a sad and uninformed race... let's hope that Obama can bring about some positive change... Can you imagine an intelligent scientist, a physicist to boot, and, in this case a she, who believes that the world is flat. It's rather sad but true... only in America... probably the midwest of Bible belt ... it's really religulous :-D -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php What, you mean it isn't a flat disc supported on the back of four elephants who ride on the great turtle A'Tuin?! Ash www.ashleysheridan.co.uk This is just too hilarious...that's good, very good... -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if elseif elseif elseif....
PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ af.gour...@videotron.ca wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else? That's where the problem lies... the algorhythm is if any one of a series is empty, then it's an error, but if they are all ls then we go on... So the last one should show up as 0... Using a single = means an assignment. Assigning a variable should never fail. You probably want == to do a comparison. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if elseif elseif elseif....
Chris wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ af.gour...@videotron.ca wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else? That's where the problem lies... the algorhythm is if any one of a series is empty, then it's an error, but if they are all ls then we go on... So the last one should show up as 0... Using a single = means an assignment. Assigning a variable should never fail. You probably want == to do a comparison. Yes and yes, however the it's the result of the assignment that is used: if($var = false) { echo Succeeded; } else { echo FAIL; } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if elseif elseif elseif....
PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ af.gour...@videotron.ca wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else? That's where the problem lies... the algorhythm is if any one of a series is empty, then it's an error, but if they are all ls then we go on... So the last one should show up as 0... I tried else $obligatoryFieldNotPresent = 0; but that doesn't want to work. I tried echo $obligatoryFieldNotPresent; just get a blank page... I can't figure out how to determine if anything is in the String... perhaps I should be checking for null elseif ($obligatoryFiledNotPresent == ) { $obligatoryFieldNotPresent = 0; } I tried that too, but same result... finally found the problem... wrong names for string and this is what now verifies correctly if (strlen($_POST[titleIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[first_nameIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[publisherIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[copyrightIN]) == ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[ISBNIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[languageIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (!empty($_POST['categoriesIN'])) { $obligatoryFieldNotPresent = 0; But now I have to figure out the workflow and see why it is not going the right way... wonder where I got some of this stuff... -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
Robert Cummings wrote: On Wed, 2009-03-04 at 15:48 -0600, Shawn McKenzie wrote: Whatever you do, please, please, please, for the love of all that is holy, please, do not vilify potatoes! ...or the Irish :-) Potatoes are best served sliced into sticks, pan-fried, covered in cheese curds, and then finally doused in beef gravy!! Cheers, Rob. O.K. you had me hooked until cheese curds :-P Potatoes are best served sliced into sticks, pan-fried, covered in ground beef, and then finally doused in beef gravy!! -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] whoami explanation
On Wed, 2009-03-04 at 23:21 +, Ashley Sheridan wrote: On Wed, 2009-03-04 at 18:14 -0500, PJ wrote: Ashley Sheridan wrote: On Wed, 2009-03-04 at 17:46 -0500, Robert Cummings wrote: On Wed, 2009-03-04 at 21:55 +, Ashley Sheridan wrote: Whilst we're on the subject, what about cows, pigs and sheep, which are the biggest contributors to global warming through their, erm, gases? Global warming is a huge problem, so I call upon all vegetarians to eat as much meat as possible to rectify this problem! ;) It depends on where you live... for instance the Scotts would say that the sheep gives the most warmth on a cold night :B Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP I'm pretty sure that's the Welsh. The Scots just fill the sheeps' stomachs with offal and oats and when not cooking this concoction, roll them down hills for sport... Ash www.ashleysheridan.co.uk :-D ;-) :-D ;-) :-D :'( :-D :'( For the record, I'm actually quite a big fan of Haggis! Me too :) I grew up in Scotland... that and black pudding (not blood pudding though). 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
Re: [PHP] if elseif elseif elseif....
Shawn McKenzie wrote: Chris wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ af.gour...@videotron.ca wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else? That's where the problem lies... the algorhythm is if any one of a series is empty, then it's an error, but if they are all ls then we go on... So the last one should show up as 0... Using a single = means an assignment. Assigning a variable should never fail. You probably want == to do a comparison. Yes and yes, however the it's the result of the assignment that is used: if($var = false) { echo Succeeded; } else { echo FAIL; } Yeh that's what I was trying to say, just did it poorly ;) -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if elseif elseif elseif....
PJ wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ af.gour...@videotron.ca wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else? That's where the problem lies... the algorhythm is if any one of a series is empty, then it's an error, but if they are all ls then we go on... So the last one should show up as 0... I tried else $obligatoryFieldNotPresent = 0; but that doesn't want to work. I tried echo $obligatoryFieldNotPresent; just get a blank page... I can't figure out how to determine if anything is in the String... perhaps I should be checking for null elseif ($obligatoryFiledNotPresent == ) { $obligatoryFieldNotPresent = 0; } I tried that too, but same result... finally found the problem... wrong names for string and this is what now verifies correctly if (strlen($_POST[titleIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[first_nameIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[publisherIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[copyrightIN]) == ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[ISBNIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[languageIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (!empty($_POST['categoriesIN'])) { $obligatoryFieldNotPresent = 0; But now I have to figure out the workflow and see why it is not going the right way... wonder where I got some of this stuff... Glad to hear it, however just some critique of your coding style while you're still learning. You should leave no doubt as to what variables are for. Be descriptive, like: $theObligatoryFieldFromTheFormTheOneThatMustBePresentAndContainAvalueMayInFactBePresentOrYouWouldReceiveAnE_NOTICEHoweverTheFieldContainsNoValue = 1 Also look into isset() and empty(). -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] escape your variables
Sorry, but I have been waylaid by other posts... :'( and have not had the opportunity to finish my quest and I posted to mysql but they are not very helpful I see I was not very clear below and will annotate below. But the problem is still there, I cannot figure out how to sanitize with mysql_real_escape_string(). I have tried to use it but cannot figure out where it should go... according to the php manual, but I see tat I have to have an active db connection; so how do I sanitize when this is a file for connecting and in an include file? Here is an include file that connects to the database: ? // db1.php // SQL login parameters for local environment $local_dbhost = localhost;// normally localhost $local_dbuser = root;// your local database user name $local_dbpass = gu...@#$;// your local database password $local_dbname = biblane;// your local database name // SQL remote parameters for remote environment (ex: nomonthlyfees) $remote_dbhost= localhost;// normally localhost $remote_dbuser = root;// your remote database user name $remote_dbpass = gu...@#$;// your remote database password $remote_dbname = biblane;// your remote database name // Local server address $LOCAL_SERVER = 127.0.0.1; // CONNECT to DATABASE if ($_SERVER[REMOTE_ADDR] == $LOCAL_SERVER) { $dbhost = $local_dbhost; $dbuser = $local_dbuser; $dbpass = $local_dbpass; $dbname = $local_dbname; } else { $dbhost = $remote_dbhost; $dbuser = $remote_dbuser; $dbpass = $remote_dbpass; $dbname = $remote_dbname; } $db = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname,$db); //echo $dbname; //echo br; //echo $dbhost; //echo $dbuser; //echo $dbpass; if (!$db) { echo( PUnable to connect to the . database server at this time./P ); exit(); } // Select the database if (! mysql_select_db(biblane) ) { echo( PUnable to locate the biblane . database at this time./P ); exit(); } ? Eric Butera wrote: On Wed, Feb 18, 2009 at 8:34 AM, PJ af.gour...@videotron.ca wrote: To focus on mysql_real_escape_string, I am recapping... questions below QUOTE:== Instead of doing this (for an imaginary table): $sql = insert into table1(field1, field2) values ('$value1', '$value2'); do $sql = insert into table1(field1, field2) values (' . mysql_real_escape_string($value1) . ', ' . mysql_real_escape_string($value2) . '); Now $value1 and $value2 can only be used as data, they can't be used against you. If you don't do that, try adding a last name of O'Reilly - your code will break because of the ' in the name. When you say escape all your inputs - just what do you mean? Does that mean I need some special routines that have to be repeated over and over every time there is an input... but what do you mean by an input? And, from looking at all the comments in the manual, it's not clear just where to stop... input means anything a user gives you. Whether it's a first name, last name, a comment in a blog, a website url - anything you get from a user must be escaped. END QUOTE === So, I am more confused than ever... TWO QUESTIONS: 1. It seems to me that submitting username, password and database_name is pretty dangerous. How does one deal with that? Do you use mysql_real_escape_string? e.g. ?php $db_host = 'localhost'; $db_user = ''; $db_pwd = 'xx'; $database = 'join_tutorial'; $table = 'authorBook'; if (!mysql_connect($db_host, $db_user, $db_pwd)) die(Can't connect to database); if (!mysql_select_db($database)) die(Can't select database); // sending query $result = mysql_query(SELECT * FROM {$table}); No one seems to have resonded to the above question - how to sanitize this when there is no connection? Same idea as the upper include file... 2. How do you use mysql_real_escape_string on a string entered in a form page with input and $_POST where the inputs are strings like $titleIN, $authorINetc.? -- Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Escaping means making sure your data remains data in the context of using it. If you don't escape your data correctly depending on the context, then user input can break your applications. Also if your site is worthy of it, perhaps even a malicious user might try something, but usually what ends up happening is O'Henry gets a white page. Why? Well most code I come across has that horrid or die() following the query. Keep in mind that you want to escape your variable when you're using it only. You do not want to escape the actual variable itself, but a copy of it. This is why magic quotes is such a bad idea. It taints your actual data with slashes. There's more to it than just that, but you can research it on your own. So
Re: [PHP] whoami explanation
Shawn McKenzie wrote: Robert Cummings wrote: On Wed, 2009-03-04 at 15:48 -0600, Shawn McKenzie wrote: Whatever you do, please, please, please, for the love of all that is holy, please, do not vilify potatoes! ...or the Irish :-) Potatoes are best served sliced into sticks, pan-fried, covered in cheese curds, and then finally doused in beef gravy!! Cheers, Rob. O.K. you had me hooked until cheese curds :-P Potatoes are best served sliced into sticks, pan-fried, covered in ground beef, and then finally doused in beef gravy!! Wow, this is really high end gourmet fare... O:-) -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if elseif elseif elseif....
PJ wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ af.gour...@videotron.ca wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else? That's where the problem lies... the algorhythm is if any one of a series is empty, then it's an error, but if they are all ls then we go on... So the last one should show up as 0... I tried else $obligatoryFieldNotPresent = 0; but that doesn't want to work. I tried echo $obligatoryFieldNotPresent; just get a blank page... I can't figure out how to determine if anything is in the String... perhaps I should be checking for null elseif ($obligatoryFiledNotPresent == ) { $obligatoryFieldNotPresent = 0; } I tried that too, but same result... finally found the problem... wrong names for string and this is what now verifies correctly if (strlen($_POST[titleIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[first_nameIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[publisherIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[copyrightIN]) == ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[ISBNIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[languageIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (!empty($_POST['categoriesIN'])) { $obligatoryFieldNotPresent = 0; But now I have to figure out the workflow and see why it is not going the right way... wonder where I got some of this stuff... $obligatoryFieldNotPresent=null; foreach($_POST, as $value) { if(!empty($value)continue; $obligatoryFieldNotPresent=true; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] escape your variables
On Wed, Mar 4, 2009 at 8:04 PM, PJ af.gour...@videotron.ca wrote some stuff... You should do a little reading on some of the keywords that have been presented. Specifically you don't sanitize a value into your db. You escape it. Prepared statements are a way of doing this that makes it a bit harder to mess up. You have to have a connection to the server to properly escape your value because databases can have lots of different character encodings. Just blindly assuming latin1 is wrong. -- http://www.voom.me | EFnet: #voom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if elseif elseif elseif....
finally found the problem... wrong names for string and this is what now verifies correctly if (strlen($_POST[titleIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[first_nameIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[publisherIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[copyrightIN]) == ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[ISBNIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST[languageIN]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (!empty($_POST['categoriesIN'])) { $obligatoryFieldNotPresent = 0; I'd suggest something slightly different. $errors = array(); if (empty($_POST['title'])) { $errors[] = 'title'; } if (empty($_POST['first_nameIN'])) { $errors[] = 'first_nameIN'; } ... # If we found any errors, show a message! if (!empty($errors)) { echo You forgot to fill in these fields:br/; echo implode(',', $errors) . br/; } So your user knows what they missed. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] escape your variables
PJ wrote: Sorry, but I have been waylaid by other posts... :'( and have not had the opportunity to finish my quest and I posted to mysql but they are not very helpful I see I was not very clear below and will annotate below. But the problem is still there, I cannot figure out how to sanitize with mysql_real_escape_string(). I have tried to use it but cannot figure out where it should go... according to the php manual, but I see tat I have to have an active db connection; so how do I sanitize when this is a file for connecting and in an include file? Here is an include file that connects to the database: ? // db1.php // SQL login parameters for local environment $local_dbhost = localhost;// normally localhost $local_dbuser = root;// your local database user name $local_dbpass = gu...@#$;// your local database password $local_dbname = biblane;// your local database name // SQL remote parameters for remote environment (ex: nomonthlyfees) $remote_dbhost= localhost;// normally localhost $remote_dbuser = root;// your remote database user name $remote_dbpass = gu...@#$;// your remote database password $remote_dbname = biblane;// your remote database name // Local server address $LOCAL_SERVER = 127.0.0.1; // CONNECT to DATABASE if ($_SERVER[REMOTE_ADDR] == $LOCAL_SERVER) { $dbhost = $local_dbhost; $dbuser = $local_dbuser; $dbpass = $local_dbpass; $dbname = $local_dbname; } else { $dbhost = $remote_dbhost; $dbuser = $remote_dbuser; $dbpass = $remote_dbpass; $dbname = $remote_dbname; } $db = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname,$db); //echo $dbname; //echo br; //echo $dbhost; //echo $dbuser; //echo $dbpass; if (!$db) { echo( PUnable to connect to the . database server at this time./P ); exit(); } // Select the database if (! mysql_select_db(biblane) ) { echo( PUnable to locate the biblane . database at this time./P ); exit(); } ? Eric Butera wrote: On Wed, Feb 18, 2009 at 8:34 AM, PJ af.gour...@videotron.ca wrote: To focus on mysql_real_escape_string, I am recapping... questions below QUOTE:== Instead of doing this (for an imaginary table): $sql = insert into table1(field1, field2) values ('$value1', '$value2'); do $sql = insert into table1(field1, field2) values (' . mysql_real_escape_string($value1) . ', ' . mysql_real_escape_string($value2) . '); Now $value1 and $value2 can only be used as data, they can't be used against you. If you don't do that, try adding a last name of O'Reilly - your code will break because of the ' in the name. When you say escape all your inputs - just what do you mean? Does that mean I need some special routines that have to be repeated over and over every time there is an input... but what do you mean by an input? And, from looking at all the comments in the manual, it's not clear just where to stop... input means anything a user gives you. Whether it's a first name, last name, a comment in a blog, a website url - anything you get from a user must be escaped. END QUOTE === So, I am more confused than ever... TWO QUESTIONS: 1. It seems to me that submitting username, password and database_name is pretty dangerous. How does one deal with that? Do you use mysql_real_escape_string? e.g. ?php $db_host = 'localhost'; $db_user = ''; $db_pwd = 'xx'; $database = 'join_tutorial'; $table = 'authorBook'; if (!mysql_connect($db_host, $db_user, $db_pwd)) die(Can't connect to database); if (!mysql_select_db($database)) die(Can't select database); // sending query $result = mysql_query(SELECT * FROM {$table}); No one seems to have resonded to the above question - how to sanitize this when there is no connection? Same idea as the upper include file... Problem: if there's no connection, how can you fetch anything from a table? Using a variable is fine for a table name. You only need to escape data coming from a user going in to your database. example: insert into address_book (first_name, last_name) values ($_POST['first_name'], $_POST['last_name']); first_name and last_name come from a form of some sorts - it's user input. It needs to be escaped. $query = insert into table(field1, field2) values (' . mysql_real_escape_string($_POST['first_name']) . ', ' . mysql_real_escape_string($_POST['last_name']) . '); 'first_name' and 'last_name' are the names of your input fields on your form. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php