php-general Digest 9 Aug 2009 10:06:11 -0000 Issue 6275
php-general Digest 9 Aug 2009 10:06:11 - Issue 6275 Topics (messages 296493 through 296504): Re: ZCE Question 296493 by: Eddie Drapkin 296503 by: Richard Heyes Re: PHP programming strategy 296494 by: Clancy Readline Thread Safety Question 296495 by: MIke Alaimo use preg_replace to nix and line with display: none 296496 by: Rob Gould 296497 by: LinuxManMikeC 296498 by: Michael A. Peters 296499 by: Rob Gould 296500 by: Rob Gould 296501 by: LinuxManMikeC APC optimization in CLI 296502 by: Matic Meznar 296504 by: Robert Cummings Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Sat, Aug 8, 2009 at 4:18 PM, Augusto Flavioafla...@gmail.com wrote: Has someone an clue about this zce question: The following is a common XML structure used in service oriented architectures, what does it represent? ?xml version=1.0? methodCall methodNamemyMethod/methodName params param valuestringHI!/string/value /param /params /methodCall Answer... None of the above A fragment of a complete SOAP request XML-RPC REST SOAP i think the answer is: SOAP some idea? thanks Augusto Morais Looks like XMLRPC to me. ---End Message--- ---BeginMessage--- Hi, Looks like XMLRPC to me. Agreed - it's not gibberish so it can't be SOAP... -- Richard Heyes HTML5 graphing: RGraph - www.rgraph.net (updated 8th August) Lots of PHP and Javascript code - http://www.phpguru.org ---End Message--- ---BeginMessage--- On Sat, 8 Aug 2009 07:53:42 -0400, tedd.sperl...@gmail.com (tedd) wrote: You don't need the width=210 height=300. For example, this works: div class=pfm img src=Images/Nx.jpg p class=nrmltextnYanni Nx /p p class=notetextnSally Riordan Scholarship, 2007- /p /div I have read that if you omit the dimensions you will sometimes see the page reshuffle itself as it loads, because the browser starts loading, then finds the dimensions are incompatible with it's initial assumptions. I don't know how serious a problem this is, but if the dimensions prevent it happening I am happy to provide them. In my scheme of things p has normal paragraph spacing, 'nrmltxtn' has zero spacing, and 'notetxtn' is a size smaller, also with zero line spacing. Also, if you use first-child, it could be taken down to: div class=pfm img src=Images/Nx.jpg pYanni Nx /p pSally Riordan Scholarship, 2007- /p /div Except that line 2 is smaller than line 1. In my scheme of things p has normal paragraph spacing, 'nrmltxtn' has zero spacing, and 'notetxtn' is a size smaller, also with zero line spacing. I could redefine p h4 for this class (provided I never want to use the normal values in it), but there is something to be said for having a standard set of fonts, and always knowing what I will get, rather than having p mean something different every time I use it. And, as others have pointed out, a few thousand bytes more or less is totally immaterial. ---End Message--- ---BeginMessage--- Hello, I am using PHP 5.3 with readline support. I read that PHP readline is never thread safe. I do not use the readline functions in a web application. What implications does this warning of thread safety have with respect to running normal web applications using apache2? Thank You, Mike ---End Message--- ---BeginMessage--- I have a bunch of bullets in a list coming from a previous post, and I need to eliminate any line from this string that contains display: none li id=bullet_ug1_col2_9 style=display: list-item;Reserved Frontstretch Tower Ticket to the Camping World 300 on Saturday /li li id=bullet_2_9 style=display: list-item;Reserved Frontstretch Tower Ticket to the Daytona 500 on Sunday /li li id=bullet_addon_col2_9 style=display: none;/ li id=bullet_addon3_9 style=display: none;/ li id=bullet_option2_col4_9 style=display: none;/ li id=bullet_option2_col3_9 style=display: none;/ li id=bullet_option2_col2_9 style=display: none;/ li id=bullet_option2_col1_9 style=display: none;/ li id=bullet_option3_col4_9 style=display: none;/ li id=bullet_option3_col3_9 style=display: none;/ li id=bullet_option3_col2_9 style=display: none;/ li id=bullet_option3_col1_9 style=display: none;/ li id=bullet_option4_col4_9 style=display: none;/ li id=bullet_option4_col3_9 style=display: none;/ li id=bullet_option4_col2_9 style=display: none;/ li id=bullet_option4_col1_9 style=display: none;/ li id=bullet_option5_col4_9 style=display: none;/ li id=bullet_option5_col3_9 style=display: none;/ li id=bullet_option5_col2_9 style=display: none;/ li
php-general Digest 9 Aug 2009 22:31:48 -0000 Issue 6276
php-general Digest 9 Aug 2009 22:31:48 - Issue 6276 Topics (messages 296505 through 296524): Re: Displaying user data and picture 296505 by: tedd Question: what are frameworks? 296506 by: Parham Doustdar 296509 by: Ralph Deffke 296510 by: Michael A. Peters 296511 by: Tony Marston 296512 by: Sudheer Satyanarayana 296513 by: Bastien Koert Re: PHP programming strategy 296507 by: tedd 296508 by: Ashley Sheridan Re: Can php be cause a strain on a web server 296514 by: Daniel Brown 296517 by: Jerry Wilborn 296522 by: Daniel Brown MySQL auto_increment fields Server version: 5.1.32-community-log 296515 by: Ralph Deffke 296516 by: Jerry Wilborn 296519 by: Ralph Deffke 296521 by: Ralph Deffke 296523 by: Nisse Engström 296524 by: tedd Re: APC optimization in CLI 296518 by: Mattias Thorslund 296520 by: Robert Cummings Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- At 9:00 AM -0400 8/7/09, Bob McConnell wrote: From: Ralph Deffke however there are some reasonable reasons to store a image in the database. 1. if u have no access to write files to the disk this is the case in most free hosting services they give u php and mysql and thats it 2. if u want some access control to the image, e.g. login controlled. server admins dont like u playing arround with the htaccess file 3. its easy in those and other cases 4. image directores are public, and apear in search engines 5. There is a natural relationship between the images and other data already in the database, such as ID photos linked to employee numbers. 6. When you move to another server, you simply move the database and not the database AND image directories. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- Hi there, I've heard of frameworks, but I don't quite know what they are used for. I've done a little search on the internet, but even though I've been able to find different PHP frameworks, I'm not quite sure what they offer, or in what they differ, or why I shouldn't just use PHP as it is. Can someone give a little bit of explaination? Thanks! -- --- Contact info: Skype: parham-d MSN: fire_lizard16 at hotmail dot com email: parham90 at GMail dot com---End Message--- ---BeginMessage--- good question !! I think the word framework is modern fashion term in the first case. in former days we used to say library C comes with a standard library, in modern words C comes with a standard framework. I use my own framework, means I reuse my code written for similar things before, so I use my framework. its like a painter, he uses a ready made frame to paint what ever he wants, u can use the yahoo UI framework to paint ur page. A operating system is a framework unifieing the underlaying hardware. as in former days u said library u say more modern framework in both cases its a bunch of functions doing some stuff the user of the framework hasn't to take care about by using the framework. hope that helps ralph ralph_def...@yahoo.de Parham Doustdar parha...@gmail.com wrote in message news:5c.b0.05105.f18be...@pb1.pair.com... Hi there, I've heard of frameworks, but I don't quite know what they are used for. I've done a little search on the internet, but even though I've been able to find different PHP frameworks, I'm not quite sure what they offer, or in what they differ, or why I shouldn't just use PHP as it is. Can someone give a little bit of explaination? Thanks! -- --- Contact info: Skype: parham-d MSN: fire_lizard16 at hotmail dot com email: parham90 at GMail dot com ---End Message--- ---BeginMessage--- Ralph Deffke wrote: good question !! I think the word framework is modern fashion term in the first case. in former days we used to say library C comes with a standard library, in modern words C comes with a standard framework. I use my own framework, means I reuse my code written for similar things before, so I use my framework. its like a painter, he uses a ready made frame to paint what ever he wants, u can use the yahoo UI framework to paint ur page. A operating system is a framework unifieing the underlaying hardware. as in former days u said library u say more modern framework in both cases its a bunch of functions doing some stuff the user of the framework hasn't to take care about by using the framework. hope that helps I think framework is different than library. Pear is a collection of libraries. PECL (and binary modules that ship with php) are a collection of libraries. I
Re: [PHP] use preg_replace to nix and line with display: none
I wish I could say this works, but I'm not having success with this pattern. All the lines with display: none are still in the $bl string. On Aug 9, 2009, at 1:50 AM, LinuxManMikeC wrote: li id=bullet_ug1_col2_9 style=display: list-item;Reserved Frontstretch Tower Ticket to the Camping World 300 on Saturday /li li id=bullet_2_9 style=display: list-item;Reserved Frontstretch Tower Ticket to the Daytona 500 on Sunday /li li id=bullet_addon_col2_9 style=display: none;/ li id=bullet_addon3_9 style=display: none;/ li id=bullet_option2_col4_9 style=display: none;/ li id=bullet_option2_col3_9 style=display: none;/ li id=bullet_option2_col2_9 style=display: none;/ li id=bullet_option2_col1_9 style=display: none;/ li id=bullet_option3_col4_9 style=display: none;/ li id=bullet_option3_col3_9 style=display: none;/ li id=bullet_option3_col2_9 style=display: none;/ li id=bullet_option3_col1_9 style=display: none;/ li id=bullet_option4_col4_9 style=display: none;/ li id=bullet_option4_col3_9 style=display: none;/ li id=bullet_option4_col2_9 style=display: none;/ li id=bullet_option4_col1_9 style=display: none;/ li id=bullet_option5_col4_9 style=display: none;/ li id=bullet_option5_col3_9 style=display: none;/ li id=bullet_option5_col2_9 style=display: none;/ li id=bullet_option5_col1_9 style=display: none;/ li id=bullet_5_9Official Daytona 500 Race Week Program /li li id=bullet_6_9Benchwarmer Sports Souvenir Ticket Protector and Lanyard /li li id=bullet_7_9On Site Benchwarmer Tour Staff /li li id=bullet_8_9All Taxes and Service Charges/li I'm CLOSE, but since the style = display:[space]none my preg_replace doesn't catch it. Can anyone help me determine the correct preg_replace pattern to do this? $bl = $_POST['bulletlist']; $pattern = '|^.+?display:none.+?$|mi'; $bl = preg_replace($pattern,'',$bl); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I found your use of ? rather... creative... Anyway, just add the condition 0 or more whitespace to your regex. $pattern = '|^.+display:\w*none.+$|'; I found your use of ? rather... creative... Anyway, just add the condition 0 or more whitespace to your regex. $pattern = '|^.+display:\w*none.+$|';
Re: [PHP] use preg_replace to nix and line with display: none
Yay! That worked. Thanks! On Aug 9, 2009, at 1:53 AM, Michael A. Peters wrote: Rob Gould wrote: I have a bunch of bullets in a list coming from a previous post, and I need to eliminate any line from this string that contains display: none li id=bullet_ug1_col2_9 style=display: list-item;Reserved Frontstretch Tower Ticket to the Camping World 300 on Saturday /li li id=bullet_2_9 style=display: list-item;Reserved Frontstretch Tower Ticket to the Daytona 500 on Sunday /li li id=bullet_addon_col2_9 style=display: none;/ li id=bullet_addon3_9 style=display: none;/ li id=bullet_option2_col4_9 style=display: none;/ li id=bullet_option2_col3_9 style=display: none;/ li id=bullet_option2_col2_9 style=display: none;/ li id=bullet_option2_col1_9 style=display: none;/ li id=bullet_option3_col4_9 style=display: none;/ li id=bullet_option3_col3_9 style=display: none;/ li id=bullet_option3_col2_9 style=display: none;/ li id=bullet_option3_col1_9 style=display: none;/ li id=bullet_option4_col4_9 style=display: none;/ li id=bullet_option4_col3_9 style=display: none;/ li id=bullet_option4_col2_9 style=display: none;/ li id=bullet_option4_col1_9 style=display: none;/ li id=bullet_option5_col4_9 style=display: none;/ li id=bullet_option5_col3_9 style=display: none;/ li id=bullet_option5_col2_9 style=display: none;/ li id=bullet_option5_col1_9 style=display: none;/ li id=bullet_5_9Official Daytona 500 Race Week Program /li li id=bullet_6_9Benchwarmer Sports Souvenir Ticket Protector and Lanyard /li li id=bullet_7_9On Site Benchwarmer Tour Staff /li li id=bullet_8_9All Taxes and Service Charges/li I'm CLOSE, but since the style = display:[space]none my preg_replace doesn't catch it. Can anyone help me determine the correct preg_replace pattern to do this? $bl = $_POST['bulletlist']; $pattern = '|^.+?display:none.+?$|mi'; $bl = preg_replace($pattern,'',$bl); Easy to do with xml tools if your input is easily manipulated by xml tools, but try this: $pattern = '/li[^]*style=display: none[^]*/'; not tried myself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] use preg_replace to nix and line with display: none
On Sun, Aug 9, 2009 at 12:17 AM, Rob Gouldgould...@mac.com wrote: I wish I could say this works, but I'm not having success with this pattern. All the lines with display: none are still in the $bl string. On Aug 9, 2009, at 1:50 AM, LinuxManMikeC wrote: li id=bullet_ug1_col2_9 style=display: list-item;Reserved Frontstretch Tower Ticket to the Camping World 300 on Saturday /li li id=bullet_2_9 style=display: list-item;Reserved Frontstretch Tower Ticket to the Daytona 500 on Sunday /li li id=bullet_addon_col2_9 style=display: none;/ li id=bullet_addon3_9 style=display: none;/ li id=bullet_option2_col4_9 style=display: none;/ li id=bullet_option2_col3_9 style=display: none;/ li id=bullet_option2_col2_9 style=display: none;/ li id=bullet_option2_col1_9 style=display: none;/ li id=bullet_option3_col4_9 style=display: none;/ li id=bullet_option3_col3_9 style=display: none;/ li id=bullet_option3_col2_9 style=display: none;/ li id=bullet_option3_col1_9 style=display: none;/ li id=bullet_option4_col4_9 style=display: none;/ li id=bullet_option4_col3_9 style=display: none;/ li id=bullet_option4_col2_9 style=display: none;/ li id=bullet_option4_col1_9 style=display: none;/ li id=bullet_option5_col4_9 style=display: none;/ li id=bullet_option5_col3_9 style=display: none;/ li id=bullet_option5_col2_9 style=display: none;/ li id=bullet_option5_col1_9 style=display: none;/ li id=bullet_5_9Official Daytona 500 Race Week Program /li li id=bullet_6_9Benchwarmer Sports Souvenir Ticket Protector and Lanyard /li li id=bullet_7_9On Site Benchwarmer Tour Staff /li li id=bullet_8_9All Taxes and Service Charges/li I'm CLOSE, but since the style = display:[space]none my preg_replace doesn't catch it. Can anyone help me determine the correct preg_replace pattern to do this? $bl = $_POST['bulletlist']; $pattern = '|^.+?display:none.+?$|mi'; $bl = preg_replace($pattern,'',$bl); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I found your use of ? rather... creative... Anyway, just add the condition 0 or more whitespace to your regex. $pattern = '|^.+display:\w*none.+$|'; I found your use of ? rather... creative... Anyway, just add the condition 0 or more whitespace to your regex. $pattern = '|^.+display:\w*none.+$|'; Sorry... my bad... its \s. I need some sleep. $pattern = '|^.+display:\s*none.+$|'; Also, if you're certain you'll only ever have one space there, you can just say that explicitly. $pattern = '|^.+display: none.+$|'; But I prefer to leave things open for robustness. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] APC optimization in CLI
Hi, When running a PHP script from CLI, does APC optimize it before execution, or does APC only provide the apc_*() functions when runing in CLI mode? Happy day, Matic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ZCE Question
Hi, Looks like XMLRPC to me. Agreed - it's not gibberish so it can't be SOAP... -- Richard Heyes HTML5 graphing: RGraph - www.rgraph.net (updated 8th August) Lots of PHP and Javascript code - http://www.phpguru.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC optimization in CLI
Matic Meznar wrote: Hi, When running a PHP script from CLI, does APC optimize it before execution, or does APC only provide the apc_*() functions when runing in CLI mode? If I recall correctly, none of the accelerators work in CLI mode. 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] Displaying user data and picture
At 9:00 AM -0400 8/7/09, Bob McConnell wrote: From: Ralph Deffke however there are some reasonable reasons to store a image in the database. 1. if u have no access to write files to the disk this is the case in most free hosting services they give u php and mysql and thats it 2. if u want some access control to the image, e.g. login controlled. server admins dont like u playing arround with the htaccess file 3. its easy in those and other cases 4. image directores are public, and apear in search engines 5. There is a natural relationship between the images and other data already in the database, such as ID photos linked to employee numbers. 6. When you move to another server, you simply move the database and not the database AND image directories. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question: what are frameworks?
Hi there, I've heard of frameworks, but I don't quite know what they are used for. I've done a little search on the internet, but even though I've been able to find different PHP frameworks, I'm not quite sure what they offer, or in what they differ, or why I shouldn't just use PHP as it is. Can someone give a little bit of explaination? Thanks! -- --- Contact info: Skype: parham-d MSN: fire_lizard16 at hotmail dot com email: parham90 at GMail dot com
Re: [PHP] Re: PHP programming strategy
At 10:54 AM +1000 8/9/09, Clancy wrote: On Sat, 8 Aug 2009 07:53:42 -0400, tedd.sperl...@gmail.com (tedd) wrote: Also, if you use first-child, it could be taken down to: div class=pfm img src=Images/Nx.jpg pYanni Nx /p pSally Riordan Scholarship, 2007- /p /div Except that line 2 is smaller than line 1. In my scheme of things p has normal paragraph spacing, 'nrmltxtn' has zero spacing, and 'notetxtn' is a size smaller, also with zero line spacing. Yes, but using first-child you can make the first child p of class pfm whatever you want while making all other children p's in the class something else. But, as it was said, IE's have problems with first-child rules. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
On Sun, 2009-08-09 at 07:55 -0400, tedd wrote: At 10:54 AM +1000 8/9/09, Clancy wrote: On Sat, 8 Aug 2009 07:53:42 -0400, tedd.sperl...@gmail.com (tedd) wrote: Also, if you use first-child, it could be taken down to: div class=pfm img src=Images/Nx.jpg pYanni Nx /p pSally Riordan Scholarship, 2007- /p /div Except that line 2 is smaller than line 1. In my scheme of things p has normal paragraph spacing, 'nrmltxtn' has zero spacing, and 'notetxtn' is a size smaller, also with zero line spacing. Yes, but using first-child you can make the first child p of class pfm whatever you want while making all other children p's in the class something else. But, as it was said, IE's have problems with first-child rules. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com How does IE8 fare with selectors in CSS? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question: what are frameworks?
good question !! I think the word framework is modern fashion term in the first case. in former days we used to say library C comes with a standard library, in modern words C comes with a standard framework. I use my own framework, means I reuse my code written for similar things before, so I use my framework. its like a painter, he uses a ready made frame to paint what ever he wants, u can use the yahoo UI framework to paint ur page. A operating system is a framework unifieing the underlaying hardware. as in former days u said library u say more modern framework in both cases its a bunch of functions doing some stuff the user of the framework hasn't to take care about by using the framework. hope that helps ralph ralph_def...@yahoo.de Parham Doustdar parha...@gmail.com wrote in message news:5c.b0.05105.f18be...@pb1.pair.com... Hi there, I've heard of frameworks, but I don't quite know what they are used for. I've done a little search on the internet, but even though I've been able to find different PHP frameworks, I'm not quite sure what they offer, or in what they differ, or why I shouldn't just use PHP as it is. Can someone give a little bit of explaination? Thanks! -- --- Contact info: Skype: parham-d MSN: fire_lizard16 at hotmail dot com email: parham90 at GMail dot com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question: what are frameworks?
Ralph Deffke wrote: good question !! I think the word framework is modern fashion term in the first case. in former days we used to say library C comes with a standard library, in modern words C comes with a standard framework. I use my own framework, means I reuse my code written for similar things before, so I use my framework. its like a painter, he uses a ready made frame to paint what ever he wants, u can use the yahoo UI framework to paint ur page. A operating system is a framework unifieing the underlaying hardware. as in former days u said library u say more modern framework in both cases its a bunch of functions doing some stuff the user of the framework hasn't to take care about by using the framework. hope that helps I think framework is different than library. Pear is a collection of libraries. PECL (and binary modules that ship with php) are a collection of libraries. I don't use pre-packaged frameworks so it probably is best for me not to define them, but I think they are a basically a collection of classes and libraries intended to make rapid development of web applications faster. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question: what are frameworks?
Parham Doustdar parha...@gmail.com wrote in message news:5c.b0.05105.f18be...@pb1.pair.com... Hi there, I I've heard of frameworks, but I don't quite know what they are used for. I've done a little search on the internet, but even though I've been able to find different PHP frameworks, I'm not quite sure what they offer, or in what they differ, or why I shouldn't just use PHP as it is. Can someone give a little bit of explaination? Thanks! A framework is more than just a simple collection of libraries, it is a support structure in which another software project (application) can be organised and developed. The simplest framework is nothing more than a menu system which informs the user what application components are available, and provides the means for the user to choose an option from that list and cause it to executed or activated. This means that each application component can be developed without the need for any code to handle the menu functionality. The component is simply plugged into the framework and it is instantly available. This simple framework can be extended to provide other features, such as security. Instead of allowing just anybody to access the application it may need to be restricted to registered users only, and this can be accomplished by inserting a login mechanism into the framework. It may then be decided that not every user is allowed to access every component, so additional access control mechanisms can be built in. It should be possible to extend the framework without having to touch every single component that runs within it. The framework may provide other facilities, such as providing the ability to navigate between components, to pass messages between components, audit logging, workflow, et cetera. This allows the application programmers to concentrate on the needs of the application without being bogged down with other details. Some people seem to think that each application needs its own separate framework in order to satisfy the unique needs of that application, but they have simply not learned to abstract out that functionality which is common to every application. It is therefore possible to build a framework that can be used by any number of different applications. RADICORE is such a framework. An advantage of a reusable framework is that once a programmer has become familiar with it he can carry that knowledge forward into the next application without having to learn a different framework. A framework is a support structure in which another software project (application) can be organised and developed. The simplest framework is nothing more than a menu system which informs the user what application components are available, and provides the means for the user to choose an option from that list and cause it to executed or activated. This means that each application component can be developed without the need for any code to handle the menu functionality. The component is simply plugged into the framework and it is instantly available. This simple framework can be extended to provide other features, such as security. Instead of allowing just anybody to access the application it may need to be restricted to registered users only, and this can be accomplished by inserting a login mechanism into the framework. It may then be decided that not every user is allowed to access every component, so additional access control mechanisms can be built in. It should be possible to extend the framework without having to touch every single component that runs within it. The framework may provide other facilities, such as providing the ability to navigate between components, to pass messages between components, audit logging, workflow, et cetera. This allows the application programmers to concentrate on the needs of the application without being bogged down with other details. Some people seem to think that each application needs its own separate framework in order to satisfy the unique needs of that application, but they have simply not learned to abstract out that functionality which is common to every application. It is therefore possible to build a framework that can be used by any number of different applications. RADICORE is such a framework. An advantage of a reusable framework is that once a programmer has become familiar with it he can carry that knowledge forward into the next application without having to learn a different framework. There are lots of different PHP frameworks available for the simple reason that there are lots of different PHP programmers who each have their own methodologies and techniques. Some frameworks are written to aid the development of particular kinds of software, such as building web sites or CMS systems, whereas others (like Radicore) are for building web applications. -- Tony Marston http://www.tonymarston.net http://www.radicore.org -- PHP General Mailing List
Re: [PHP] Re: Question: what are frameworks?
Michael A. Peters wrote: Ralph Deffke wrote: good question !! I think the word framework is modern fashion term in the first case. in former days we used to say library C comes with a standard library, in modern words C comes with a standard framework. I use my own framework, means I reuse my code written for similar things before, so I use my framework. its like a painter, he uses a ready made frame to paint what ever he wants, u can use the yahoo UI framework to paint ur page. A operating system is a framework unifieing the underlaying hardware. as in former days u said library u say more modern framework in both cases its a bunch of functions doing some stuff the user of the framework hasn't to take care about by using the framework. hope that helps I think framework is different than library. Pear is a collection of libraries. PECL (and binary modules that ship with php) are a collection of libraries. I don't use pre-packaged frameworks so it probably is best for me not to define them, but I think they are a basically a collection of classes and libraries intended to make rapid development of web applications faster. You might consider reading this: http://en.wikipedia.org/wiki/Software_framework -- With warm regards, Sudheer. S Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, Personal: http://sudheer.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Question: what are frameworks?
On Sun, Aug 9, 2009 at 9:29 AM, Sudheer Satyanarayanasudhee...@binaryvibes.co.in wrote: Michael A. Peters wrote: Ralph Deffke wrote: good question !! I think the word framework is modern fashion term in the first case. in former days we used to say library C comes with a standard library, in modern words C comes with a standard framework. I use my own framework, means I reuse my code written for similar things before, so I use my framework. its like a painter, he uses a ready made frame to paint what ever he wants, u can use the yahoo UI framework to paint ur page. A operating system is a framework unifieing the underlaying hardware. as in former days u said library u say more modern framework in both cases its a bunch of functions doing some stuff the user of the framework hasn't to take care about by using the framework. hope that helps I think framework is different than library. Pear is a collection of libraries. PECL (and binary modules that ship with php) are a collection of libraries. I don't use pre-packaged frameworks so it probably is best for me not to define them, but I think they are a basically a collection of classes and libraries intended to make rapid development of web applications faster. You might consider reading this: http://en.wikipedia.org/wiki/Software_framework -- With warm regards, Sudheer. S Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, Personal: http://sudheer.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It's also worth noting that the frameworks goals may differ. The CodeIgniter framework has support for both PHP 4 and PHP5, which makes it more flexible where hosts have not upgraded to php5 for whatever reason. Many of the others (like cake, symfony and zend) tend to only support php5 and are also more object oriented from a coding perspective. Then there implementation features; CodeIgniter has a smaller learning curve, footprint and is faster than many of the others. Zend allows developers to pick and choose the framework components to use as well having a very rich feature set. symfony has a full ORM layers that handles mapping object to the database layer. Cake, symfony and zend offer features to generate the basic classes for each database table. In all cases the idea of the framework is to abstract the heavy lifting (the common features of developing uploaders, database handlers, forms handling, validation etc) and allowing developers to simply use the framework functionality to handle that, freeing up time to focus on getting the business logic of the application in place. -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can php be cause a strain on a web server
On Sat, Aug 8, 2009 at 11:08, Jerry Wilbornjerrywilb...@gmail.com wrote: You're going to have to be more specific. There are very few problems where this is absolutely no solution. And you're going to have to read what he said again and understand the context of the question and answer. It requires no more specifics unless it's being explained to a pre-schooler. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL auto_increment fields Server version: 5.1.32-community-log
Hi all, I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. ralph_def...@yahoo.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL auto_increment fields Server version: 5.1.32-community-log
ALTER TABLE T1 AUTO_INCREMENT=1; It's likely that you dropped every record and expected the auto_increment to reset. Jerry Wilborn jerrywilb...@gmail.com On Sun, Aug 9, 2009 at 1:17 PM, Ralph Deffke ralph_def...@yahoo.de wrote: Hi all, I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. ralph_def...@yahoo.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can php be cause a strain on a web server
You seem nice. Jerry Wilborn jerrywilb...@gmail.com On Sun, Aug 9, 2009 at 12:54 PM, Daniel Brown danbr...@php.net wrote: On Sat, Aug 8, 2009 at 11:08, Jerry Wilbornjerrywilb...@gmail.com wrote: You're going to have to be more specific. There are very few problems where this is absolutely no solution. And you're going to have to read what he said again and understand the context of the question and answer. It requires no more specifics unless it's being explained to a pre-schooler. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig
Re: [PHP] APC optimization in CLI
Robert Cummings wrote: Matic Meznar wrote: Hi, When running a PHP script from CLI, does APC optimize it before execution, or does APC only provide the apc_*() functions when runing in CLI mode? If I recall correctly, none of the accelerators work in CLI mode. There is a php.ini setting named apc.enable_cli, which would suggest otherwise. I tried enabling it, and it seems my CLI script is a little faster actually. Highly unscientific but looks like about 10%. Cheers, Mattias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL auto_increment fields Server version: 5.1.32-community-log
no this is not the point ! if I do this, the next auto_increment is still 10720 i can do what I want however the is defined long unsigned unique auto_increment, what happens is in t1 the value is set to 10720 in t2 the next value ist set to 10721 while the next record in t1 gets 10721. it seems like the values in this field are unique OVER the whole database. very strange to me... ralph_def...@yahoo.de Jerry Wilborn jerrywilb...@gmail.com wrote in message news:3f4628f60908091202s67205256o222f22a0bfb61...@mail.gmail.com... ALTER TABLE T1 AUTO_INCREMENT=1; It's likely that you dropped every record and expected the auto_increment to reset. Jerry Wilborn jerrywilb...@gmail.com On Sun, Aug 9, 2009 at 1:17 PM, Ralph Deffke ralph_def...@yahoo.de wrote: Hi all, I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. ralph_def...@yahoo.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC optimization in CLI
Mattias Thorslund wrote: Robert Cummings wrote: Matic Meznar wrote: Hi, When running a PHP script from CLI, does APC optimize it before execution, or does APC only provide the apc_*() functions when runing in CLI mode? If I recall correctly, none of the accelerators work in CLI mode. There is a php.ini setting named apc.enable_cli, which would suggest otherwise. I tried enabling it, and it seems my CLI script is a little faster actually. Highly unscientific but looks like about 10%. I stand corrected. However, accelerators don't make scripts faster per se. They merely cut out the script reading and parsing time. So, while you may experience 10% gain within the first second of your script running, the use of an accelerator should have no bearing down the road except for the initial dynamic load of other scripts at runtime. Long running scripts will see almost no benefit from an accelerator. This is the general reason why CLI acceleration isn't very useful. That said though, one could certainly glean an advantage if they had a cron job or other daemon that was loading a script often. 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] MySQL auto_increment fields Server version: 5.1.32-community-log
no this is not the point ! if I do this, the next auto_increment is still 10720 i can do what I want however the field is defined long unsigned unique auto_increment, what happens is in t1 the value is set to 10720 in t2 the next value ist set to 10721 while the next record in t1 gets 10722. it seems like the values in this field are unique OVER the whole database. very strange to me... ralph_def...@yahoo.de Jerry Wilborn jerrywilb...@gmail.com wrote in message news:3f4628f60908091202s67205256o222f22a0bfb61...@mail.gmail.com... ALTER TABLE T1 AUTO_INCREMENT=1; It's likely that you dropped every record and expected the auto_increment to reset. Jerry Wilborn jerrywilb...@gmail.com On Sun, Aug 9, 2009 at 1:17 PM, Ralph Deffke ralph_def...@yahoo.de wrote: Hi all, I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. ralph_def...@yahoo.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can php be cause a strain on a web server
On Sun, Aug 9, 2009 at 15:03, Jerry Wilbornjerrywilb...@gmail.com wrote: You seem nice. I have my moments. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Check out our great hosting and dedicated server deals at http://twitter.com/pilotpig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL auto_increment fields Server version: 5.1.32-community-log
On Sun, 9 Aug 2009 20:17:15 +0200, Ralph Deffke wrote: I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. Did you Google for it? I found the following page that might be relevant: http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html Beginning with MySQL 5.1.22, InnoDB provides a locking strategy that significantly improves scalability and performance of SQL statements that add rows to tables with AUTO_INCREMENT columns. ... InnoDB uses the following algorithm to initialize the auto-increment counter for a table t that contains an AUTO_INCREMENT column named ai_col: After a server startup, for the first insert into a table t, InnoDB executes the equivalent of this statement: SELECT MAX(ai_col) FROM t FOR UPDATE; InnoDB increments by one the value retrieved by the statement and assigns it to the column and to the auto-increment counter for the table. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL auto_increment fields Server version: 5.1.32-community-log
At 8:17 PM +0200 8/9/09, Ralph Deffke wrote: Hi all, I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. ralph_def...@yahoo.de Why be concerned about it? What difference does it make? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
At 1:05 PM +0100 8/9/09, Ashley Sheridan wrote: On Sun, 2009-08-09 at 07:55 -0400, tedd wrote: But, as it was said, IE's have problems with first-child rules. How does IE8 fare with selectors in CSS? Thanks, Ash tedd = clue-- or tedd clue tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL auto_increment fields Server version: 5.1.32-community-log
I would like to have a KNOWN status of my database after a NEW installation of the application, because the further installation relais on information stored in record 1 of each table. tedd tedd.sperl...@gmail.com wrote in message news:p06240801c6a4fe331...@[192.168.1.100]... At 8:17 PM +0200 8/9/09, Ralph Deffke wrote: Hi all, I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. ralph_def...@yahoo.de Why be concerned about it? What difference does it make? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP programming strategy
On Sun, Aug 9, 2009 at 6:33 PM, teddtedd.sperl...@gmail.com wrote: At 1:05 PM +0100 8/9/09, Ashley Sheridan wrote: On Sun, 2009-08-09 at 07:55 -0400, tedd wrote: But, as it was said, IE's have problems with first-child rules. How does IE8 fare with selectors in CSS? Thanks, Ash tedd = clue-- or tedd clue tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php IE8 is the most CSS2 standards compliant browser, if I recall they submitted 5 or 6 dozen tests to the w3c that they were the only browser that passed. As far as selectors go: http://msdn.microsoft.com/en-us/library/cc351024%28VS.85%29.aspx#selectors looks to me like they're fully compliant with CSS2.1. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL auto_increment fields Server version: 5.1.32-community-log
this is a very good startup for the issue. now the question is where does it get the value if there is no max(ai) or when I do an insert in an empty table with the ai field set to 1 where does the innoDB get the next ai value 10720 ? I assume that the SELECT MAX(ai_col) FROM t FOR UPDATE; return is incremented by 1 so how does this end up with 10720? anyway, ur statement shows that there has changed somethimg definately. but what? maid be there is some flag telling the kernel that ai fields should be unique throughout the database? some left behind of the cluster version of mySQL? Nisse Engström news.nospam.0ixbt...@luden.se wrote in message news:91.f7.55947.dc74f...@pb1.pair.com... On Sun, 9 Aug 2009 20:17:15 +0200, Ralph Deffke wrote: I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. Did you Google for it? I found the following page that might be relevant: http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html Beginning with MySQL 5.1.22, InnoDB provides a locking strategy that significantly improves scalability and performance of SQL statements that add rows to tables with AUTO_INCREMENT columns. ... InnoDB uses the following algorithm to initialize the auto-increment counter for a table t that contains an AUTO_INCREMENT column named ai_col: After a server startup, for the first insert into a table t, InnoDB executes the equivalent of this statement: SELECT MAX(ai_col) FROM t FOR UPDATE; InnoDB increments by one the value retrieved by the statement and assigns it to the column and to the auto-increment counter for the table. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL auto_increment fields Server version: 5.1.32-community-log
I should mention that I use MyISAM as storage engine what makes it even more wiered. Nisse Engström news.nospam.0ixbt...@luden.se wrote in message news:91.f7.55947.dc74f...@pb1.pair.com... On Sun, 9 Aug 2009 20:17:15 +0200, Ralph Deffke wrote: I'm facing the fact that it seems that auto_increment fields in a table not start at 1 like it was in earlier versions even if I install mySQL brand new creating all tables new. it seems to me that auto_increments handling has changed to older version. is somebody out there who can give me a quick background about auto_increment and how and if I can control the behavior of mySQL about them. Did you Google for it? I found the following page that might be relevant: http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html Beginning with MySQL 5.1.22, InnoDB provides a locking strategy that significantly improves scalability and performance of SQL statements that add rows to tables with AUTO_INCREMENT columns. ... InnoDB uses the following algorithm to initialize the auto-increment counter for a table t that contains an AUTO_INCREMENT column named ai_col: After a server startup, for the first insert into a table t, InnoDB executes the equivalent of this statement: SELECT MAX(ai_col) FROM t FOR UPDATE; InnoDB increments by one the value retrieved by the statement and assigns it to the column and to the auto-increment counter for the table. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] use preg_replace to nix and line with display: none
$pattern = '|^.+?display:none.+?$|mi'; [8] I found your use of ? rather... creative... Anyway, just add the You mean the non-greedy flag? I think that's necessary the way the regex was originally formulated -- without it, .+display would gobble up all of the list-items until the last one. Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reason for a Notice:.. on one site but not another? (Same code.)
Hi sunday coders, I've been using this kind of logic on one PHP site I work on to display one thing or another depending on whether the form was submitted or not: if($_POST['UserWishesDateRange']) { //--line 79 echo'submitted'; } else { echo'NOT submitted'; } and it works great on that site. But on another site it still works, but gives this error: Notice: Undefined index: UserWishesDateRange in /home/vs/site/phvs/bl/ 7solarsecrets/admin/trackingcode.html on line 79 I assume that is because the error display settings are set to a more rigorous level in this latter site. Is this correct? (Both sites reside on servers where I am not the admin.) John Butler (Govinda) govinda.webdnat...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reason for a Notice:.. on one site but not another? (Same code.)
On Aug 9, 2009, at 16:43, John Butler wrote: Hi sunday coders, I've been using this kind of logic on one PHP site I work on to display one thing or another depending on whether the form was submitted or not: if($_POST['UserWishesDateRange']) { //--line 79 echo'submitted'; } else { echo'NOT submitted'; } and it works great on that site. But on another site it still works, but gives this error: Notice: Undefined index: UserWishesDateRange in /home/vs/site/phvs/ bl/7solarsecrets/admin/trackingcode.html on line 79 I assume that is because the error display settings are set to a more rigorous level in this latter site. Is this correct? (Both sites reside on servers where I am not the admin.) John Butler (Govinda) govinda.webdnat...@gmail.com You could do something like: if(isset($_POST['UserWishesDateRange'])) { //--line 79 or you could use something like !empty($_POST['UserWishesDateRange']) echo 'submitted'; } else { echo 'NOT submitted'; } This will check if $_POST['UserWishesDateRange'] is set to something. You are getting the error message because $_POST ['UserWishesDateRange'] is not set if the form is not submitted. The server where you don't get the error message probably just has error reporting turned off. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reason for a Notice:.. on one site but not another? (Same code.)
John Butler wrote: if($_POST['UserWishesDateRange']) { //--line 79 echo'submitted'; } else { echo'NOT submitted'; } Try this instead: if (isset('UserWishesDateRange'])) { // [...stuff goes here...] } James -- Black holes are where God divided by zero. --Steven Wright -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reason for a Notice:.. on one site but not another? (Same code.)
But on another site it still works, but gives this error: Notice: Undefined index: UserWishesDateRange in /home/vs/site/phvs/bl/7solarsecrets/admin/trackingcode.html on line 79 I assume that is because the error display settings are set to a more rigorous level in this latter site. Is this correct? It's either the 'error_reporting' configuration directive that's different between the two servers, or 'display_errors', or both. On one server the E_NOTICE bit-field is set in 'error_reporting', and it sounds like 'display_errors' is also set (unless you're seeing that notice in a log file). On the other server, one or the other of those things is not set (or both of them aren't). You can use call ini_get('error_reporting') and ini_get('display_errors'), to see what they're set to on each server. Or just create a small page that only calls phpinfo(), to see all configuration directives. Here's the write-up of the directives (one is right below the other): http://us3.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting As others have pointed out, it's a good idea to call isset() on a POST-variable before trying to get at its value. This will avoid a notice being thrown. Lately I've stopped touching $_POST directly and started using filter_input() instead; this also avoids the problem and provides several other benefits: http://us2.php.net/manual/en/function.filter-input.php The filter_* functions are only available in core since 5.2.0, though. Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reason for a Notice:.. on one site but not another? (Same code.)
Bastien Sent from my iPod -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reason for a Notice:.. on one site but not another? (Same code.)
On Aug 9, 2009, at 7:43 PM, John Butler govinda.webdnat...@gmail.com wrote: Hi sunday coders, I've been using this kind of logic on one PHP site I work on to display one thing or another depending on whether the form was submitted or not: and it works great on that site. But on another site it still works, but gives this error: Notice: Undefined index: in /home/vs/site/phvs/bl/7solarsecrets/ admin/trackingcode.html on line 79 I assume that is because the error display settings are set to a more rigorous level in this latter site. Is this correct? (Both sites reside on servers where I am not the admin.) John Butler (Govinda) govinda.webdnat...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You could also simply define / initialize the variable. $UserWishesDateRange=''; if($_POST['UserWishesDateRange']) { //--line 79 echo'submitted'; } else { echo'NOT submitted'; } Bastien Sent from my iPod -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reason for a Notice:.. on one site but not another? (Same code.)
http://us3.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting Thank you guys for the isset() heads up. And Ben, for this good explanation of error reporting! As others have pointed out, it's a good idea to call isset() on a POST-variable before trying to get at its value. This will avoid a notice being thrown. OK, and I can work around all this anyway, but I would love to get it all in one line of code, that essentially says: (pseudocode) if ($IamNotEmpty $IamEqualto='T') { (where those are both the same var) http://us2.php.net/manual/en/function.filter-input.php The filter_* functions are only available in core since 5.2.0, though. OK, ..good to plant seeds, but since that server is PHP 4.3, I'll save my brain now for until I can actually integrate that study. John Butler (Govinda) govinda.webdnat...@gmail.com
Re: [PHP] Question: what are frameworks?
On Sunday 09 August 2009 02:47:37 pm Parham Doustdar wrote: Hi there, I've heard of frameworks, but I don't quite know what they are used for. I've done a little search on the internet, but even though I've been able to find different PHP frameworks, I'm not quite sure what they offer, or in what they differ, or why I shouldn't just use PHP as it is. Can someone give a little bit of explaination? Thanks! They are the different way of the programming php. PHP is the Temple Of the Shaolin, those fw programmers are master of the techniques. They are generate their way of the PHP-FU. Like kung-fu there are many ways to do things in php. From my point of view. All of them sh*t load of bloated code masterpieces. After RoR craze, Nearly every PHP developer sees the light in a one night. Then PHP Frameworks was skyrocketed. And Zend jump the bandwagon. Main point of Framework craze was not technical. PHP was loose type language, you can easily mess up your self in seconds and in the Internet you can see giantic size of spagetti code. Because of this, Java and .net programmers constantly mauls PHP as non enterprise language. So ? What is the point ? The point is, As a company owner or the project manager when you get a Certified this or that framework master, you can easily adopt a standard to your projects, plus, you can get support and more important than that you can show your badges and whistles to your customer to prove yourself as a Experienced php crafter. In simple, They says to your customer, you are in safe, these guys knows php, you can buy things from them even if they blows things up, you can find another certified master somewhere else. From my point of view. If you want to learn a Framework, I suggest you to learn a CMS/Framework, something like TYPO3. Because, after installing learning maybe certifying a framework, you have to do tons of coding to generate a usable platform. For example you have to write a session controller, have to generate a administrator interface, this that yada yada. So why you have to do all of this. Use a CMS/Framework and do just you need. Plus, TYPO3 also has same badges and whistles (if you wish) for your customers. Even in Germany it has bigger balls too. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reason for a Notice:.. on one site but not another? (Same code.)
John Butler wrote: http://us3.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting Thank you guys for the isset() heads up. And Ben, for this good explanation of error reporting! As others have pointed out, it's a good idea to call isset() on a POST-variable before trying to get at its value. This will avoid a notice being thrown. OK, and I can work around all this anyway, but I would love to get it all in one line of code, that essentially says: (pseudocode) if ($IamNotEmpty $IamEqualto='T') { (where those are both the same var) if(isset($_POST['UserWishesDateRange']) $_POST['UserWishesDateRange'] == 'T') { -- or -- $uwdr = $_POST['UserWishesDateRange']; if(isset($uwdr) $uwdr == 'T') { -- 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] reason for a Notice:.. on one site but not another? (Same code.)
if(isset($_POST['UserWishesDateRange']) $_POST['UserWishesDateRange'] == 'T') { Thought I tried that. Apparently not exactly; it works now! Thanks. I know it is clunky but I wanted to see how compact it could be done. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php