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] -- --- Begin Message --- 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 --- --- Begin Message --- 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 --- --- Begin Message --- 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 --- --- Begin Message --- 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 --- --- Begin Message --- 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
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] -- --- Begin Message --- Explanation of code $email = $_REQUEST['email'] ; (generated by dreamweaver that pulls in the database functions) $message = 'link '; (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 = 'link '; > $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 = 'link '; >> >> $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 --- --- Begin Message --- 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 = 'link '; (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 = 'http://www.zoneofsuccessclub.com";>link'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; (found on the web to so