[PHP] configuring the CLI version of PHP
I'm not a sysadmin so I'm sorry if this sounds like a dumb question: I have a powerbook running 10.4 which has php installed correctly for the webserver. However, for the CLI version, it is 4.3.11. How best could I specify the correct version of php for the CLI (either switching via configuration file or at runtime of the script)? When I do sudo find / -name php -print , I get the following: /usr/bin/php /usr/include/php /usr/lib/php How would I know which version in which? -jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] configuring the CLI version of PHP
Hi Jonathan, /usr/bin/php /usr/include/php /usr/lib/php How would I know which version in which? which php should tell where your phpcli binary are. php -v should tell you which php version you are running. -- Marco Kaiser
[PHP] Unnecessary if statement? Programming technique
Hi everyone Quick question: If I have such a loop: ? for($i=0;$i100;$i++) { if($i==100) { // do something special for this occurence } // do something standard } ? In this case it seems such a waste that the if() statement is done 99 times when it's not needed. Is there any obvious trick that I am missing? I'm not sure how taxing a simple if() statement is on a server, maybe it's negligible, or is it something to worry about? Something which I'd prefer NOT to do: ? for($i=0;$i100;$i++) { // do something standard } // do something special for $i = 100 for($i=101;$i100;$i++) { // do something standard } ? as I would have have to either keep two copies of the code or write a function just for this purpose, which hardly seems worth it. Thanks to anyone who takes the time to think about my question and/or respond. Best wishes, Steve McGill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with preg_replace only part of the string
Replace the middle (.*) with ([^]*). This tells the regex engine to ignore new opening tags. Cheers, David Georgi Ivanov wrote: Hi, I want to replace the content of html links : a href=foo name=blaREPLACETHIS/a. $html=preg_replace(/(a.*name=.*)(.*)\/a/isU,$link,$html,1); This generally works but removes a,/a tags too. How to make it work without removing anything else than (.*) in the middle of a.*/a Thanks in advance. -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with preg_replace only part of the string
Georgi Ivanov wrote: Hi, I want to replace the content of html links : a href=foo name=blaREPLACETHIS/a. $html=preg_replace(/(a.*name=.*)(.*)\/a/isU,$link,$html,1); This generally works but removes a,/a tags too. How to make it work without removing anything else than (.*) in the middle of a.*/a $html = preg_replace(/(a.*name=.*)(.*)\/a/isU, '\1' . $link . '/a', $html, 1); -- Richard Heyes http://www.phpguru.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] what is better for performance?
Hi, I am just thinking about that what is better for storeing structured variables in point of view of performance. Is better store structured variables in associative array, for example: $person['first_name'] = 'Karel'; $person['last_name'] = 'Kozlik'; $person['address'] = 'somewhere on Earth'; or in object like this: $person-first_name = 'Karel'; $person-last_name = 'Kozlik'; $person-address = 'somewhere on Earth'; I feel that objects are better for performance, but work with associative arrays is pleasanter for me. May be the diference in performance measurable? (in heavy loaded environment) thanks Karel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] working
Does it this forum exist ? Because i haven't any comunications from this forum last 6 days. roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: GD Graph tutorial?
Gustavo Narea [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, Ashley. Ashley M. Kirchner wrote: Does anyone know of a good GD tutorial for creating graphs? I like this one: http://www.nyphp.org/content/presentations/GDintro/ Regards. -- Gustavo Narea. PHP Documentation - Spanish Translation Team. Valencia, Venezuela. Try this one: http://www.maani.us/charts/index.php I have used it and would recommend it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with preg_replace only part of the string
At 07:06 AM 12/6/2005, Richard Heyes wrote: Georgi Ivanov wrote: Hi, I want to replace the content of html links : a href=foo name=blaREPLACETHIS/a. $html=preg_replace(/(a.*name=.*)(.*)\/a/isU,$link,$html,1); This generally works but removes a,/a tags too. How to make it work without removing anything else than (.*) in the middle of a.*/a $html = preg_replace(/(a.*name=.*)(.*)\/a/isU, '\1' . $link . '/a', $html, 1); -- Richard Heyes http://www.phpguru.org If you know what you are replacing, i.e. REPLACETHIS is a placeholder, str_replace() or substr_replace() are much simpler. Miles Thompson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] working
it is working just fine -Original Message- From: Roman Duriancik [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 7:12 AM To: php-general@lists.php.net Subject: [PHP] working Does it this forum exist ? Because i haven't any comunications from this forum last 6 days. roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTTP User Authentication Problems
Ave, I¹m trying to run this very simple HTTP user authentication script: ?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm=Private'); header('HTTP/1.0 401 Unauthorized'); echo 'Unauthorized'; exit; } else { if(($_SERVER['PHP_AUTH_USER']==try) ($_SERVER['PHP_AUTH_PW']==try)) { ? HTML HEAD/HEAD BODY My Stuff Goes Here! /BODY /HTML ? } else { echo Access Denied; } } ? The problem is, this script runs perfectly fine on my localhost machine at home, however it¹s not working on my web server (purchased webhosting). When I open this page on my web site, it does bring up the popup box asking for Username Password the problem is, even if I type the correct user/pass, it won¹t accept it. It keeps asking me for user/pass again and again and finally brings up the ³Unauthorized² text on the page. Why won¹t it allow the correct user/pass to login? I don¹t understand. The only difference between the PHP on my localhost and the PHP on my webhost server is that my local machine is running PHP 5 and the webhost server is running PHP 4.4.1 Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
[PHP] What software do you use for writing PHP?
Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
[snip] Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? [/snip] I use Eclipse and HTML-Kit -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Jeff, Jeff McKeon wrote: Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? I use Zend Studio 5, but there are plenty of other (cheaper) options. Take a look at the following link for a list of editors with reviews. http://www.php-editors.com/review/ Cheers, David Grant -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On 12/6/05, Jeff McKeon [EMAIL PROTECTED] wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff Actually, there isn't much WORSE than FrontPage for any kind of coding. My personal favorite for projects at work is Eclipse with phpEclipse plugin and at home I use vim almost exclusively. -Mike -- Michael E. Crute Software Developer SoftGroup Development Corporation Linux takes junk and turns it into something useful. Windows takes something useful and turns it into junk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Hi Jeff, Jeff McKeon wrote: What is it you like about Zend Studio? * Code completion * Syntax highlighting for PHP, HTML and CSS * Manual pages * Debugging * Code examination * PHPDoc * CVS SVN support Cheers, David -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Quoting Michael Crute [EMAIL PROTECTED]: On 12/6/05, Jeff McKeon [EMAIL PROTECTED] wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff Actually, there isn't much WORSE than FrontPage for any kind of coding. My personal favorite for projects at work is Eclipse with phpEclipse plugin and at home I use vim almost exclusively. I recommend Zend Studio if you can afford it since it has a GUI for both Windows and Linux, and it runs fairly fast for being a Java application. ;) I agree with Mike, pretty much anything is better than FrontPage for editing web pages. If you're going to be changing both HTML and PHP, Zend works fine, but if you want something with less features but with all the important stuff such as syntax highlighting, multiple window buffers, and all that shebang, go for EditPlus www.editplus.com or UltraEdit www.ultraedit.com, I prefer EditPlus over most such simpler editors on Windows, and on Linux I use Jed, which has good menu handling and Windows-like shortcuts that speed up the work. I tend to get slightly confused when working 95% in Windows and then having to edit something in vim or emacs. Just my two cents... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Jeff McKeon napisał(a): Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? I use Bluefish, it's a very nice GTK+ based editor, with all types of code highlightning (html, php, c/c++, pascal, java, python are just a part of it). And that's pretty much all the features of it I use, maybe also the well written replace method. Besides that I use it as a typical text editor, I'm not too keen on template's. -- Best wishes Łukasz Hejnak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? I use Visual SlickEdit. You should check it out; it's a very powerful IDE. http://www.slickedit.com thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
What is it you like about Zend Studio? Jeff -Original Message- From: David Grant [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 09:19 To: Jeff McKeon Cc: php Subject: Re: [PHP] What software do you use for writing PHP? Jeff, Jeff McKeon wrote: Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? I use Zend Studio 5, but there are plenty of other (cheaper) options. Take a look at the following link for a list of editors with reviews. http://www.php-editors.com/review/ Cheers, David Grant -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
I've used Dreamweaver MX, working with 9 remote sites, shared between IIS and Apache. George -Original Message- From: Jeff McKeon [mailto:[EMAIL PROTECTED] Sent: 6 December 2005 2:15 pm To: php Subject: [PHP] What software do you use for writing PHP? Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff -- 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] HTTP User Authentication Problems
Hi Rahul, Try doing a print_r($_SERVER) to see if the variables are being set. If they aren't, take a look at the phpinfo(); - chances are your host is using a CGI binary version of PHP to use together with a security wrapper like suPHP or phpSuExec, which might throw away the variables that you require. Steve Rahul S. Johari [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Ave, I¹m trying to run this very simple HTTP user authentication script: ?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm=Private'); header('HTTP/1.0 401 Unauthorized'); echo 'Unauthorized'; exit; } else { if(($_SERVER['PHP_AUTH_USER']==try) ($_SERVER['PHP_AUTH_PW']==try)) { ? HTML HEAD/HEAD BODY My Stuff Goes Here! /BODY /HTML ? } else { echo Access Denied; } } ? The problem is, this script runs perfectly fine on my localhost machine at home, however it¹s not working on my web server (purchased webhosting). When I open this page on my web site, it does bring up the popup box asking for Username Password the problem is, even if I type the correct user/pass, it won¹t accept it. It keeps asking me for user/pass again and again and finally brings up the ³Unauthorized² text on the page. Why won¹t it allow the correct user/pass to login? I don¹t understand. The only difference between the PHP on my localhost and the PHP on my webhost server is that my local machine is running PHP 5 and the webhost server is running PHP 4.4.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
I have to say Dreamweaver MX also it's a great all around tool for developing sites... while it may not have all the features and be as PHP specific as Zend it gets the job done. I've learned that it's just a personal preference the best coder i've ever met used note pad LOL Joe On 12/6/05, George Pitcher [EMAIL PROTECTED] wrote: I've used Dreamweaver MX, working with 9 remote sites, shared between IIS and Apache. George -Original Message- From: Jeff McKeon [mailto:[EMAIL PROTECTED] Sent: 6 December 2005 2:15 pm To: php Subject: [PHP] What software do you use for writing PHP? Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff -- 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 -- Joe Harman - * My programs never have bugs, they just develop random features. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Hi. £ukasz Hejnak wrote: I use Bluefish, it's a very nice GTK+ based editor, with all types of code highlightning (html, php, c/c++, pascal, java, python are just a part of it). And that's pretty much all the features of it I use, maybe also the well written replace method. Besides that I use it as a typical text editor, I'm not too keen on template's. I use Bluefish too and I like it, but I admit that the syntax highlighting cannot be worst: I have to press F5 when I type quotation marks in PHP. I think I'll switch to eclipse. If you're using Windows, I suggest you to use Macromedia Dreamweaver. Cheers. -- Gustavo Narea. PHP Documentation - Spanish Translation Team. Valencia, Venezuela. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Jeff McKeon wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Now: Zend Studio In The Past : Quanta, Komodo When I Still In Hell (Like Jay is now) : UltraEdit32 -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
David Grant wrote: Hi Jeff, Jeff McKeon wrote: What is it you like about Zend Studio? * Code completion * Syntax highlighting for PHP, HTML and CSS * Manual pages * Debugging * Code examination * PHPDoc * CVS SVN support Also: MySQL Tools SFTP FTP Projects PHPDocumentor -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
HomeSite. I tried several others but always came back to HomeSite. :) -afan Jeff McKeon wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Now: Zend Studio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What software do you use for writing PHP?
Jeff McKeon wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff http://www.waterproof.fr/products/PHPEdit/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On 12/6/05, Jeff McKeon [EMAIL PROTECTED] wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Vim is my editor of preference. If I have to use Windows, I usually go with Homesite (because I already have a licensed copy) or Textpad (because it's better than Notepad). IDEs? Who needs 'em ;) Best, Jason
RE: [PHP] Unnecessary if statement? Programming technique
Hi, Why not for ($i = 0; $i 100/100; ++$i) { for ($j = 0; $j 100; ++$j) { // do something standard } // do something special for this occurence } Jared -Original Message- From: Steve McGill [mailto:[EMAIL PROTECTED] Sent: 06 December 2005 10:18 To: php-general@lists.php.net Subject: [PHP] Unnecessary if statement? Programming technique Hi everyone Quick question: If I have such a loop: ? for($i=0;$i100;$i++) { if($i==100) { } // do something standard } ? In this case it seems such a waste that the if() statement is done 99 times when it's not needed. Is there any obvious trick that I am missing? I'm not sure how taxing a simple if() statement is on a server, maybe it's negligible, or is it something to worry about? Something which I'd prefer NOT to do: ? for($i=0;$i100;$i++) { // do something standard } // do something special for $i = 100 for($i=101;$i100;$i++) { // do something standard } ? as I would have have to either keep two copies of the code or write a function just for this purpose, which hardly seems worth it. Thanks to anyone who takes the time to think about my question and/or respond. Best wishes, Steve McGill -- 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] What software do you use for writing PHP?
HomeSite. I tried several others but always came back to HomeSite. :) I was a massive HomeSite proponent until I started using SlickEdit. Once I did, I never looked back. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
KWrite part of KDE. Notepad with Syntax Highlighting and AutoIndention. And because it's part of KDE all the kioslaves come with. Which means editing sites over ftp, ftps, ssh and many others is possible. Like the Vim guy said. DEs? who needs them :) On Tuesday 06 December 2005 08:15, Jeff McKeon wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unnecessary if statement? Programming technique
Jared Williams wrote: Why not for ($i = 0; $i 100/100; ++$i) This involves dividing 100 by 100 for each iteration of the loop. It would be better to test against 1. There is also the unwanted side-effect of executing the code on each hundredth iteration, which is unwanted (as far as I understand the problem). :) It would be interesting if Steve could divulge the greater problem that he is seeking a solution to. Cheers, David -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Stephen Leaf wrote: KWrite part of KDE. Notepad with Syntax Highlighting and AutoIndention. And because it's part of KDE all the kioslaves come with. Which means editing sites over ftp, ftps, ssh and many others is possible. Like the Vim guy said. DEs? who needs them :) Mmmm, reminds me of Kate! When I use KDE, I used Kate for all non-PHP coding tasks, because it has great highlighting, and code folding too. :) Cheers, David Grant -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Communicate with Windows Media Server with PHP
Is there a repository of php scripts that can communicate with Windows Media Server I am looking to do some load balancing with our 4 media servers in San Jose, Washington, Dallas, London Essentially, I need to get the number of current users on a particular server. If the server has over 200 users, go to another server. Anyone done this with PHP specifically ? g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
As far as I can tell kate has a kwrite embedded :) I'm sure that's not the case but it seems like it. everything kwrite can do so can kate. only it has more options that I'd never used. And yes Code folding is nice don't use it much tho. On Tuesday 06 December 2005 09:48, David Grant wrote: Stephen Leaf wrote: KWrite part of KDE. Notepad with Syntax Highlighting and AutoIndention. And because it's part of KDE all the kioslaves come with. Which means editing sites over ftp, ftps, ssh and many others is possible. Like the Vim guy said. DEs? who needs them :) Mmmm, reminds me of Kate! When I use KDE, I used Kate for all non-PHP coding tasks, because it has great highlighting, and code folding too. :) Cheers, David Grant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unnecessary if statement? Programming technique
Hi, David is right about the unwanted side-effect. Thanks for the idea though. Unfortunately the 'greater problem' is not so great, I've just been doing this for a while now and find myself programming loops like these so often and I've never got round to testing if a simple IF statement is a major drain on the CPU. Somehow I doubt it. I got this reply from someone direct to my mail address, which seems to sum it up: -- In truth you are not evaluating the whole if block just the condition and since its such a simple condition I can't see how it would be at all taxing on the server. In your specific case I can't think of a better way to do it either. -- I'll try and think of a better example: ? $bool = true; // this is set dynamically and not known in advance while(true) { if($bool) { // this condition tested in every single loop // do first code } else { // do second code } } ? and I am wondering if the compiler is smart enough to turn this into: ? $bool = true; // this is set dynamically and not known in advance if($bool) { // this condition only tested once while(true) { // do first code } } else { while(true) { // do second code } } ? I realise this might be hard to follow without giving specific examples and code. In this case, the coding style of the 2nd example seems far better, but sometimes the 2 blocks of code are practically identical and it's a programmer's nightmare to have the blocks of code in 2 places and to remember to keep them both updated. I'm also assuming that using function calls is also much slower than evaluating a very simple IF statement. Thanks for your interest. Best wishes, Steve David Grant [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Jared Williams wrote: Why not for ($i = 0; $i 100/100; ++$i) This involves dividing 100 by 100 for each iteration of the loop. It would be better to test against 1. There is also the unwanted side-effect of executing the code on each hundredth iteration, which is unwanted (as far as I understand the problem). :) It would be interesting if Steve could divulge the greater problem that he is seeking a solution to. Cheers, David -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
According to http://kate.kde.org/info.php, kate and kwrite (and Quanta) all use katepart (a rewrite of kwrite). Stephen Leaf wrote: As far as I can tell kate has a kwrite embedded :) I'm sure that's not the case but it seems like it. everything kwrite can do so can kate. only it has more options that I'd never used. And yes Code folding is nice don't use it much tho. On Tuesday 06 December 2005 09:48, David Grant wrote: Stephen Leaf wrote: KWrite part of KDE. Notepad with Syntax Highlighting and AutoIndention. And because it's part of KDE all the kioslaves come with. Which means editing sites over ftp, ftps, ssh and many others is possible. Like the Vim guy said. DEs? who needs them :) Mmmm, reminds me of Kate! When I use KDE, I used Kate for all non-PHP coding tasks, because it has great highlighting, and code folding too. :) Cheers, David Grant -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
Nusphere PhpED and love it. Tried a few other editors but stayed with PhpED now for the last year and about to renew my subscription. Excellent project management, brilliant debugger (local and remote), code error detection and highlighting, fast (much faster than the java editors), able to handle huge projects, and very stable. Not as expensive as the Zend equivalent (last time I checked) and in my opinion it's much better. Good support from the forum and quick responses from the support desk. I keep checking out the new editors and new versions of old editors as they come out but nothing yet to match PhpED. I develop on Windows but there's a Linux version too (which I haven't tried). If you're looking for a professional PHP IDE you won't find better. And BTW I don't work for Nusphere, I just really like their product. Arno DotContent Professional Content Management Solutions www.dotcontent.net -Original Message- From: Jeff McKeon [mailto:[EMAIL PROTECTED] Sent: 06 December 2005 04:15 To: php Subject: [PHP] What software do you use for writing PHP? Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.12/192 - Release Date: 2005/12/05 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.12/192 - Release Date: 2005/12/05 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
If you're allready using Visul Studio for your windows applications, take a look at VS.Php from Jcx.Software. http://www.jcxsoftware.com/ Jesper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Forum
Hi list Does anyone of you know of a good forum that is easy to customize and supports sticky notes, user registration, bb code and stuff like that? With kind regards Andy -- Now listening to Top! Radio Live www.topradio.be/stream on amaroK Geek code: www.vlaamse-kern.com/geek Registered Linux User No 379093 If life was for sale, what would be its price? www.vlaamse-kern.com/sas/ for free php utilities -- pgpxJ7TaB8xxl.pgp Description: PGP signature
Re: [PHP] HTTP User Authentication Problems
Ave, Steve, I did a phpinfo() on my webhost and as it turns out, they are using a CGI binary version, much to my surprise and dismay. Anyhow... Do I have any alternatives for an http authentication kind of authentication ? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com On 12/6/05 9:50 AM, Steve McGill [EMAIL PROTECTED] wrote: Hi Rahul, Try doing a print_r($_SERVER) to see if the variables are being set. If they aren't, take a look at the phpinfo(); - chances are your host is using a CGI binary version of PHP to use together with a security wrapper like suPHP or phpSuExec, which might throw away the variables that you require. Steve Rahul S. Johari [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Ave, I¹m trying to run this very simple HTTP user authentication script: ?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm=Private'); header('HTTP/1.0 401 Unauthorized'); echo 'Unauthorized'; exit; } else { if(($_SERVER['PHP_AUTH_USER']==try) ($_SERVER['PHP_AUTH_PW']==try)) { ? HTML HEAD/HEAD BODY My Stuff Goes Here! /BODY /HTML ? } else { echo Access Denied; } } ? The problem is, this script runs perfectly fine on my localhost machine at home, however it¹s not working on my web server (purchased webhosting). When I open this page on my web site, it does bring up the popup box asking for Username Password the problem is, even if I type the correct user/pass, it won¹t accept it. It keeps asking me for user/pass again and again and finally brings up the ³Unauthorized² text on the page. Why won¹t it allow the correct user/pass to login? I don¹t understand. The only difference between the PHP on my localhost and the PHP on my webhost server is that my local machine is running PHP 5 and the webhost server is running PHP 4.4.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unnecessary if statement? Programming technique
Hi, I imagine this kind of thing is not especially taxing on the processor, especially if the condition is a fairly simple comparison. That said, I have very little understanding aside from my own limited experience of what runs slowly! If you're worried about code maintenance, then move the code out to a function and pass the parts that vary as parameters. Cheers, David Grant Steve McGill wrote: Hi, David is right about the unwanted side-effect. Thanks for the idea though. Unfortunately the 'greater problem' is not so great, I've just been doing this for a while now and find myself programming loops like these so often and I've never got round to testing if a simple IF statement is a major drain on the CPU. Somehow I doubt it. I got this reply from someone direct to my mail address, which seems to sum it up: -- In truth you are not evaluating the whole if block just the condition and since its such a simple condition I can't see how it would be at all taxing on the server. In your specific case I can't think of a better way to do it either. -- I'll try and think of a better example: ? $bool = true; // this is set dynamically and not known in advance while(true) { if($bool) { // this condition tested in every single loop // do first code } else { // do second code } } ? and I am wondering if the compiler is smart enough to turn this into: ? $bool = true; // this is set dynamically and not known in advance if($bool) { // this condition only tested once while(true) { // do first code } } else { while(true) { // do second code } } ? I realise this might be hard to follow without giving specific examples and code. In this case, the coding style of the 2nd example seems far better, but sometimes the 2 blocks of code are practically identical and it's a programmer's nightmare to have the blocks of code in 2 places and to remember to keep them both updated. I'm also assuming that using function calls is also much slower than evaluating a very simple IF statement. Thanks for your interest. Best wishes, Steve David Grant [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Jared Williams wrote: Why not for ($i = 0; $i 100/100; ++$i) This involves dividing 100 by 100 for each iteration of the loop. It would be better to test against 1. There is also the unwanted side-effect of executing the code on each hundredth iteration, which is unwanted (as far as I understand the problem). :) It would be interesting if Steve could divulge the greater problem that he is seeking a solution to. Cheers, David -- David Grant http://www.grant.org.uk/ -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forum
Andy Pieters wrote: Hi list Does anyone of you know of a good forum that is easy to customize and supports sticky notes, user registration, bb code and stuff like that? I'm sure Google knows. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Forum
[snip] I'm sure Google knows. [/snip] Google knows everything[refrain from putting some terse comment concerning certain products which have caused me to curse so much that I will only have coals switches in my stocking this Christmas] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forum
On Tuesday 06 December 2005 16:16, John Nichel wrote: Andy Pieters wrote: Hi list Does anyone of you know of a good forum that is easy to customize and supports sticky notes, user registration, bb code and stuff like that? I'm sure Google knows. The difference with google and humans is that google doesn't know about experience and stuff like that. I did look at google but I wanted HUMAN opinions. With kind regards Andy -- Now listening to Top! Radio Live www.topradio.be/stream on amaroK Geek code: www.vlaamse-kern.com/geek Registered Linux User No 379093 If life was for sale, what would be its price? www.vlaamse-kern.com/sas/ for free php utilities -- pgpNgOhpmZ3y0.pgp Description: PGP signature
RE: [PHP] Forum
On Tue, 2005-12-06 at 11:22, Jay Blanchard wrote: [snip] I'm sure Google knows. [/snip] Google knows everything[refrain from putting some terse comment concerning certain products which have caused me to curse so much that I will only have coals switches in my stocking this Christmas] Maybe one of those switches will be back nix. I know, I know, that wasn't very punny. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forum
Jay Blanchard wrote: [snip] I'm sure Google knows. [/snip] Google knows everything[refrain from putting some terse comment concerning certain products which have caused me to curse so much that I will only have coals switches in my stocking this Christmas] What concerns me is that you're wearing stockings. ;) -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forum
Does anyone of you know of a good forum that is easy to customize and supports sticky notes, user registration, bb code and stuff like that? I would suggest that Phorum (www.phorum.org) and phpBB (www.phpbb.com) are the two biggies (written in PHP). Both have all these features plus many available mods. Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forum
Andy Pieters wrote: On Tuesday 06 December 2005 16:16, John Nichel wrote: Andy Pieters wrote: Hi list Does anyone of you know of a good forum that is easy to customize and supports sticky notes, user registration, bb code and stuff like that? I'm sure Google knows. The difference with google and humans is that google doesn't know about experience and stuff like that. I did look at google but I wanted HUMAN opinions. Then look at sites like php.resourceindex.com where they have user ratings and comments. A question like that on this list is only going to get you personal preferences, and a mini-flame war about which product sucks and which product rocks. (see the latest thread on IDE's; although the flaming is non-existant...must be because of the holiday season). http://php.resourceindex.com/Complete_Scripts/Bulletin_Board_Message_Systems/ -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forum
Larry E. Ullman wrote: Does anyone of you know of a good forum that is easy to customize and supports sticky notes, user registration, bb code and stuff like that? http://fudforum.org/features.php I've heard lots about it, but never used it. Cheers, David Grant -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unnecessary if statement? Programming technique
This is probably going to sound strange, but I like to try to think outside the box (buzzphrase!) and hit things at odd angles. Would someone care to test (or already know) the performance difference between a for loop and a foreach loop? Or the performance difference over many iterations of if (something == somethingelse) versus if (true)? Two examples to test: ?php $arr = array_fill(0, 99, 'echo \test standard\;'); $arr[100] = 'echo \test special\;'; foreach ($arr as $value) { eval($value); } ? or ?php $arr = array_fill(0, 99, true); $arr[100] = false; foreach ($arr as $value) { if ($value) { // do standard } else { // do special } } ? I'd be curious to see the benchmarks. I wonder if a if() versus doing the value check in a for statement are different speed-wise.. I'm wondering how much eval() slows it down.. and I'm wondering if if (value == value2) is slower than if (true). Probably other offbeat ways of doing something like this too. -TG = = = Original message = = = Hi everyone Quick question: If I have such a loop: ? for($i=0;$i100;$i++) if($i==100) // do something special for this occurence // do something standard ? In this case it seems such a waste that the if() statement is done 99 times when it's not needed. Is there any obvious trick that I am missing? I'm not sure how taxing a simple if() statement is on a server, maybe it's negligible, or is it something to worry about? Something which I'd prefer NOT to do: ? for($i=0;$i100;$i++) // do something standard // do something special for $i = 100 for($i=101;$i100;$i++) // do something standard ? as I would have have to either keep two copies of the code or write a function just for this purpose, which hardly seems worth it. Thanks to anyone who takes the time to think about my question and/or respond. Best wishes, Steve McGill ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
I primarily code in Dreamweaver 8. Two of my favorite features that were added from MX are as follows: 1. Code folding, basically you can collapse blocks of code. If you have to work with other peoples code, matching braces and code folding is an awesome way of just seeing the logical flow of the code, and hide all the details. DW 8 code folding is great because you can select any amount of code and collapse it. The bummer about dreamweaver is that it doesn't detect functions and add a collapse handle to it like Zend Studio, or have the default to automatically collapse functions when you open a page like Zend Studio. 2. The built in FTP client. You can set it so that when you save it auto uploads the file to the site. They also put the upload/download process into a separate process. This means that you can download or upload a bunch of files and still continue to work on files. One thing that bugs me is that the dialogue box always comes up and you have to click around or minimize it to hide it, why isn't there an option to just keep it hidden on upload? I used Zend Studio for a month, in hopes that I would be able to figure out how to install the whole IDE with server on my machine. I wanted to use the debugging features in it, but I have never been able to get all the pieces installed correctly AND gotten a work flow down where I could use the debugger effectively. ZS has code folding too, but just for functions. Someone else mentioned support for phpDoc, this is an awesome time saver if you want to provide clear documentation in phpdoc format. One big bummer on ZS was that it didn't have a built in FTP client. A work around is to work directly off the server. I tried Magumas Workbench product for a little bit, but it seemed very mickey mouse compared to ZS and DW. But I'm sure it's really a good product and I just didn't' give it a chance. I have a soft spot for CoffeeCup editor as it was my first editor beyond notepad. I still download each update and install it, though I never use it anymore Mark -Original Message- From: Jeff McKeon [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 6:15 AM To: php Subject: [PHP] What software do you use for writing PHP? Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Arrays
If I have an array, such as $Var[0] = Dog; $Var[1] = Cat; $Var[2] = Horse; Is there a way to quickly check to see if $Var contains Lion without walking through each value? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On 6 Dec 2005, at 17:25, Mark Steudel wrote: ZS has code folding too, but just for functions. Someone else mentioned support for phpDoc, this is an awesome time saver if you want to provide clear documentation in phpdoc format. One big bummer on ZS was that it didn't have a built in FTP client. A work around is to work directly off the server. It doesn't have a fully fledged FTP client, but it can connect to, edit files on, and upload to an FTP server, so it's the same end result. What swings it most for me (I use ZS exclusively) is the function / method / class insight, which DW doesn't have. Oh and the svn integration is nice too (although very badly documented) Cheers, Rich -- http://www.corephp.co.uk PHP Development Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Jason Petersen wrote: On 12/6/05, Jeff McKeon [EMAIL PROTECTED] wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Vim is my editor of preference. If I have to use Windows, I usually go with Homesite (because I already have a licensed copy) or Textpad (because it's better than Notepad). IDEs? Who needs 'em ;) Best, Jason same here :) Vim on UNIX machines, and Textpad on Windows both very good, simple, quick editors - tul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Arrays
[snip] Is there a way to quickly check to see if $Var contains Lion without walking through each value? [/snip] http://us3.php.net/in_array -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays
On 6 Dec 2005, at 17:33, Ben Miller wrote: If I have an array, such as $Var[0] = Dog; $Var[1] = Cat; $Var[2] = Horse; Is there a way to quickly check to see if $Var contains Lion without walking through each value? Look in the manual at the function in_array() Cheers, Rich -- http://www.corephp.co.uk PHP Development Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On 6 Dec 2005, at 17:36, M. Sokolewicz wrote: Jason Petersen wrote: On 12/6/05, Jeff McKeon [EMAIL PROTECTED] wrote: Vim is my editor of preference. If I have to use Windows, I usually go with Homesite (because I already have a licensed copy) or Textpad (because it's better than Notepad). IDEs? Who needs 'em ;) same here :) Vim on UNIX machines, and Textpad on Windows both very good, simple, quick editors I used to think like that (10 years ago maybe), but then I realised that actually, my time is quite valuable and worth a fair bit, and it's best not to waste it. Cheers, Rich -- http://www.corephp.co.uk PHP Development Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On 12/6/05, Richard Davey [EMAIL PROTECTED] wrote: On 6 Dec 2005, at 17:36, M. Sokolewicz wrote: Jason Petersen wrote: On 12/6/05, Jeff McKeon [EMAIL PROTECTED] wrote: Vim is my editor of preference. If I have to use Windows, I usually go with Homesite (because I already have a licensed copy) or Textpad (because it's better than Notepad). IDEs? Who needs 'em ;) same here :) Vim on UNIX machines, and Textpad on Windows both very good, simple, quick editors I used to think like that (10 years ago maybe), but then I realised that actually, my time is quite valuable and worth a fair bit, and it's best not to waste it. Indeed, if you are bad at VI things go very slow but if you are good at VI (I am semi-good) you can code FAR faster than any GUI I have ever used. Plus you can use VIM on Windows too. -Mike -- Michael E. Crute Software Developer SoftGroup Development Corporation Linux takes junk and turns it into something useful. Windows takes something useful and turns it into junk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
I primarily code in Dreamweaver 8. Two of my favorite features that were added from MX are as follows: 1. Code folding, basically you can collapse blocks of code. SlickEdit has this feature. 2. The built in FTP client. This one as well. I used Dreamweaver a while back (admittedly an older version) but I couldn't stand it. But that's IMO. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
When you say SlickEdit has a ftp client built in, is it a separate window that gets launched, or is it more integrated, like you can just right click on your list of files and say put these files up on the server. For me just being able to save and have the file get uploaded saves me a lot of extra clicks. DW's synchornization features are also handy if you are trying to get just the lastest files instead of the whole site. -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 10:11 AM To: Mark Steudel; 'Jeff McKeon'; 'php' Subject: Re: [PHP] What software do you use for writing PHP? I primarily code in Dreamweaver 8. Two of my favorite features that were added from MX are as follows: 1. Code folding, basically you can collapse blocks of code. SlickEdit has this feature. 2. The built in FTP client. This one as well. I used Dreamweaver a while back (admittedly an older version) but I couldn't stand it. But that's IMO. thnx, Chris -- 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] What software do you use for writing PHP?
Michael Crute said the following on 12/06/2005 09:53 AM: On 12/6/05, Richard Davey [EMAIL PROTECTED] wrote: Indeed, if you are bad at VI things go very slow but if you are good at VI (I am semi-good) you can code FAR faster than any GUI I have ever used. If you take the upfront time to learn how to use VIM you'll discover it is very powerful and very quick. It's even better if you use it in conjunction with screen. Plus you can use VIM on Windows too. Yes, though if you're stuck on Windows I'd suggest using VIM via Putty (even if you're using Putty to SSH to your local machine) so that you can resize your shell window horizontally as well as vertically. - Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Quoting Torgny Bjers [EMAIL PROTECTED]: I recommend Zend Studio if you can afford it since it has a GUI for both Windows and Linux FlameBateAnd for those interested in using a real computer/FlameBate, it's GUI also runs under MacOSX. http://zend.com/store/products/zend-studio/requirements.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
[snip] FlameBateAnd for those interested in using a real computer/FlameBate, it's GUI also runs under MacOSX. [/snip] If they are real why aren't there more of them? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On 12/6/05, Ben [EMAIL PROTECTED] wrote: Michael Crute said the following on 12/06/2005 09:53 AM: On 12/6/05, Richard Davey [EMAIL PROTECTED] wrote: Indeed, if you are bad at VI things go very slow but if you are good at VI (I am semi-good) you can code FAR faster than any GUI I have ever used. If you take the upfront time to learn how to use VIM you'll discover it is very powerful and very quick. It's even better if you use it in conjunction with screen. Plus you can use VIM on Windows too. Yes, though if you're stuck on Windows I'd suggest using VIM via Putty (even if you're using Putty to SSH to your local machine) so that you can resize your shell window horizontally as well as vertically. - Ben Well if you properly setup GVIM (turn off the menus and toolbars) you have about the same thing. Thats what I use at work instead of notepad. It works really well. My _gvimrc file looks like so and accomplishes exactly what you are saying with GVIM au GUIEnter * simalt ~x set guioptions= syn on set guifont=Lucida_Console:h9:cANSI set wrap! set nu set tabstop=4 emenu Edit.Color Scheme.torte set nocp set bs=2 set swapfile! -Mike -- Michael E. Crute Software Developer SoftGroup Development Corporation Linux takes junk and turns it into something useful. Windows takes something useful and turns it into junk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Wow.. Linux must really be real then.. look at all the distributions , kernel patch sets, Window managers, etc./sarcasm # of programs means nothing. it's the quality of the programs. And yes I am a linux user ;) On Tuesday 06 December 2005 13:24, Jay Blanchard wrote: [snip] FlameBateAnd for those interested in using a real computer/FlameBate, it's GUI also runs under MacOSX. [/snip] If they are real why aren't there more of them? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays
This what you want? http://us3.php.net/manual/en/function.array-search.php -TG = = = Original message = = = If I have an array, such as $Var[0] = Dog; $Var[1] = Cat; $Var[2] = Horse; Is there a way to quickly check to see if $Var contains Lion without walking through each value? ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Jay Blanchard said the following on 12/06/2005 11:24 AM: [snip] FlameBateAnd for those interested in using a real computer/FlameBate, it's GUI also runs under MacOSX. [/snip] If they are real why aren't there more of them? 'cause it's real expensive ;-). - Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SSI problem with php after 4.3.10 - 4.4.1 upgrade
In case anyone encounters this problem - using the latest 4.4.x snapshot fixed the problem for me (thanks, developers!). Kristina On 12/5/05, kristina clair [EMAIL PROTECTED] wrote: On 12/5/05, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] I'm having a problem with certain SSI files which include php scripts after upgrding php from 4.3.10 to 4.4.1. The includes look like: !--#include file=eventsdb.php?ID=81fld=2 -- In some cases, the page output is different with 4.4.1 than it is with 4.3.10. In the worst cases, Apache gives a segmentation fault, and the page is blank. Has anyone encountered any similar issues? [/snip] We'd have to see some code to begin to analyse what the problem might be. Can you send php code snips from eventdb.php? The code is short. The same php script is being included in the page which is displaying differently and the page which is causing the apache segfault. if (empty($ID)){ $ID='1'; } $today = date(Ymd); $conn = mysql_connect ([snip]); if ($conn == false){ echo mysql_errno() . : . mysql_error() . BR; exit; } else { $rtn = mysql_select_db ([tablename]); $sql = select * from events where ID = .$ID; $result = mysql_query ($sql); if ( ($row = mysql_fetch_row($result)) ($today=$row[4] ) ){ //if ( $row = mysql_fetch_ row($result)) { switch ($fld){ case 2: echo $row[2]; break; case 5: echo $row[5]; break; case 6: echo $row[6]; break; case 7: echo $row[7]; break; default: echo $row[1]; break; } } } By the way, the backtrace from the apache segfault is: #0 0xb7e095cc in zend_hash_index_update_or_next_insert (ht=0xb7ea29c0, h=0, pData=0xbfffdc60, nDataSize=12, pDest=0x0, flag=1) at /home/sys/src/php-4.4.1/Zend/zend_hash.c:390 390 p = ht-arBuckets[nIndex]; (gdb) bt full #0 0xb7e095cc in zend_hash_index_update_or_next_insert (ht=0xb7ea29c0, h=0, pData=0xbfffdc60, nDataSize=12, pDest=0x0, flag=1) at /home/sys/src/php-4.4.1/Zend/zend_hash.c:390 nIndex = 0 p = Variable p is not available. (gdb) That segfault backtrace is the same even if I compile php with the --without-zend-memory-manager flag, and also when I disable all Zend settings in php.ini. Thanks, Kristina -- In most cases, people, even wicked people, are far more naive and simple-hearted than one generally assumes. And so are we. /* last line, 1st ch., The Brothers Karamazov */ -- In most cases, people, even wicked people, are far more naive and simple-hearted than one generally assumes. And so are we. /* last line, 1st ch., The Brothers Karamazov */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Redirects Safari vs Others
Sorry it took me so long, I wasn't sure where the problem lay and couldn't get you the exact code, but I figured out why (sorta) this was happening. // Causes only Safiri to bomb header(location: .$_SERVER['PHP_SELF'].?action=listentriescategoryid=.$id.page=.$pagei d); exit; Headers: http://www.domain.org/page.php?action=subcategoryid=7page=33 GET /page.php?action=subcategoryid=7page=33 HTTP/1.1 Host: www.domain.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://www.domain.org/page.php?page=33 Cookie: PHPSESSID=cff99c9147d0741d6e48368f72951ef4 HTTP/1.x 302 OK Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Length: 188 Content-Type: text/html Expires: Thu, 19 Nov 1981 08:52:00 GMT // NOTE HERE NO PAGE REFERENCED Location: ?action=listentriescategoryid=10page=33 Server: Microsoft-IIS/6.0 X-Powered-By: PHP/4.4.0, ASP.NET Date: Tue, 06 Dec 2005 19:01:00 GMT // Doesn't cause Safari to bomb header(location: page.php?action=listentriescategoryid=.$id.page=.$pageid); exit; Headers: http://www.domain.org/page.php?action=subcategoryid=7page=33 GET /page.php?action=subcategoryid=7page=33 HTTP/1.1 Host: www.domain.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://www.domain.org/page.php?page=33 Cookie: PHPSESSID=cff99c9147d0741d6e48368f72951ef4 HTTP/1.x 302 OK Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Length: 188 Content-Type: text/html Expires: Thu, 19 Nov 1981 08:52:00 GMT // NOW ITS FINE Location: page.php?action=listentriescategoryid=10page=33 Server: Microsoft-IIS/6.0 X-Powered-By: PHP/4.4.0, ASP.NET Date: Tue, 06 Dec 2005 19:01:00 GMT Firefox and IE, I guess, assume where they are supposed to go, where as Safari was just like no idea BOOM. So it seems to me that the browser or the script has no idea what PHPSELF is untill the script finishes executing... Input would be welcome. -Original Message- From: Brent Baisley [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 12:15 PM To: Mark Steudel Cc: php-general@lists.php.net Subject: Re: [PHP] Redirects Safari vs Others Probably not a PHP problem. And probably can't help without seeing your redirect code. I've never had a problem with redirects in any browser Safari or otherwise, but I always make sure I redirect with a full URL rather than a relative URL. On Dec 5, 2005, at 1:29 PM, Mark Steudel wrote: I was wondering if folks have experienced infinite redirection loops with Safari where other browsers don't encounter the same problems. This is what safari spits out http://www.domain.com/microlibrary.php?action=subcategoryid=7top=% 2Fpage.p hp%3Fpage%3D33page=33?action=listentriescategoryid=7top=/ page.php?page=33 page=33?action=listentriescategoryid=7top=/page.php? page=33page=33?actio n=listentriescategoryid=7top=/page.php?page=33page=33? action=listentries categoryid=7top=/page.php?page=33page=33? action=listentriescategoryid=7t op=/page.php?page=33page=33?action=listentriescategoryid=7top=/ page.php?p age=33page=33?action=listentriescategoryid=7top=/page.php? page=33page=33 ?action=listentriescategoryid=7top=/page.php?page=33page=33? action=listen triescategoryid=7top=/page.php?page=33page=33? action=listentriescategory id=7top=/page.php?page=33page=33? action=listentriescategoryid=7top=/page .php?page=33page=33?action=listentriescategoryid=7top=/page.php? page=33p age=33?action=listentriescategoryid=7top=/page.php? page=33page=33?action= listentriescategoryid=7top=/page.php?page=33page=33? action=listentriesca tegoryid=7top=/page.php?page=33page=33? action=listentriescategoryid=7top =/page.php?page=33page=33 I'm sure this is a coding problem on my part but it's interesting that it doesn't happen in firefox or IE. Thanks, Mark -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Urlencode vs htmlentities
Lets say I have the following: Current URL: http://www.domain.com/page.php?action=list http://www.domain.com/page.php?action=listtop=/page.php?action=listid=3 top=/page.php?action=listid=3 $top = $_SERVER['PHP_SELF'].'?'.$_SERVER['argv']['0'] Now I want to create a URL with a return link in it a href='.$_SERVER['PHP_SELF'].'?action=addamp;return='.$top.' Add Something /a Should I use htmlentites on $top first? Second let's say instead of constructing a link I want to use a header and redirect someone header(location: page.php?action=addreturn=.$top ); So do I use urlencode here? Lets say I have something that has been htmlentitied, and I want to use a header command, do I htmlentitydecode and then urlencode?
Re: [PHP] What software do you use for writing PHP?
On 6 Dec 2005, at 19:24, Jay Blanchard wrote: [snip] FlameBateAnd for those interested in using a real computer/ FlameBate, it's GUI also runs under MacOSX. [/snip] If they are real why aren't there more of them? Because they have 'real' price tags. Shame really, as OS X pisses all over Windows from a great height. Oh well, nothing wrong with being in an elite minority ;) Cheers, Rich -- http://www.corephp.co.uk PHP Development Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
[snip] [snip] FlameBateAnd for those interested in using a real computer/ FlameBate, it's GUI also runs under MacOSX. [/snip] If they are real why aren't there more of them? Because they have 'real' price tags. Shame really, as OS X pisses all over Windows from a great height. Oh well, nothing wrong with being in an elite minority ;) [/snip] I wish, oh how I wish (and if you have been reading this list for any amount of time in the past 6 months, you'd know) that Santa Claus would bring me BSD OS's on all of my servers and give our network personel the cajone's to deal with the change. Please Santa? If you give me this I promise to never ask for anything more than peace on Earth, goodwill towards men ever again. Promise. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
When you say SlickEdit has a ftp client built in, is it a separate window that gets launched, or is it more integrated, like you can just right click on your list of files and say put these files up on the server. It's integrated. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirects Safari vs Others
On Dec 6, 2005, at 2:55 PM, Mark Steudel wrote: Sorry it took me so long, I wasn't sure where the problem lay and couldn't get you the exact code, but I figured out why (sorta) this was happening. // Causes only Safiri to bomb header(location: .$_SERVER['PHP_SELF'].?action=listentriescategoryid=. $id.page=.$pagei d); exit; FWIW, I tried to duplicate this and wasn't able to. Here's a short test script: ?php if ($_GET['action']) echo ok; else header(Location:.$_SERVER['PHP_SELF'].?action=listcat=id); ? When I hit that page, it behaves as expected, redirects to the same page with ?action.. and then it responds by printing 'ok'. This is using PHP 4.3.10 and Safari v2.0.2 (416.13). [EMAIL PROTECTED]:~{0}% telnet dev.tangledhelix.com 80 Trying 205.196.219.129... Connected to dev.tangledhelix.com. Escape character is '^]'. GET /php_self/ HTTP/1.1 Host: dev.tangledhelix.com HTTP/1.1 302 Date: Tue, 06 Dec 2005 20:15:53 GMT Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/ 1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e X-Powered-By: PHP/4.3.10 Location: /php_self/index.php?action=listcat=id Transfer-Encoding: chunked Content-Type: text/html 0 GET /php_self/index.php?action=listcat=id HTTP/1.1 Host: dev.tangledhelix.com HTTP/1.1 200 OK Date: Tue, 06 Dec 2005 20:16:10 GMT Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/ 1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e X-Powered-By: PHP/4.3.10 Transfer-Encoding: chunked Content-Type: text/html X-Pad: avoid browser bug 2 ok 0 -- To announce that there must be no criticism of the President, or that we are to stand by the President, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public. -Theodore Roosevelt, 1918 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Migration to PHP5
Hi, Does anyone have stats in terms of migration from 4 to 5, specifically I'd like to know if the bulk of PHP developers have begun to change-over. I am (was) a Java developer, but have been doing freelance/consultant work in PHP for two years and am still developing on PHP4 platform. I remember when PHP4 was introduced (while I was still in college), and I made the transition to it immediately, but I have refrained from doing so for 5, since most development gigs are still working with 4. Basically I am wondering if it would be advantageous to make the switch; on another note, with PHP5's stronger OO model, I am considering moving from page-centric to an MVC model, but it seems there are a million MVC frameworks available and haven't had any experience with them. Comments? Christian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Redirects Safari vs Others
[snip] // Causes only Safiri to bomb header(location: .$_SERVER['PHP_SELF'].?action=listentriescategoryid=.$id.page=.$pagei d); exit; [/snip] Since PHP is processed server-side it has to be the URL causing Safari to bail. Have you echo'd out the URL to see what it is composed of? $foo = $_SERVER['PHP_SELF'].?action=listentriescategoryid=.$id.page=.$pageid; echo $foo; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Jay Blanchard wrote: [snip] [snip] FlameBateAnd for those interested in using a real computer/ FlameBate, it's GUI also runs under MacOSX. [/snip] If they are real why aren't there more of them? Because they have 'real' price tags. Shame really, as OS X pisses all over Windows from a great height. Oh well, nothing wrong with being in an elite minority ;) [/snip] I wish, oh how I wish (and if you have been reading this list for any amount of time in the past 6 months, you'd know) that Santa Claus would bring me BSD OS's on all of my servers and give our network personel the cajone's to deal with the change. Please Santa? If you give me this I promise to never ask for anything more than peace on Earth, goodwill towards men ever again. Promise. Bill's gonna get mad at you. ;) -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Redirects Safari vs Others
You are right, thank you for trying it out and letting me know. I went back and tested this again and it all worked. I then checked out my code where it didn't work and I had moved a single quote outside of the brackets, $_SERVER['PHP_SELF]' ... Oops. -Original Message- From: Dan Lowe [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 12:17 PM To: Mark Steudel Cc: PHP General List Subject: Re: [PHP] Redirects Safari vs Others On Dec 6, 2005, at 2:55 PM, Mark Steudel wrote: Sorry it took me so long, I wasn't sure where the problem lay and couldn't get you the exact code, but I figured out why (sorta) this was happening. // Causes only Safiri to bomb header(location: .$_SERVER['PHP_SELF'].?action=listentriescategoryid=. $id.page=.$pagei d); exit; FWIW, I tried to duplicate this and wasn't able to. Here's a short test script: ?php if ($_GET['action']) echo ok; else header(Location:.$_SERVER['PHP_SELF'].?action=listcat=id); ? When I hit that page, it behaves as expected, redirects to the same page with ?action.. and then it responds by printing 'ok'. This is using PHP 4.3.10 and Safari v2.0.2 (416.13). [EMAIL PROTECTED]:~{0}% telnet dev.tangledhelix.com 80 Trying 205.196.219.129... Connected to dev.tangledhelix.com. Escape character is '^]'. GET /php_self/ HTTP/1.1 Host: dev.tangledhelix.com HTTP/1.1 302 Date: Tue, 06 Dec 2005 20:15:53 GMT Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/ 1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e X-Powered-By: PHP/4.3.10 Location: /php_self/index.php?action=listcat=id Transfer-Encoding: chunked Content-Type: text/html 0 GET /php_self/index.php?action=listcat=id HTTP/1.1 Host: dev.tangledhelix.com HTTP/1.1 200 OK Date: Tue, 06 Dec 2005 20:16:10 GMT Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/ 1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e X-Powered-By: PHP/4.3.10 Transfer-Encoding: chunked Content-Type: text/html X-Pad: avoid browser bug 2 ok 0 -- To announce that there must be no criticism of the President, or that we are to stand by the President, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public. -Theodore Roosevelt, 1918 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On 6 Dec 2005, at 19:24, Jay Blanchard wrote: [snip] FlameBateAnd for those interested in using a real computer/ FlameBate, it's GUI also runs under MacOSX. [/snip] If they are real why aren't there more of them? Far to many people have fallen victim to the deception field emanating from Microsoft. The only known cure, barring exceptional innate immunity, is to be exposed to Steve's Reality Distortion Field, which counteracts the deception affects and allows people to recognize the truth. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What software do you use for writing PHP?
Neat, I'll have to check it out. -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 12:14 PM To: Mark Steudel; 'php' Subject: Re: [PHP] What software do you use for writing PHP? When you say SlickEdit has a ftp client built in, is it a separate window that gets launched, or is it more integrated, like you can just right click on your list of files and say put these files up on the server. It's integrated. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
Jason Petersen wrote: Vim is my editor of preference. If I have to use Windows, I usually go with Homesite (because I already have a licensed copy) or Textpad (because it's better than Notepad). IDEs? Who needs 'em ;) Who? Anyone who understands just how useful a debugger can be in increasing productivity, when used properly (i.e. one should not become dependent upon using the debugger to catch every coding error) ... which is the primary reason why I would recommend Zend Studio. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forum
On 12/6/05, Larry E. Ullman [EMAIL PROTECTED] wrote: Does anyone of you know of a good forum that is easy to customize and supports sticky notes, user registration, bb code and stuff like that? I would suggest that Phorum (www.phorum.org) and phpBB (www.phpbb.com) are the two biggies (written in PHP). Both have all these features plus many available mods. Larry I second phpbb. You can see it on my forum at lyricslist: http://lyricslist.com/forum One big problem that I have had is with forum spam. Phpbb makes it easy to control. I won't go into all the details, but you could research that yourself easily enough. Or email me personally. Dotan Cohen http://technology-sleuth.com/long_answer/what_is_hdtv.html
Re: [PHP] Assigns True but not false?
On Tuesday 06 December 2005 17:38, Gabe wrote: $this-m_arrQuesInfo[$this-m_itemID]['blnVacPromo'] = ( ( !empty($_POST['vac_promo']) ) ( $_POST['vac_promo'] == 'on' ) ) ? TRUE : FALSE; I have a habit of casting true or false to boolean so that I'm sure they're not interpreted as 1 or 0. Try this $this-m_arrQuesInfo[$this-m_itemID]['blnVacPromo'] = ( ( !empty($_POST['vac_promo']) ) ( $_POST['vac_promo'] == 'on' ) ) ? (bool) true:(bool) false; HTH Andy -- Now listening to Whigfield - Saturday Night on amaroK Geek code: www.vlaamse-kern.com/geek Registered Linux User No 379093 If life was for sale, what would be its price? www.vlaamse-kern.com/sas/ for free php utilities -- pgpIcUbBe2Pum.pgp Description: PGP signature
Re: [PHP] Forum
On 12/6/05, Andy Pieters [EMAIL PROTECTED] wrote: On Tuesday 06 December 2005 21:25, you boldly pressed keys on your keyboard to form this message: One big problem that I have had is with forum spam. Phpbb makes it easy to control. I won't go into all the details, but you could research that yourself easily enough. Or email me personally. Hi Dotan I've looked at phpBB but I got a headache trying to figure out how to style and customize it. I've currently downloaded Phorum and started playing with it. Looks a lot easier then phpBB. Have you been able to customize phpBB at your heart's content, stylewyse that is? With kind regards Andy Yes, I have. In the '/templates/subSilver' folder there are files overall_header and overall_footer that you can customize and that customizes each page. Those were the only files that I touched (look-wise). I also added a few other mods that don't affect the look of the forum. Email me if you get stuck. Dotan http://technology-sleuth.com/long_answer/why_are_internet_greeting_cards_dangerous.html .
[PHP] references, circular references, oop, and garbage collection in PHP5
So.. I am having PHP5 memory management problems. They are similar to those described in this thread: http://aspn.activestate.com/ASPN/Mail/Message/php-Dev/1555640 (so maybe this question belongs on php-dev but I figured I'd try here first... seems like a userland question) Basically I have an object model to represent db objects, and I am bulk-loading the objects via some PHP scripts. Sadly the scripts consume unbounded memory because of this problem. I have done a lot of programming in C++ and Obj-C and the normal way to handle circular references is to have parents retain (keep ref- counted links) to their kids, and have the kids have weak references (non-ref-counted) links to their parents. This way, when the parent is no longer used, it will automatically 0-out the ref counts to all children it links too and things GC correctly. Now, how to do this in PHP? Well, there are no documented weak references. However, I figured out by trial that if you obtain a php-reference to an object, it doesn't bump the refcount. Question #1: Is the fact that references to objects in the form $objRef = $obj don't bump the refcount of $obj an intended behavior that can be counted on? If so, cool! So, now that we have a way to do weak references, we should be able to implement a reasonable memory management scheme for parent-child objects. Normally from the client side the interface should look something like: $parent = new Parent(); $child = new Child(); $parent-addChild($child); Where parent can have 0,n children and child can have 0,1 parent. And all of parent's internal links to child should be refcounted, and the internal links from child to parent are weak (not ref-counted). So based on the above discovery about references, I tried to implement this as such: class Parent { public $children = array(); // add a child to our list. We want a ref-counted link here. function addChild($child) { $this-children[] = $child;// refCounted desired in parent-child link $child-setParent($this); } } class Child { public $parent; // set the parent object. We want a non-ref-counted link here. function setParent($parent) { // refCount NOT desired in child-parent link $this-parent = $parent; } } Now, you'd expect this would work, but it doesn't. On a hunch, I changed the client code to: $parent = new Parent(); $child = new Child(); $parent-addChild($child); $child-setParent($child); // new line here - you can successfully create a reference to the object when not passed in as $this Now, this works! However, it's not practical. The setParent call should work from within the parent object So what I figured out is that $this is a pseudo variable according to the docs, but I don't know what that means. Empirically I have figured out that it means you cannot create a reference to it. Is this a feature or a bug? What's the workaround? This is a serious problem for PHP scripts that need to do things that require large amounts of memory. Please advise. Thanks, Alan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
John Nichel wrote: Jay Blanchard wrote: [snip] [snip] FlameBateAnd for those interested in using a real computer/ FlameBate, it's GUI also runs under MacOSX. [/snip] If they are real why aren't there more of them? Because they have 'real' price tags. Shame really, as OS X pisses all over Windows from a great height. Oh well, nothing wrong with being in an elite minority ;) [/snip] I wish, oh how I wish (and if you have been reading this list for any amount of time in the past 6 months, you'd know) that Santa Claus would bring me BSD OS's on all of my servers and give our network personel the cajone's to deal with the change. Please Santa? If you give me this I promise to never ask for anything more than peace on Earth, goodwill towards men ever again. Promise. Bill's gonna get mad at you. ;) ballmer's gonna throw chairs at jay ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] references, circular references, oop, and garbage collection in PHP5
I am uncertain on this, but I believe that the $this variable is already just a reference to the class you are calling it from. Then passing the reference by-reference to the addParent() method of the Child class could be what is causing your issue. I'd be curious to see what would happen if you took out the pass-by-reference and instead pass-by-value for the addParent() method. Then again, that doesn't particularly sound correct either. This link might help. They cover a lot of advanced reference usage for PHP. http://www.onlamp.com/pub/a/php/2002/09/12/php_foundations.html Alan Pinstein wrote: So.. I am having PHP5 memory management problems. They are similar to those described in this thread: http://aspn.activestate.com/ASPN/Mail/Message/php-Dev/1555640 (so maybe this question belongs on php-dev but I figured I'd try here first... seems like a userland question) Basically I have an object model to represent db objects, and I am bulk-loading the objects via some PHP scripts. Sadly the scripts consume unbounded memory because of this problem. I have done a lot of programming in C++ and Obj-C and the normal way to handle circular references is to have parents retain (keep ref- counted links) to their kids, and have the kids have weak references (non-ref-counted) links to their parents. This way, when the parent is no longer used, it will automatically 0-out the ref counts to all children it links too and things GC correctly. Now, how to do this in PHP? Well, there are no documented weak references. However, I figured out by trial that if you obtain a php-reference to an object, it doesn't bump the refcount. Question #1: Is the fact that references to objects in the form $objRef = $obj don't bump the refcount of $obj an intended behavior that can be counted on? If so, cool! So, now that we have a way to do weak references, we should be able to implement a reasonable memory management scheme for parent-child objects. Normally from the client side the interface should look something like: $parent = new Parent(); $child = new Child(); $parent-addChild($child); Where parent can have 0,n children and child can have 0,1 parent. And all of parent's internal links to child should be refcounted, and the internal links from child to parent are weak (not ref-counted). So based on the above discovery about references, I tried to implement this as such: class Parent { public $children = array(); // add a child to our list. We want a ref-counted link here. function addChild($child) { $this-children[] = $child;// refCounted desired in parent-child link $child-setParent($this); } } class Child { public $parent; // set the parent object. We want a non-ref-counted link here. function setParent($parent) { // refCount NOT desired in child-parent link $this-parent = $parent; } } Now, you'd expect this would work, but it doesn't. On a hunch, I changed the client code to: $parent = new Parent(); $child = new Child(); $parent-addChild($child); $child-setParent($child);// new line here - you can successfully create a reference to the object when not passed in as $this Now, this works! However, it's not practical. The setParent call should work from within the parent object So what I figured out is that $this is a pseudo variable according to the docs, but I don't know what that means. Empirically I have figured out that it means you cannot create a reference to it. Is this a feature or a bug? What's the workaround? This is a serious problem for PHP scripts that need to do things that require large amounts of memory. Please advise. Thanks, Alan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Optimizing Images
Hi all, ok, I'm trying to write a script to optimize images for the web, but I can't seem to figure out how to go about reducing the color pallete, and therefor reducing the size of the images. I'm trying to be generic about it so that users can optimize GIF's and JPG's or even PNG's. I can't find much in the way of code on the net about doing this... Does anyone have any suggestions as to maybe some freely available scripts or classes that can help me figure this out ??? Thanks, Tim. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Optimizing Images
Tim Traver wrote: Hi all, ok, I'm trying to write a script to optimize images for the web, but I can't seem to figure out how to go about reducing the color pallete, and therefor reducing the size of the images. I'm trying to be generic about it so that users can optimize GIF's and JPG's or even PNG's. I can't find much in the way of code on the net about doing this... Does anyone have any suggestions as to maybe some freely available scripts or classes that can help me figure this out ??? Thanks, Tim. If you're working from a Linux box, do some studying on imagemagik. It has scads of tools and uses one of the best optimization algorythms I've seen. A very powerful tool.. can do low res, watermarks, resizing.. and on and on and on. John Hinton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web calendar and online Dairy
Hi! I need a web calendar and online diary application. Can some one develop those applications for me. You may use open source applications, or already developed applications in your previous projects, I need simplest calendar and online diary applications. And ofcourse, I will pay you. thank you! Vikram!
[PHP] Debuggers on Windows Servers
Anyone out there running debuggers and profilers on your windows boxes? I'd like to start profiling some of my code and use some debuggers. Since we have dev sites on the same box with product sites, I wanted to make sure that before I ask our Sysadmin to install anything that they are stable and easy to install. Any suggetsions out there? Ones that I have run across, xdebug, DBG, Advanced PHP Debugger. Thanks, Mark
Re: [PHP] Web calendar and online Dairy
Vikram Kumar wrote: Hi! I need a web calendar and online diary application. Try this, it might fit your needs. http://www.k5n.us/webcalendar.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Assigns True but not false?
On Tue, Dec 06, 2005 at 12:38:28PM -0500, Gabe wrote: In this if statement, if the condition is true, then it will assign true to the array (as I want it to). If the condition evaluates to false, it assigns nothing. Any idea why it won't assign false? If I switch the FALSE boolean value to the number 0, that will get assigned. Seems kinda strange... $this-m_arrQuesInfo[$this-m_itemID]['blnVacPromo'] = ( ( !empty($_POST['vac_promo']) ) ( $_POST['vac_promo'] == 'on' ) ) ? TRUE : FALSE; It only appears to be nothing, if you issue: php -r echo false; Nothing happens. if you issue: php -r var_dump(false); You'll get bool(false) Btw, your condition is doing extra work. Consider the output of: php -r var_dump(0 1); Outputs: bool(false) So your condition to return true or false isn't really needed, a simple: $this-m_arrQuesInfo[$this-m_itemID]['blnVacPromo'] = ( !empty($_POST['vac_promo'])$_POST['vac_promo'] == 'on'; ) Will be exactly the same thing. Also I would suggest changing empty() to isset(), so you would have $this-m_arrQuesInfo[$this-m_itemID]['blnVacPromo'] = ( isset($_POST['vac_promo'])$_POST['vac_promo'] == 'on'; ) empty() in this case doesn't really mean anything, the isset() will prevent a E_NOTICE to happen. HTH, Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On Tue, Dec 06, 2005 at 06:36:33PM +0100, M. Sokolewicz wrote: Jason Petersen wrote: On 12/6/05, Jeff McKeon [EMAIL PROTECTED] wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Vim is my editor of preference. If I have to use Windows, I usually go with Homesite (because I already have a licensed copy) or Textpad (because it's better than Notepad). IDEs? Who needs 'em ;) Best, Jason same here :) Vim on UNIX machines, and Textpad on Windows man you guys are wimps.. gvim on windows... :) Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Classes/Objects - Books/Links?
Hello, I want to learn about classes and objects in PHP. (IMHO) I would say that my understanding of functions is very good. Any books that you could suggest that specifically address just classes/objects? How-a-bout sites/links/tutorials on the web? I am hoping that by learning how to use classes/objects in PHP I can streamline how I code. Thanks in advance! Cheers, Micky -- ¸.·´¯`·.¸¸(((º`·.¸¸.·´¯`·.¸¸º ·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸º `·.¸¸º¸.·´¯`·.¸¸º -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Classes/Objects - Books/Links?
Michael Hulse wrote: Any books that you could suggest that specifically address just classes/objects? Adam Trachtenberg's Upgrading to PHP 5 (O'Reilly) is a good book. It covers all of the new features in PHP 5 (so it's not just OOP, sorry), but the chapter on objects is excellent. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What software do you use for writing PHP?
On Dec 6, 2005, at 6:38 PM, Curt Zirzow wrote: On Tue, Dec 06, 2005 at 06:36:33PM +0100, M. Sokolewicz wrote: Jason Petersen wrote: On 12/6/05, Jeff McKeon [EMAIL PROTECTED] wrote: Hey all, Forever now I've been using Frontpage for all my web work including php. I'm sure there's better software out there that is more suited to writing and editing PHP pages. What do you all use? Vim is my editor of preference. If I have to use Windows, I usually go with Homesite (because I already have a licensed copy) or Textpad (because it's better than Notepad). IDEs? Who needs 'em ;) Best, Jason same here :) Vim on UNIX machines, and Textpad on Windows Shot... BBEdit[1] Dreamweaver[2] on a Mac[3] baby! [1]http://www.barebones.com/products/bbedit/index.shtml [2]http://www.macromedia.com/software/dreamweaver/ [3]http://www.apple.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Urlencode vs htmlentities
Should I use htmlentites on $top first? AFAIK, all of what you said is correct except for that, where you should use htmlentities(urlencode($top)). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php