php-general Digest 11 Nov 2007 14:44:01 -0000 Issue 5122
php-general Digest 11 Nov 2007 14:44:01 - Issue 5122 Topics (messages 264309 through 264317): Re: Cannot send a hyperlink 264309 by: Brad 264310 by: Stut 264312 by: admin.buskirkgraphics.com 264313 by: M. Sokolewicz 264314 by: admin.buskirkgraphics.com Re: PHP ide? 264311 by: Mario Guenterberg What to do when flush() doesn't? 264315 by: Jon Westcot 264316 by: admin.buskirkgraphics.com Re: chrooted php5-cgi in a non chrooted apache 264317 by: Joerg Schoppet Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Explanation of code $email = $_REQUEST['email'] ; (generated by dreamweaver that pulls in the database functions) $message = 'a href='.www.zoneofsuccessclub.com.'link /a'; (my nemesis, I can not figure out this puppy. If it works at all, php will generate it at text and not html. Taken from example I find on the web.) $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; (found on the web to solve my html problem???) mail( $email, Your FREE book from Zone of Success Club .com, $headers, $message, From: $email ); ? (Send the mail, when I put $headers in, the function quits working all together.) I hope this helps explain where my head is! Brad -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Saturday, November 10, 2007 4:55 PM To: Brad Cc: 'Jochem Maas'; [EMAIL PROTECTED] Subject: Re: [PHP] Cannot send a hyperlink Brad wrote: I am not sure that would help. Just another can of worms. The $_REQUEST is tied into a whole bunch of database functions. I have no idea what you mean by this. It makes no sense to me. My present code ? $email = $_REQUEST['email'] ; $message = 'a href='.www.zoneofsuccessclub.com.'link /a'; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; mail( $email, Your FREE book from Zone of Success Club .com, $headers, $message, From: $email ); ? You *really* need to read the manual page for function before you use them. For example a quick glance at http://php.net/function.mail reveals that you have the parameters in an almost completely wrong order. And please tell me you're not really setting the to address directly from an external variable with verifying that it's just an email address and nothing else. Really bad idea. -Stut -- http://stut.net/ -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Saturday, November 10, 2007 3:44 PM To: Brad Subject: Re: [PHP] Cannot send a hyperlink this will help: http://phpmailer.sourceforge.net/ Brad wrote: I am having trouble send an email with a hyperlink Php is parsing html as text If I add the proper header information to ?make it work? The email no longer goes through? Here is the code ? $email = $_REQUEST['email'] ; $body = 'a href='.www.zoneofsuccessclub.com.'link /a'; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; mail( $email, Your FREE book from Zone of Success Club .com, $headers, $message, From: $email ); ? Thanks Brad No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007 10:41 AM No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007 10:41 AM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007 10:41 AM No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007 10:41 AM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007 10:41 AM ---End Message--- ---BeginMessage--- Brad wrote: Explanation of code $email = $_REQUEST['email'] ; (generated by dreamweaver that pulls in the database functions) No database involved here. None. Nadda. Niet! $message = 'a href='.www.zoneofsuccessclub.com.'link /a'; (my nemesis, I can not figure out this puppy. If it works at all, php will generate it at text and not html. Taken from example I find on the web.) That's because it's not valid PHP. This is probably what you're after... $message = 'a href=http://www.zoneofsuccessclub.com;link/a'; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; (found on the web
php-general Digest 12 Nov 2007 02:46:22 -0000 Issue 5123
php-general Digest 12 Nov 2007 02:46:22 - Issue 5123 Topics (messages 264318 through 264336): Re: chrooted php5-cgi in a non chrooted apache 264318 by: Joerg Schoppet functions versus includes 264319 by: Frank Lopes 264331 by: Frank Lopes 264332 by: Nathan Nobbe 264333 by: Chris 264334 by: Bastien Koert 264335 by: Robert Cummings PHP editor 264320 by: Frank Lopes 264321 by: Jay Blanchard 264322 by: Per Jessen 264323 by: Daniel Brown 264324 by: elk dolk 264326 by: Jochem Maas 264327 by: Børge Holen 264328 by: Brendon Van Heyzen 264329 by: Jochem Maas 264330 by: Børge Holen Re: Help securing a server : Owned by W4n73d H4ck3r 264325 by: Dimiter Ivanov Need a hint how to track an error 264336 by: Ronald Wiplinger Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi Jochem, yes, you are right. But as you wrote, it is only a work around and won't give me the security I want to have. Joerg Jochem Maas wrote: hi Joerg, not a solution but the open_basedir ini setting on a per Vhost setting may offer a [partial] work around ---End Message--- ---BeginMessage--- I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Thanks for the your thoughts. ---End Message--- ---BeginMessage--- No takers on this topic? Frank Lopes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Thanks for the your thoughts. ---End Message--- ---BeginMessage--- On Nov 11, 2007 6:02 PM, Frank Lopes [EMAIL PROTECTED] wrote: No takers on this topic? Frank Lopes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Thanks for the your thoughts. what do you imagine the code might look like in the .inc file? if you create a variable in global scope in your first script say $a = 5; then in another file you intend to include you modify it, again in global scope, if($a 5) { $a = 10; } else { $a = 0; } well i think that is really messy. getting to the function idea.. were you planning to put the function in the same file and thats why you view it as an alternative to including a file? i would at least create a function and put it in the file you intend to include. i imagine it will be a hair slower, but it will be much more organized. -nathan ---End Message--- ---BeginMessage--- Frank Lopes wrote: I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Micro-optimization is pretty useless. I seriously doubt you would notice any difference in performance. This comes under the other discussions like about which is faster - a foreach/while/for loop. You'll find other bottlenecks (eg changing a regex to do an str_replace) which will make a bigger difference. -- Postgresql php tutorials http://www.designmagick.com/ ---End
Re: [PHP] PHP ide?
On Fri, Nov 09, 2007 at 01:44:19PM +, Lester Caine wrote: Tiago Silva wrote: Lester Caine escreveu: Robert Cummings wrote: Ubuntu = Debian + New Life Mandriva has Eclipse and PHPEclipse 'out of the box' along with Apache and PHP I can build a fully functional development machine from a pile of bits in under an hour ;) And currently that includes downloading the latest updates :) I use an OS called Windows Vista :-P hahahha crap(I use openSuse... ;-) ) Guys, talking about features of distributions is a looping question...it's a vicious endless thing... let's talk about PHP ide's ok? I use eclipse, with PHPEclipse it's fullfeatured for PHP, look, FOR PHP! The good programmer don't need a full featured IDE, like Delphi for PHP and anyothers that wrap you behind the scenes... Not had to bother with vista yet - in fact a lot of my hardware intensive stuff simply will not run on it :( BUT the best thing about Eclipse is that it runs the same on windows as Linux, so I don't have to have different environments on each. I just run a local CSV server and sync things between the two environments. And now I can move stuff that was originally developed on Windows over to Linux - or replace it with PHP powered stuff :) Hi all... in the past i'd worked for a web development company. We had some Windows, some MacOSX and some Linux workstations and a central Dedian development server. The best solution to work with an IDE was the use of Eclipse with the needed plugins. On every machine the same environment for development and the individual stuff for design/grafix and more. No problems with a central subversion/CVS repo and a NFS/Samba share for the apache document root on the devel server. regards Mario -- - | havelsoft.com - Ihr Service Partner für Open Source | | Tel: 033876-21 966 | | Notruf: 0173-277 33 60 | | http://www.havelsoft.com| | | | Inhaber: Mario Günterberg | | Mützlitzer Strasse 19 | | 14715 Märkisch Luch | - signature.asc Description: Digital signature
RE: [PHP] Cannot send a hyperlink
The Answer is quiet simple. $E_MAIL = [EMAIL PROTECTED]; $to = [EMAIL PROTECTED]; $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; $headers .= To: Their Name[EMAIL PROTECTED] \r\n; $headers .= From: your email [EMAIL PROTECTED]\r\n; $link = http://www.zoneofsuccessclub.com;; $mailmsg = BLAH BLAH BLAH link:a href=$linkzoneofsuccessclub/a; $mailsubject = what ever you want to say; mail($E_MAIL, $mailsubject, $mailmsg, $headers); You can use the database to generate the $E_MAIL address and the $to Never Ever had this to not work. Your problem is the Headers are missing which allows the html content to embed into the email. Try that I think you will be happy. -Original Message- From: Brad [mailto:[EMAIL PROTECTED] Sent: Saturday, November 10, 2007 2:36 PM To: php-general@lists.php.net Subject: [PHP] Cannot send a hyperlink I am having trouble send an email with a hyperlink Php is parsing html as text If I add the proper header information to ?make it work? The email no longer goes through? Here is the code ? $email = $_REQUEST['email'] ; $body = 'a href='.www.zoneofsuccessclub.com.'link /a'; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; mail( $email, Your FREE book from Zone of Success Club .com, $headers, $message, From: $email ); ? Thanks Brad No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007 10:41 AM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot send a hyperlink
[EMAIL PROTECTED] wrote: The Answer is quiet simple. $E_MAIL = [EMAIL PROTECTED]; $to = [EMAIL PROTECTED]; $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; $headers .= To: Their Name[EMAIL PROTECTED] \r\n; $headers .= From: your email [EMAIL PROTECTED]\r\n; $link = http://www.zoneofsuccessclub.com;; $mailmsg = BLAH BLAH BLAH link:a href=$linkzoneofsuccessclub/a; $mailsubject = what ever you want to say; Well, anyone doing this: mail($E_MAIL, $mailsubject, $mailmsg, $headers); makes ME very unhappy. I don't get it, what's so hard to understand about NOT HAVING TO USE ANY QUOTES HERE ? Are you defining any type of string-like values here? no. Then you don't need quotes, right? no, you don't. SO DON'T USE THEM HERE THEN. You're defining a $to and an $E_MAIL, you're not using $to anywhere, and only using $E_MAIL in one place (out of two), thus creating a mismatch between your headers and the To parameter for mail (which is used in SMTP traffic). [iz bad (tm)] - Tul You can use the database to generate the $E_MAIL address and the $to Never Ever had this to not work. Your problem is the Headers are missing which allows the html content to embed into the email. Try that I think you will be happy. -Original Message- From: Brad [mailto:[EMAIL PROTECTED] Sent: Saturday, November 10, 2007 2:36 PM To: php-general@lists.php.net Subject: [PHP] Cannot send a hyperlink I am having trouble send an email with a hyperlink Php is parsing html as text If I add the proper header information to ?make it work? The email no longer goes through? Here is the code ? $email = $_REQUEST['email'] ; $body = 'a href='.www.zoneofsuccessclub.com.'link /a'; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; mail( $email, Your FREE book from Zone of Success Club .com, $headers, $message, From: $email ); ? Thanks Brad No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007 10:41 AM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cannot send a hyperlink
Brad I'm sorry. Instead of insulting you and telling you to go read a book I simply explained an option. Yes you do not need quotes in the mail() function. As for the declared variables I was trying to show you an example. You will find many explanations for how or what is best practice. Remember that some people like to toot a horn that can be reputed in many ways. These are the same people who again and again are not the ones who answer the questions, yet try to take credit by belittling the answer with gibberish. The answer was intended to take you in a better direction when constructing a email application in php. $eol=\r\n; $headers .= From: .$fromname..$fromaddress..$eol; $headers .= Reply-To: .$fromname..$fromaddress..$eol; $headers .= Return-Path: .$fromname..$fromaddress..$eol; $headers .= Message-ID: .time().-.$fromaddress..$eol; $headers .= X-Mailer: PHP v.phpversion().$eol; $msg .= --.$htmlalt_mime_boundary.$eol; $msg .= Content-Type: text/html; charset=iso-8859-1.$eol; $msg .= Content-Transfer-Encoding: 8bit.$eol.$eol; $msg .= $body.$eol.$eol; mail($to, $subject, $msg, $headers); -Original Message- From: M. Sokolewicz [mailto:[EMAIL PROTECTED] Sent: Sunday, November 11, 2007 4:07 AM To: [EMAIL PROTECTED] Cc: 'Brad'; php-general@lists.php.net Subject: Re: [PHP] Cannot send a hyperlink [EMAIL PROTECTED] wrote: The Answer is quiet simple. $E_MAIL = [EMAIL PROTECTED]; $to = [EMAIL PROTECTED]; $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; $headers .= To: Their Name[EMAIL PROTECTED] \r\n; $headers .= From: your email [EMAIL PROTECTED]\r\n; $link = http://www.zoneofsuccessclub.com;; $mailmsg = BLAH BLAH BLAH link:a href=$linkzoneofsuccessclub/a; $mailsubject = what ever you want to say; Well, anyone doing this: mail($E_MAIL, $mailsubject, $mailmsg, $headers); makes ME very unhappy. I don't get it, what's so hard to understand about NOT HAVING TO USE ANY QUOTES HERE ? Are you defining any type of string-like values here? no. Then you don't need quotes, right? no, you don't. SO DON'T USE THEM HERE THEN. You're defining a $to and an $E_MAIL, you're not using $to anywhere, and only using $E_MAIL in one place (out of two), thus creating a mismatch between your headers and the To parameter for mail (which is used in SMTP traffic). [iz bad (tm)] - Tul You can use the database to generate the $E_MAIL address and the $to Never Ever had this to not work. Your problem is the Headers are missing which allows the html content to embed into the email. Try that I think you will be happy. -Original Message- From: Brad [mailto:[EMAIL PROTECTED] Sent: Saturday, November 10, 2007 2:36 PM To: php-general@lists.php.net Subject: [PHP] Cannot send a hyperlink I am having trouble send an email with a hyperlink Php is parsing html as text If I add the proper header information to ?make it work? The email no longer goes through? Here is the code ? $email = $_REQUEST['email'] ; $body = 'a href='.www.zoneofsuccessclub.com.'link /a'; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; mail( $email, Your FREE book from Zone of Success Club .com, $headers, $message, From: $email ); ? Thanks Brad No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007 10:41 AM -- 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] What to do when flush() doesn't?
Hi all: I am trying to get information from a rather long-running PHP script to send out messages to the client as things are being processed. In reading the manual, it seemed that using flush() was the ideal command for this. Well, it doesn't seem to be working for me. I've even tried sending over a large number of blanks (like 4096 of 'em) before doing anything, but still no go. The flush() activity is supposed to occur on a page that has POSTed back to itself, so perhaps that's causing the heartburn? Any suggestions on how I can accomplish this type of user mollification? Thanks, Jon
RE: [PHP] What to do when flush() doesn't?
ob_flush();Flush(); works for me. -Original Message- From: Jon Westcot [mailto:[EMAIL PROTECTED] Sent: Sunday, November 11, 2007 5:31 AM To: PHP General Subject: [PHP] What to do when flush() doesn't? Hi all: I am trying to get information from a rather long-running PHP script to send out messages to the client as things are being processed. In reading the manual, it seemed that using flush() was the ideal command for this. Well, it doesn't seem to be working for me. I've even tried sending over a large number of blanks (like 4096 of 'em) before doing anything, but still no go. The flush() activity is supposed to occur on a page that has POSTed back to itself, so perhaps that's causing the heartburn? Any suggestions on how I can accomplish this type of user mollification? Thanks, Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] chrooted php5-cgi in a non chrooted apache
Hi Jochem, yes, you are right. But as you wrote, it is only a work around and won't give me the security I want to have. Joerg Jochem Maas wrote: hi Joerg, not a solution but the open_basedir ini setting on a per Vhost setting may offer a [partial] work around -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] functions versus includes
I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Thanks for the your thoughts. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP editor
Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? I have experimented with DreamWeaver, UltraEdit, phoDesigner, Eclipse etc. What would you recommend that I use? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP editor
[snip] Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? [/snip] Search the archives, there was a discussion on IDE's just last week. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor
Frank Lopes wrote: Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? Personally I use vi or kate. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor
On Nov 11, 2007 11:23 AM, Per Jessen [EMAIL PROTECTED] wrote: Frank Lopes wrote: Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? Personally I use vi or kate. Specifically, ViM (Vi iMproved) for me. It's rare that I do much with the OS GUI I'm much more comfortable in a command-line environment. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Editor
Frank Lopes wrote: Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? Personally I use vi or kate. An editor that can give you WYSIWYG and color print outs. Has anybody any idea? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: [PHP] Help securing a server : Owned by W4n73d H4ck3r
On Nov 9, 2007 5:48 PM, robert mena [EMAIL PROTECTED] wrote: Hi Daniel, According to the audit this happened yesterday. I am searching astalavista but could not find anything, probably because I am being too specific. From the php side (or closely) what steps would you recommend in order to have a better security? I could not find a consistent 'list' of configuration settings to disable or change besides the register_globals. From the system side my list so far includes (some already in place previous) - no devel tools installed on the server (gcc etc) - /tmp mounted with no_exec - chroot apache - use mod_security Thanks. It's all good. We go off on tangents enough here anyway, so I suppose one more wouldn't hurt. ;-P The person doing this seems to be relatively new to the scene, only defacing websites with common vulnerabilities that you can find anywhere on the Internet (http://astalavista.box.sk/ for example). Check out Zone-H (http://www.zone-h.net/) to see if your domains are on there, and to see if you can build a pattern from his/her past exploits. That should help you in determining how he/she is doing it. You're on the right track in guessing that it was CMS-related. Remember how many sites and servers were compromised when phpBB exploits were announced and left unpatched? These jackass skript kiddies just Google for known versions and deface whatever they can. It's not like the old days where you picked a target and found a way in now it's just that you pick your way in and find a target. *yawn!* No challenge anymore these kids are too lazy -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You may try the suhosin patch: http://www.hardened-php.net/suhosin/ I'm using FreeBSD and the current versions of php comes with it selected by default (probably for a good reason) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor
Jay Blanchard wrote: [snip] Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? [/snip] Search the archives, there was a discussion on IDE's just last week. and pretty much every week before that :-) when beginning your most valuable tool is not the IDE but ... http://php.net/ as in http://php.net/search-param|function-name|extension-name|etc and when your really stuck, a well thought out question to this list will usually result in something helpful[tm]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor
On Sunday 11 November 2007 20:36:39 Jochem Maas wrote: Jay Blanchard wrote: [snip] Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? [/snip] Search the archives, there was a discussion on IDE's just last week. and pretty much every week before that :-) when beginning your most valuable tool is not the IDE but ... http://php.net/ as in http://php.net/search-param|function-name|extension-name|etc and when your really stuck, a well thought out question to this list will usually result in something helpful[tm]. WHAT... whenever did that happen?!!? -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor
Combo of Zend neon and vim (macvim). --Brendon On Nov 11, 2007, at 10:35 AM, Frank Lopes wrote: Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? I have experimented with DreamWeaver, UltraEdit, phoDesigner, Eclipse etc. What would you recommend that I use? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor
Børge Holen wrote: On Sunday 11 November 2007 20:36:39 Jochem Maas wrote: Jay Blanchard wrote: [snip] Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? [/snip] Search the archives, there was a discussion on IDE's just last week. and pretty much every week before that :-) when beginning your most valuable tool is not the IDE but ... http://php.net/ as in http://php.net/search-param|function-name|extension-name|etc and when your really stuck, a well thought out question to this list will usually result in something helpful[tm]. WHAT... whenever did that happen?!!? no sure about the well thought out question. with regard to something helpful you have to remember it's something akin to microsoft's innovative software and fair market practices -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP editor
On Sunday 11 November 2007 22:31:29 Jochem Maas wrote: Børge Holen wrote: On Sunday 11 November 2007 20:36:39 Jochem Maas wrote: Jay Blanchard wrote: [snip] Being very new to PHP (empahsis on VERY...), I wonder what most of you use to develop in PHP? [/snip] Search the archives, there was a discussion on IDE's just last week. and pretty much every week before that :-) when beginning your most valuable tool is not the IDE but ... http://php.net/ as in http://php.net/search-param|function-name|extension-name|etc and when your really stuck, a well thought out question to this list will usually result in something helpful[tm]. WHAT... whenever did that happen?!!? no sure about the well thought out question. with regard to something helpful you have to remember it's something akin to microsoft's innovative software and fair market practices oh... well that makes it ok =D -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: functions versus includes
No takers on this topic? Frank Lopes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Thanks for the your thoughts. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: functions versus includes
On Nov 11, 2007 6:02 PM, Frank Lopes [EMAIL PROTECTED] wrote: No takers on this topic? Frank Lopes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Thanks for the your thoughts. what do you imagine the code might look like in the .inc file? if you create a variable in global scope in your first script say $a = 5; then in another file you intend to include you modify it, again in global scope, if($a 5) { $a = 10; } else { $a = 0; } well i think that is really messy. getting to the function idea.. were you planning to put the function in the same file and thats why you view it as an alternative to including a file? i would at least create a function and put it in the file you intend to include. i imagine it will be a hair slower, but it will be much more organized. -nathan
Re: [PHP] functions versus includes
Frank Lopes wrote: I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Micro-optimization is pretty useless. I seriously doubt you would notice any difference in performance. This comes under the other discussions like about which is faster - a foreach/while/for loop. You'll find other bottlenecks (eg changing a regex to do an str_replace) which will make a bigger difference. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: functions versus includes
Wouldn't it be simpler to add some timers in and check for yourself? Bastien To: php-general@lists.php.net From: [EMAIL PROTECTED] Date: Sun, 11 Nov 2007 18:02:58 -0500 Subject: [PHP] Re: functions versus includes No takers on this topic? Frank Lopes wrote in message news:[EMAIL PROTECTED]I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Thanks for the your thoughts. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Have fun while connecting on Messenger! Click here to learn more. http://entertainment.sympatico.msn.ca/WindowsLiveMessenger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] functions versus includes
On Mon, 2007-11-12 at 11:27 +1100, Chris wrote: Frank Lopes wrote: I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Micro-optimization is pretty useless. I seriously doubt you would notice any difference in performance. This comes under the other discussions like about which is faster - a foreach/while/for loop. You'll find other bottlenecks (eg changing a regex to do an str_replace) which will make a bigger difference. Actually, if you're going to use a comparison between using regex and string replacement as an example of lower hanging optimization fruit, I think you'll find the difference between invoking a function and including a file to be on par. The function is by far the better solution when considering speed. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a hint how to track an error
Wrong list! Try a Javascript list. On Nov 11, 2007, at 6:46 PM, Ronald Wiplinger [EMAIL PROTECTED] wrote: My php program is working with Firefox, but not with Internet Explorer. I cannot see anything I did wrong, like forgotten orwhere Firefox is more forgiving than IE. I used the error console from Firefox combined with a lynx output to see what line it is. The error output in IE is: Line: 2 Char: 104 Error: Object doesn't support this property or method Code: 0 URL: http://xxx.xxx.xx/mypage.php In Firefox: Line 225 Field has no properties http://xxx.xxx.xx/mypage.php Not even the same line!!! Line 114 ~ 250 is a long comment! Is there a tool to find the problem? bye Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a hint how to track an error
Ronald Wiplinger wrote: My php program is working with Firefox, but not with Internet Explorer. Nothing to do with php, your problem is javascript. Is there a tool to find the problem? For IE, try http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems building 5.2.4 on Solaris 9 SPARC
Khyron wrote: I have tried this for weeks with no success, so I am asking for help with this. Something seems really off with the PHP 5.2.4 build process. You might get more help on the php-install list rather than this one. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] functions versus includes
On Nov 11, 2007 9:32 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Mon, 2007-11-12 at 11:27 +1100, Chris wrote: Frank Lopes wrote: I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Micro-optimization is pretty useless. I seriously doubt you would notice any difference in performance. This comes under the other discussions like about which is faster - a foreach/while/for loop. You'll find other bottlenecks (eg changing a regex to do an str_replace) which will make a bigger difference. Actually, if you're going to use a comparison between using regex and string replacement as an example of lower hanging optimization fruit, I think you'll find the difference between invoking a function and including a file to be on par. The function is by far the better solution when considering speed. rob is right. i said screw it and wrote out a series of test scripts; just got curious. so, there is one file which includes an external script that operates on a variable in global scope; then there is a script which defines a function internally; then there is a script which includes another script with that function defined in it. the last one won each time; quite to my surprise. [EMAIL PROTECTED] ~/working/www/phpExperiments/functionVsInclude $ php mainWInclude.php 10 totalTime: 0.001057 [EMAIL PROTECTED] ~/working/www/phpExperiments/functionVsInclude $ php mainWFunction.php 10 totalTime: 0.000642 [EMAIL PROTECTED] ~/working/www/phpExperiments/functionVsInclude $ php mainWExternalFunction.php 10 totalTime: 0.000604 ill show the code if anyone wants it. -nathan
Re: [PHP] functions versus includes
Nathan Nobbe wrote: On Nov 11, 2007 9:32 PM, Robert Cummings [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: On Mon, 2007-11-12 at 11:27 +1100, Chris wrote: Frank Lopes wrote: I just started using PHP and got to think... Without getting into the discussion of best practices, strictly from a performance perspective, what is faster: a function or an include? For example I have a block of text that needs to appear mutliple times throughout the site. Will I be better off creating a function with its contents and then later just calling the function or, will it be faster (from an execution perspective) for me to create an .inc file that gets included later on? Micro-optimization is pretty useless. I seriously doubt you would notice any difference in performance. This comes under the other discussions like about which is faster - a foreach/while/for loop. You'll find other bottlenecks (eg changing a regex to do an str_replace) which will make a bigger difference. Actually, if you're going to use a comparison between using regex and string replacement as an example of lower hanging optimization fruit, I think you'll find the difference between invoking a function and including a file to be on par. The function is by far the better solution when considering speed. rob is right. i said screw it and wrote out a series of test scripts; just got curious. so, there is one file which includes an external script that operates on a variable in global scope; then there is a script which defines a function internally; then there is a script which includes another script with that function defined in it. the last one won each time; quite to my surprise. [EMAIL PROTECTED] ~/working/www/phpExperiments/functionVsInclude $ php mainWInclude.php 10 totalTime: 0.001057 [EMAIL PROTECTED] ~/working/www/phpExperiments/functionVsInclude $ php mainWFunction.php 10 totalTime: 0.000642 [EMAIL PROTECTED] ~/working/www/phpExperiments/functionVsInclude $ php mainWExternalFunction.php 10 totalTime: 0.000604 As I said, it's a micro-optimization *shrug*. 0.0004 seconds difference over 10 iterations - wow ;) -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] functions versus includes
On Nov 11, 2007 11:52 PM, Chris [EMAIL PROTECTED] wrote: As I said, it's a micro-optimization *shrug*. 0.0004 seconds difference over 10 iterations - wow ;) actually it was just one iteration; the output isnt very clear, but thats the value of a variable. anyway, i was surprised to see the function was faster at all. i though the include would be faster. so not only is the function faster (if only but a bit) its also cleaner as well. i think a decision between the 2 approaches no-brainer. -nathan
Re: [PHP] functions versus includes
Nathan Nobbe wrote: On Nov 11, 2007 11:52 PM, Chris [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: As I said, it's a micro-optimization *shrug*. 0.0004 seconds difference over 10 iterations - wow ;) actually it was just one iteration; the output isnt very clear, but thats the value of a variable. anyway, i was surprised to see the function was faster at all. i though the include would be faster. so not only is the function faster (if only but a bit) its also cleaner as well. i think a decision between the 2 approaches no-brainer. I'd go for the approach that makes more sense in the application regardless of the milliseconds involved. If that's an include that's what I'll use. In the scheme of the whole app it won't make any difference. You'll waste so much time on optimizing crap like this when fixing a bad database query will actually make a noticable difference, or instead of calling a function inside a loop 50 times, you call it once and pass all the data in through an array. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Programmers Needed
I am looking to hire PHP programmers to help me in various projects I have going on. They all involve PHP, MySQL extensive knowledge and JavaScript would be a plus. Please email me if you're interested. Please include references for people you've done jobs for in the past, work history, knowledge of PHP MySQL JavaScript, desired compensation. This opportunity could result in full-time work if we are successful and it's something you're looking for. Please let me know ASAP. Thanks, Ben