OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
[suspicious - maybe spam] php-general Digest 31 Mar 2005 06:36:01 -0000 Issue 3369

php-general-digest-helplists.php.net
Date: Thu Mar 31 2005 - 00:36:01 CST


php-general Digest 31 Mar 2005 06:36:01 -0000 Issue 3369

Topics (messages 211902 through 211936):

Re: asking comment
        211902 by: Mikey
        211903 by: Martin.C.Austin.supervalu.com
        211904 by: Jared Williams

How to format every secound row in a database result
        211905 by: Philip Thompson
        211906 by: tg-php.gryffyndevelopment.com

Sourcelabs releases AMP Stack and Test Data
        211907 by: Cornelius Willis
        211908 by: Jay Blanchard
        211909 by: John Nichel

Re: Include file
        211910 by: xfedex
        211911 by: Jay Blanchard
        211912 by: xfedex
        211913 by: Jay Blanchard
        211914 by: Jay Blanchard
        211915 by: John Nichel
        211916 by: xfedex
        211918 by: Richard Davey
        211919 by: John Nichel
        211920 by: Martin.C.Austin.supervalu.com
        211922 by: xfedex
        211931 by: John Nichel

[suspicious - maybe spam] Re: [PHP] Include file
        211917 by: Mattias Thorslund

an app to generate 'yahoo groups' features/functionality..
        211921 by: bruce

Re: Any personal experience with MySQL/Calendar application
        211923 by: Todd Cary

Simple CMS program
        211924 by: Todd Cary
        211930 by: Josip Dzolonga
        211932 by: Andre Dubuc
        211934 by: GamblerZG

session_save_path() issue
        211925 by: Tom Ray [Lists]

Re: URL restriction on XML file
        211926 by: Roger Thomas

strncmp function (Forgot code snippit)
        211927 by: Russ
        211929 by: Chris W. Parker
        211933 by: Russ

strncmp function
        211928 by: Russ

Re: How to insert and select images from postgres db
        211935 by: J.F.Kishor

Re: Parsing... the hell of PHP
        211936 by: Burhan Khalid

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


How about a filename based upon a user id and the time the file was
uploaded. Unless you have multiple instances of the same user then it will
not be possible for the same user to upload a file at exactly the same time
as himself.

Just a thought...

Mikey

> -----Original Message-----
> From: Richard Davey [mailto:richlaunchcode.co.uk]
> Sent: 30 March 2005 19:19
> To: php-generallists.php.net
> Subject: Re[6]: [PHP] asking comment
>
> Hello Jared,
>
> Wednesday, March 30, 2005, 7:02:58 PM, you wrote:
>
> JW> I'll take absolutely bullet-proof and handled/supressed warnings,
> JW> over relatively bullet-proof.
>
> That would be fine if your previous solution was absolutely
> bullet-proof, or for that matter provided a solution for the
> original problem of renaming uploaded files and keeping them
> unique. Appending a datetime to a file, or using a loop that
> hopes you get a unique name within 100 iterations is wildly
> far from "bullet proof" in just about every respect.
>
> Best regards,
>
> Richard Davey
> --
> http://www.launchcode.co.uk - PHP Development Services "I
> do not fear computers. I fear the lack of them." - Isaac Asimov
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I agree with this solution, though it only effects the OP if he is using a
login system of sorts.

Martin Austin

"Mikey" <fraktotalise.co.uk>
03/30/2005 12:39 PM
Please respond to frak
 
        To: <php-generallists.php.net>
        cc:
        Subject: RE: Re[6]: [PHP] asking comment

How about a filename based upon a user id and the time the file was
uploaded. Unless you have multiple instances of the same user then it
will
not be possible for the same user to upload a file at exactly the same
time
as himself.

Just a thought...

Mikey

> -----Original Message-----
> From: Richard Davey [mailto:richlaunchcode.co.uk]
> Sent: 30 March 2005 19:19
> To: php-generallists.php.net
> Subject: Re[6]: [PHP] asking comment
>
> Hello Jared,
>
> Wednesday, March 30, 2005, 7:02:58 PM, you wrote:
>
> JW> I'll take absolutely bullet-proof and handled/supressed warnings,
> JW> over relatively bullet-proof.
>
> That would be fine if your previous solution was absolutely
> bullet-proof, or for that matter provided a solution for the
> original problem of renaming uploaded files and keeping them
> unique. Appending a datetime to a file, or using a loop that
> hopes you get a unique name within 100 iterations is wildly
> far from "bullet proof" in just about every respect.
>
> Best regards,
>
> Richard Davey
> --
> http://www.launchcode.co.uk - PHP Development Services "I
> do not fear computers. I fear the lack of them." - Isaac Asimov
>
> --
> 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

attached mail follows:


>
> JW> I'll take absolutely bullet-proof and handled/supressed warnings,
> JW> over relatively bullet-proof.
>
> That would be fine if your previous solution was absolutely
> bullet-proof, or for that matter provided a solution for the
> original problem of renaming uploaded files and keeping them
> unique. Appending a datetime to a file, or using a loop that
> hopes you get a unique name within 100 iterations is wildly
> far from "bullet proof" in just about every respect.

Oh and generating random filenames from md5(), crossing your fingers and hoping you've got a unique filename is better?
Or assume that files don't already exist in the directory?

You are going against convential wisdom about ensuring unique filenames.

Jared

attached mail follows:


On Mar 30, 2005, at 12:08 PM, Richard Davey wrote:

> Hello Leif,
>
> Wednesday, March 30, 2005, 6:54:15 PM, you wrote:
>
> LG> http://www.devtek.org/tutorials/alternate_row_colors.php
>
> There is no need to involve a math heavy modulus function just to
> alternate row colours! The following single line will do it just as
> well, swap the colours for whatever you need and echo them where
> required:
>
> $bgcolor = ($bgcolor === '#daf2ff' ? '#c9e1ef' : '#daf2ff');
>
> Best regards,
>
> Richard Davey

It does not involve heavy math to color every other line. I use this
line when looping and determining if the background should be colored
or not:

<?php
if (($i % 2) == 0) echo ' style="background: #A8B1E9;"';
?>

Obviously, the first part is the important part. Good luck!

~Philip

attached mail follows:


I've used the mod (%) function to do this, which also gives you the flexibility of defining how many lines to alternate the colors or do whatever you need to do every "X" lines.

Another method (and forgive me if this was mentioned, I didn't see it yet) is to use a bitwise NOT to flip-flop a value. I think I did something like this before:

$bgcolors[0] = "#FFFFFF";
$bgcolors[1] = "#000000";

$a = 0;

echo '<table>\n';
for ($i = 0; $i <= 100; $i++) {
  $a = ~$a
  echo '<tr><td bgcolor=' . $bgcolors[$a] . '>Some text</td></tr>\n';
}
echo '</table>\n';

Maybe it was 0 and -1 instead of 0 and 1.. I forget. But you get the idea. The $a = ~$a flips the value of $a back and forth. You only have two options but that maybe all you need.

And hey.. I've been known to do some goofy things so if there's some major drawback to this in processing time or if I'm just stupid in some way, that's cool.. feel free to speak up. But it does present another way to do what was requested and the theory might help someone at least :)

-TG

= = = Original message = = =

On Mar 30, 2005, at 12:08 PM, Richard Davey wrote:

> Hello Leif,
>
> Wednesday, March 30, 2005, 6:54:15 PM, you wrote:
>
> LG> http://www.devtek.org/tutorials/alternate_row_colors.php
>
> There is no need to involve a math heavy modulus function just to
> alternate row colours! The following single line will do it just as
> well, swap the colours for whatever you need and echo them where
> required:
>
> $bgcolor = ($bgcolor === '#daf2ff' ? '#c9e1ef' : '#daf2ff');
>
> Best regards,
>
> Richard Davey

It does not involve heavy math to color every other line. I use this
line when looping and determining if the background should be colored
or not:

<?php
if (($i % 2) == 0) echo ' style="background: #A8B1E9;"';
?>

Obviously, the first part is the important part. Good luck!

~Philip

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

attached mail follows:


SourceLabs released its AMP Stack and associated test data this morning.
Please forgive the (debatable) spam in advance; this post does contain
pointers to useful test information for capacity planners who are building
out AMP infrastructure for demanding deployments and others who are working
with PHP.

Consisting of pre-configured versions of Apache, MySQL and PHP, the
SourceLabs AMP Stack provides documented test results to give customers a
higher level of confidence in the reliability, scalability and security of
AMP than has been available to date. The stack is available free of charge
from our website at www.sourcelabs.com/AMPstack.htm.

This initial release of the stack has been tested per three of the Seven
CERT7 dependability criteria: unit testing, security hardening and
scalability. CERT7 augments the testing approaches that are typical of open
source projects by adding tests that focus on the performance, stability and
scale characteristics of integrated systems. Not only is this the first time
that an integrated open source stack has been tested this way, this is the
first time the results of the tests and the tests themselves (provided
through GPL) have been made publicly available. While many enterprise
software vendors do this kind of testing, they don't open the process for
customer review. We think that open testing is a big part of the future of
open source, and we're looking forward to the community taking our testing
harness and adapting it to their needs.

Some highlights of our findings from the test process:
. We performed a 72 hour burn-in acceptance test utilizing a subset of
the CERT7 scalability tests, resulting in 70-100% CPU utilization on a 2 CPU
Hyper-threaded machine, confirming the absence of detectable memory leaks
for these scenarios.
. Over 7,000 individual security checks were performed, showing that a
number of potential security vulnerabilities exist in default configurations
of components of the AMP stack. We configured the AMP Stack to protect
against these vulnerabilities.

CERT7 Scalability tests were performed in three areas: Static HTML,
Computational PHP and Database scalability, resulting in scale-out and
configuration recommendations for AMP deployments. Key findings include:
. Apache Web Server scalability was limited by bandwidth in all cases
tested, and not CPU or memory capacity.
. PHP processing scaled linearly with respect to CPU capacity. For
capacity planning purposes, this means that the desired number of servers
running Apache Web Server/PHP for a given application can be calculated
based on the processing speed of an individual user scenario. For this, an
understanding of the processing speed, the number of concurrent users, and
the desired user experience/response time would be used.
. MySQL scalability was limited by memory. For capacity planning
purposes, MySQL implementations should be optimized for the greatest
available memory rather than adding CPU capacity.

Complete Test results are at
http://www.sourcelabs.com/SourceLabsApacheMySQLPHPTestResults.pdf

To promote the new stack we are also announcing a maven contest in our
forums. Users that download our AMP stack and provide feedback, make clever
puns, ask or answer questions in our forum qualify for the grand prize: A
100 Watt Marshall Guitar Amplifier and a Fender Stratocaster Electric
Guitar. Just like the SourceLabs AMP stack, this is the kit that will let
you "go to 11". Each Friday afternoon for eleven weeks we will be giving
away a weekly prize consisting of an Ipod Shuffle and a DVD copy of "This is
Spinal Tap", culminating in the announcement of our grand prize winner on
June 10, 2005. Complete rules will be found at
www.sourcelabs.com/mavencontest.htm

attached mail follows:


[snip]
Please forgive the (debatable) spam in advance;
[/snip]

Not debatable at all. An unrequested solicitation such as this is, on a
list such as this, regarded as spam. I am sure that several would like
to see something like [ANNOUNCEMENT] in the subject line...at least that
way everyone knows that there is no request for help and can choose to
skip over it should they desire.

attached mail follows:


Cornelius Willis wrote:
<snip SPAM>

So, what is the PHP question?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


This way is faster:

include('..includes/' . $include);

Its always better to avoid using doublequotes.

meatbread.

On Tue, 29 Mar 2005 20:55:17 -0500, James Pancoast <jpancoastgmail.com> wrote:
> Try it with double quotes instead:
>
> include( "../includes/$include" );
>
> That way works for me.
>
> And I also hope you're cleansing or filtering $include in some way.
>
> On Tue, 29 Mar 2005 19:41:15 -0600, Marquez Design
> <smarquezmarquez-design.com> wrote:
> > Does anyone know how to include a variable page? The variable is a page
> > name. Such as "inluded_file.html"
> >
> > Include ('../includes/$include');
> >
> > Does not seem to work.
> >
> > Thanks!
> >
> > --
> > Steve
> >
> > --
> > 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
>
>

attached mail follows:


[snip]
This way is faster:

include('..includes/' . $include);

Its always better to avoid using doublequotes.
[/snip]

Why is it faster? And why should you avoid using double quotes?

attached mail follows:


> Why is it faster? And why should you avoid using double quotes?
>

..."Scripts using single quotes run slightly faster because the PHP
parser can include the string directly. Double quoted strings are
slower because they need to be parsed."...

Quoted from:
http://www.zend.com/zend/tut/using-strings.php?article=using-strings&kind=t&id=1399&open=1&anc=0&view=1

attached mail follows:


[snip]
Personally, I go almost exclusively with double quotes, so I'm
interested to see how your include is faster.

>>>
include('..includes/' . $include);
<<<

"Jay Blanchard" <jay.blanchardniicommunications.com>
03/30/2005 02:58 PM
        To: "xfedex" <xfedexgmail.com>,
<php-generallists.php.net>
        cc:
        Subject: RE: [PHP] Include file

[snip]
This way is faster:

include('..includes/' . $include);

Its always better to avoid using doublequotes.
[/snip]

Why is it faster? And why should you avoid using double quotes?
[/snip]

1. Always reply to the list ('reply-all')
B. It's hard to read in context.
   Why?
   Top-posting is bad.

attached mail follows:


[snip]
> Why is it faster? And why should you avoid using double quotes?
>

..."Scripts using single quotes run slightly faster because the PHP
parser can include the string directly. Double quoted strings are
slower because they need to be parsed."...

Quoted from:
http://www.zend.com/zend/tut/using-strings.php?article=using-strings&kin
d=t&id=1399&open=1&anc=0&view=1
[/snip]

I try to use both types of quotes in the proper circumstance. Having
said that, I came to computing in the age where we worried over CPU
cycles, but I don't see how in this day and age the difference between
the two would even matter. Even on a high load site the difference
between the two would be negligible.

attached mail follows:


Jay Blanchard wrote:
<snip>
> I try to use both types of quotes in the proper circumstance. Having
> said that, I came to computing in the age where we worried over CPU
> cycles, but I don't see how in this day and age the difference between
> the two would even matter. Even on a high load site the difference
> between the two would be negligible.
>

Let's see if you still say that after you run your php scripts on my
Atari 800XL. ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


On Wed, 30 Mar 2005 15:14:27 -0600, Jay Blanchard
<jay.blanchardniicommunications.com> wrote:
> [snip]
> > Why is it faster? And why should you avoid using double quotes?
> >
>
> ..."Scripts using single quotes run slightly faster because the PHP
> parser can include the string directly. Double quoted strings are
> slower because they need to be parsed."...
>
> Quoted from:
> http://www.zend.com/zend/tut/using-strings.php?article=using-strings&kin
> d=t&id=1399&open=1&anc=0&view=1
> [/snip]
>
> I try to use both types of quotes in the proper circumstance. Having
> said that, I came to computing in the age where we worried over CPU
> cycles, but I don't see how in this day and age the difference between
> the two would even matter. Even on a high load site the difference
> between the two would be negligible.
>

Well....i have a 30k script, with double i get 8 or 9 seconds, with
sigle i get 0.05 or 0.08 seconds. The script basically made a lot of
querys, its part of a user manager module of a system im writing.

Remember, the hole world is not US or EU....i live in argentina and my
web server is a PIII 550Mhz 128mb and if you count that almost the
half of the people got a 56k dialup connection....I think that in some
cases it does make difference.

sorry my english....too taired to worry
meatbread.

attached mail follows:


Hello Jay,

Wednesday, March 30, 2005, 10:14:27 PM, you wrote:

JB> I try to use both types of quotes in the proper circumstance.
JB> Having said that, I came to computing in the age where we worried
JB> over CPU cycles, but I don't see how in this day and age the
JB> difference between the two would even matter. Even on a high load
JB> site the difference between the two would be negligible.

I agree it's going to be negligible, but even so the difference does
exist. The real question is which is faster between:

include "path/$file"

and

include 'path/' . $file

Can the compiler handle the in-line variables quicker than string
concatenation? It'll take a C guru who knows the PHP code well to
answer this fully.

Best regards,

Richard Davey
--
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

attached mail follows:


Because I'm bored, I decided to test the theory.

AMD 3200xp
1.5gb Memory
RHEL AS 3

I ran the test 20 times, and 18 of those times, double quotes were
faster than single quotes. Don't always trust what you read. Not to
mention the fact that the 'faster' of the two was 'faster' by an average
of less than .003 seconds to include 1000 files.

<?php

function microtime_float() {
        list ( $usec, $sec ) = explode ( " ", microtime() );
        return ( ( float ) $usec + ( float ) $sec );
}

for ( $i = 0; $i < 1000; $i++ ) {
        $fp = fopen ( "file_" . $i . ".php", "w" );
        fwrite ( $fp, "<?php\n\n\n?>" );
        fclose ( $fp );
}

$single_start = microtime_float();
for ( $i = 0; $i < 1000; $i++ ) {
        include ( 'file_' . $i . '.php' );
}
$single_end = microtime_float();

$double_start = microtime_float();
for ( $i = 0; $i < 1000; $i++ ) {
        include ( "file_" . $i . ".php" );
}
$double_end = microtime_float();

$single = $single_end - $single_start;
$double = $double_end - $double_start;

echo ( "Single Quotes : " . $single . " seconds.<br />\n" );
echo ( "Double Quotes : " . $double . " seconds.<br /><br />\n" );

if ( $double > $single ) {
        $time = $double - $single;
        echo ( "Single Quotes are " . $time . " seconds faster than double
quotes." );
} else {
        $time = $single - $double;
        echo ( "Double Quotes are " . $time . " seconds faster than single
quotes." );
}

?>

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


>>> xfedex wrote:
Well....i have a 30k script, with double i get 8 or 9 seconds, with
sigle i get 0.05 or 0.08 seconds. The script basically made a lot of
querys, its part of a user manager module of a system im writing.
<<<

Could the speed have more to do with whatever database server you are
using, than with PHP? I assume database since you are querying something.
 Just curious.

And Jay: I'm using Lotus Notes R6, not much I can do about top quoting.

Martin Austin

xfedex <xfedexgmail.com>
03/30/2005 06:27 PM
Please respond to xfedex
 
        To: php-generallists.php.net
        cc:
        Subject: Re: [PHP] Include file

On Wed, 30 Mar 2005 15:14:27 -0600, Jay Blanchard
<jay.blanchardniicommunications.com> wrote:
> [snip]
> > Why is it faster? And why should you avoid using double quotes?
> >
>
> ..."Scripts using single quotes run slightly faster because the PHP
> parser can include the string directly. Double quoted strings are
> slower because they need to be parsed."...
>
> Quoted from:
> http://www.zend.com/zend/tut/using-strings.php?article=using-strings&kin
> d=t&id=1399&open=1&anc=0&view=1
> [/snip]
>
> I try to use both types of quotes in the proper circumstance. Having
> said that, I came to computing in the age where we worried over CPU
> cycles, but I don't see how in this day and age the difference between
> the two would even matter. Even on a high load site the difference
> between the two would be negligible.
>

Well....i have a 30k script, with double i get 8 or 9 seconds, with
sigle i get 0.05 or 0.08 seconds. The script basically made a lot of
querys, its part of a user manager module of a system im writing.

Remember, the hole world is not US or EU....i live in argentina and my
web server is a PIII 550Mhz 128mb and if you count that almost the
half of the people got a 56k dialup connection....I think that in some
cases it does make difference.

sorry my english....too taired to worry
meatbread.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


On Wed, 30 Mar 2005 16:45:32 -0500, John Nichel <johnkegworks.com> wrote:
> Because I'm bored, I decided to test the theory.
>
> AMD 3200xp
> 1.5gb Memory
> RHEL AS 3
>
> I ran the test 20 times, and 18 of those times, double quotes were
> faster than single quotes. Don't always trust what you read. Not to
> mention the fact that the 'faster' of the two was 'faster' by an average
> of less than .003 seconds to include 1000 files.
>
> <?php
>
> function microtime_float() {
> list ( $usec, $sec ) = explode ( " ", microtime() );
> return ( ( float ) $usec + ( float ) $sec );
> }
>
> for ( $i = 0; $i < 1000; $i++ ) {
> $fp = fopen ( "file_" . $i . ".php", "w" );
> fwrite ( $fp, "<?php\n\n\n?>" );
> fclose ( $fp );
> }
>
> $single_start = microtime_float();
> for ( $i = 0; $i < 1000; $i++ ) {
> include ( 'file_' . $i . '.php' );
> }
> $single_end = microtime_float();
>
> $double_start = microtime_float();
> for ( $i = 0; $i < 1000; $i++ ) {
> include ( "file_" . $i . ".php" );
> }
> $double_end = microtime_float();
>
> $single = $single_end - $single_start;
> $double = $double_end - $double_start;
>
> echo ( "Single Quotes : " . $single . " seconds.<br />\n" );
> echo ( "Double Quotes : " . $double . " seconds.<br /><br />\n" );
>
> if ( $double > $single ) {
> $time = $double - $single;
> echo ( "Single Quotes are " . $time . " seconds faster than double
> quotes." );
> } else {
> $time = $single - $double;
> echo ( "Double Quotes are " . $time . " seconds faster than single
> quotes." );
> }
>
> ?>
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> johnkegworks.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Here is my test in a PIII 550Mhz 128mb with gentoo:

for ($i = 0; $i <= 9999; $i++) {
      $include = 'db_connect.php';
      include('include/'.$include);
}

3.623316 seconds
--------------------------------------

for ($i = 0; $i <= 9999; $i++) {
    $include = "db_connect.php";
    include("include/$include");
}

3.696468 seconds

meatbread.

attached mail follows:


xfedex wrote:
<snip all my stuff>
> Here is my test in a PIII 550Mhz 128mb with gentoo:
>
> for ($i = 0; $i <= 9999; $i++) {
> $include = 'db_connect.php';
> include('include/'.$include);
> }
>
> 3.623316 seconds
> --------------------------------------
>
> for ($i = 0; $i <= 9999; $i++) {
> $include = "db_connect.php";
> include("include/$include");
> }
>
> 3.696468 seconds
>
> meatbread.
>

So basically, I run the test 20 times, include 1000 _different_ files
for both single and double quotes in each test, and come up with a mean
of about 3 one-thousands of a second in favor of double quotes. Not
totally scientific but produces a fairly accurate result.

You on the other hand, run a test including the _same_ file 10,000 times
(which brings into play error handling if you define a function in that
include file) and produce a result with a difference of about 7
one-hundredth of a second. A bit less scientific, but still produces a
fairly accurate result.

With all that said...

1) The time difference in either test if way too small to make a
difference.

2) It's a far cry from one of your earlier posts which read, "Well....i
have a 30k script, with double i get 8 or 9 seconds, with
sigle i get 0.05 or 0.08 seconds. The script basically made a lot of
querys, its part of a user manager module of a system im writing."

3) Meatbread indeed.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

attached mail follows:


Jay Blanchard wrote:

>I try to use both types of quotes in the proper circumstance. Having
>said that, I came to computing in the age where we worried over CPU
>cycles, but I don't see how in this day and age the difference between
>the two would even matter. Even on a high load site the difference
>between the two would be negligible.
>
>

This has been talked about on this list so many times.

Another way to put it would be:

...because in most real-world scripts, the execution time for this kind
of operation (the string parsing) is negligible compared to the script's
total execution time. So even if you could reduce the time it took to
parse strings to nothing, you wouldn't speed up the total execution time
very much.

If you want to optimize the performance of your scripts, there are
probably a lot of other things that should be much higher on your
priority list than substituting double quotes with single quotes.

/Mattias Thorslund

--
More views at http://www.thorslund.us

attached mail follows:


hi..

after a lot of fruitless searching via google, i've decided to ask here...

does anyone know of an app that will allow a site to provide functionality
similar to 'yahoo groups' to the users. i want to be able to allow users to
be able to create their own 'groups' and to be able to have the user allow
other users/members to join the group. i also want to be able to have the
user be able to admin the group, with the ability to manage members/handle
message posting/(up/download) pics/etc...

i asumed that there would be a number of these kinds of apps, i haven't
found any yet.

i have found plenty of bbs/forum types of apps that try to pass themselves
off as being in the 'yahoo group' area.

i've also seen the drupal based civic app...

thanks for any help/pointers/etc,....

bruce
bedouglasearthlink.net

attached mail follows:


Joe -

Can you send me the name?
toddaristesoftware.com

Todd

Joe Harman wrote:
> Hey Todd... I have one that I created and posted at Zend.com ... it
> can be easily adapted to store data n MySQL...
>
> Joe
>
>
> On Tue, 29 Mar 2005 12:33:12 -0500, Peter G. Brown
> <pbrownbeasleyfoodservice.com> wrote:
>
>>I have used egroupware in a company setting and found it to be largely
>>satisfactory. It might be overkill in your case but you can restrict
>>module access.
>>
>>www.egroupware.org
>>
>>HTH
>>Peter Brown
>>
>>Todd Cary wrote:
>>
>>>I am looking for an open source calendar program that uses MySQL to
>>>store the data and has an online Admin feature. Rather than trying the
>>>many that are listed, I am hoping that someone may have some personal
>>>experience with a application of this type and make a recommendation.
>>>
>>>Todd
>>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>

attached mail follows:


When I went to a site that lists and compares CMS programs, I was
overwhelmed by at least 100 listings. Again, I would like to rely on
personal experience. What I am seeking is a CMS that will provide users
at my client (a Yacht Club) to update news items, and if possible,
update a calendar using a Web based editor. Not a full fledged portal CMS.

Also, it would be nice if it was written in PHP and use MySQL for the
server DB. Has anyone had experience with such a CMS?

Todd

attached mail follows:


Todd Cary wrote:

> When I went to a site that lists and compares CMS programs, I was
> overwhelmed by at least 100 listings. Again, I would like to rely on
> personal experience. What I am seeking is a CMS that will provide
> users at my client (a Yacht Club) to update news items, and if
> possible, update a calendar using a Web based editor. Not a full
> fledged portal CMS.
>
> Also, it would be nice if it was written in PHP and use MySQL for the
> server DB. Has anyone had experience with such a CMS?
>
> Todd
>
http://www.cmsmatrix.org/

--
Josip Dzolonga
http://josip.dotgeek.org

jdzolonga[at]gmail.com

attached mail follows:


On Wednesday 30 March 2005 08:19 pm, Josip Dzolonga wrote:
> Todd Cary wrote:
> > When I went to a site that lists and compares CMS programs, I was
> > overwhelmed by at least 100 listings. Again, I would like to rely on
> > personal experience. What I am seeking is a CMS that will provide
> > users at my client (a Yacht Club) to update news items, and if
> > possible, update a calendar using a Web based editor. Not a full
> > fledged portal CMS.
> >
> > Also, it would be nice if it was written in PHP and use MySQL for the
> > server DB. Has anyone had experience with such a CMS?
> >
> > Todd

Try:

http://www.mamboserver.com

easy to install, update, etc.

Hth,
Andre

attached mail follows:


> When I went to a site that lists and compares CMS programs, I was
> overwhelmed by at least 100 listings. Again, I would like to rely on
> personal experience. What I am seeking is a CMS that will provide users
> at my client (a Yacht Club) to update news items, and if possible,
> update a calendar using a Web based editor. Not a full fledged portal CMS.

Whatever you do, do not use PHP-Nuke or PostNuke. They are popular and
they seem good at the beginning, but you will regret using them after a
while. (Their internal design is not thought-through.)

attached mail follows:


Hey there-

I went to install phpopenchat today and when I run the test.php script
that comes with, I get this error:

*Fatal error*: Call to undefined function: session_save_path() in
*/path/to/website/htdocs/phpopenchat/config.inc.php* on line *98

*I'm not sure why this is coming up since the session support is
installed by default.. Can anyone enlighten me? I did an out of the box
install of SuSE 9.1 with apache2.0 and php4.3, is there something I
might have missed in the php.ini file I need to adjust?

TIA

attached mail follows:


Hi Marek,
Thank you for the solution.

--
Roger

Quoting Marek Kilimajer <listskilimajer.net>:

> That's because the character data is split on the borders of the
> entities, so for
>
> http://feeds.example.com/?rid=318045f7e13e0b66&amp;cat=48cba686fe041718&amp;f=1
>
> characterData() will be called 5 times:
>
> http://feeds.example.com/?rid=318045f7e13e0b66
> &
> cat=48cba686fe041718
> &
> f=1
>
> Solution is inlined below
>
> Roger Thomas wrote:
> > I have a short script to parse my XML file. The parsing produces no error
> and all output looks good EXCEPT url-links were truncated IF it contain the
> '&amp;' characters.
> >
> > My XML file looks like this:
> > --- start of XML ---
> > <?xml version="1.0" encoding="iso-8859-1"?>
> > <rss version="2.0">
> > <channel>
> > <title>Test News .Net - Newspapers on the Net</title>
> > <copyright>Small News Network.com</copyright>
> > <link>http://www.example.com/</link>
> > <description>Continuously updating Example News.</description>
> > <language>en-us</language>
> > <pubDate>Tue, 29 Mar 2005 18:01:01 -0600</pubDate>
> > <lastBuildDate>Tue, 29 Mar 2005 18:01:01 -0600</lastBuildDate>
> > <ttl>30</ttl>
> > <item>
> > <title>Group buys SunGard for US$10.4bil</title>
> >
> <link>http://feeds.example.com/?rid=318045f7e13e0b66&amp;cat=48cba686fe041718&amp;f=1</link>
> > <description>NEW YORK: A group of seven private equity investment firms
> agreed yesterday to buy financial technology company SunGard Data Systems Inc
> in a deal worth US$10.4bil plus debt, making it the biggest
> lev...</description>
> > <source url="http://biz.theexample.com/">The Paper</source>
> > </item>
> > <item>
> > <title>Strong quake hits Indonesia coast</title>
> > <link>http://feeds.example.com/news/world/quake.html</link>
> > <description>a &quot;widely destructive tsunami&quot; and the quake was
> felt as far away as Malaysia.</description>
> > <source url="http://biz.theexample.com.net/">The Paper</source>
> > </item>
> > <item>
> > <title>Final News</title>
> > <link>http://feeds.example.com/?id=abcdef&amp;cat=somecat</link>
> > <description>We are going to expect something new this weekend
> ...</description>
> > <source url="http://biz.theexample.com/">The Paper</source>
> > </item>
> > </channel>
> > </rss>
> > --- end of XML ---
> >
> > For the sake of testing, my script only print out the url-link to those
> news above. I got these:
> > f=1
> > http://feeds.example.com/news/world/quake.html
> > cat=somecat
> >
> > The output for line 1 is truncated to 'f=1' and the output of line 3 is
> truncated to 'cat=somecat'. ie, the script only took the last parameter of
> the url-link. The output for line 2 is correct since it has NO parameters.
> >
> > I am not sure what I have done wrong in my script. Is it bcos the RSS spec
> says that you cannot have parameters in URL ? Please advise.
> >
> > -- start of script --
> > <?
> > $file = "test.xml";
> > $currentTag = "";
> >
> > function startElement($parser, $name, $attrs) {
> > global $currentTag;
> > $currentTag = $name;
> > }
> >
> > function endElement($parser, $name) {
> > global $currentTag, $TITLE, $URL, $start;
> >
> > switch ($currentTag) {
> > case "ITEM":
> > $start = 0;
> > case "LINK":
> > if ($start == 1)
> > #print "<A HREF = \"".$URL."\">$TITLE</A><BR>";
> > print "$URL"."<BR>";
> > break;
> > }
> > $currentTag = "";
>
> // Reset also other variables:
> $URL = '';
> $TITLE = '';
>
> > }
> >
> > function characterData($parser, $data) {
> > global $currentTag, $TITLE, $URL, $start;
> >
> > switch ($currentTag) {
> > case "ITEM":
> > $start = 1;
> > case "TITLE":
> > $TITLE = $data;
>
> // append instead:
> $TITLE .= $data;
>
> > break;
> > case "LINK":
> > $URL = $data;
>
> // append instead:
> $URL .= $data;
>
> // Warning: entities are decoded at this point, you will receive &, not
> &amp;
>
> > break;
> > }
> > }
> >
> > $xml_parser = xml_parser_create();
> > xml_set_element_handler($xml_parser, "startElement", "endElement");
> > xml_set_character_data_handler($xml_parser, "characterData");
> >
> > if (!($fp = fopen($file, "r"))) {
> > die("Cannot locate XML data file: $file");
> > }
> >
> > while ($data = fread($fp, 4096)) {
> > if (!xml_parse($xml_parser, $data, feof($fp))) {
> > die(sprintf("XML error: %s at line %d",
> > xml_error_string(xml_get_error_code($xml_parser)),
> > xml_get_current_line_number($xml_parser)));
> > }
> > }
> >
> > xml_parser_free($xml_parser);
> >
> > ?>
> > -- end of script --
> >
> > TIA.
> > Roger
> >
> >
> > ---------------------------------------------------
> > Sign Up for free Email at http://ureg.home.net.my/
> > ---------------------------------------------------
> >
>
>

---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------

attached mail follows:


Subject: strncmp function
Date: Wednesday 30 March 2005 01:14 pm
From: Russ <russbucketcenturytel.net>
To: PHP General <php-generallists.php.net>

I'm new to php and linux. I am trying to replace a password program I used
under windows with a mysql based login. I want to compare the first character
of the first and last name of the user for a capital letter. My login program
passes a user name and password. Below is a start to the program but I'm
alittle confused on how to set str1 to check all letters of the alphabet. Can
anyone point me to a document or give me an idea on how to do this? I can not
use .htaccess do to ISP (host) rules. Access is to a members only sectionof
the webpages for my Lions club.

<?php
$fname=John;
$lname=Smith;
if(strncmp(S,${lname},1) ===0) {
?>
<h1>strncmp() must have returned returned non-false</h1>
<?php
} else {
?>
<h3>Strncmp() must have returned false</h3>
<?php
}
?>
--
Russ

attached mail follows:


Russ <mailto:russbucketcenturytel.net>
    on Wednesday, March 30, 2005 1:18 PM said:

> I'm new to php and linux. I am trying to replace a password program I
> used under windows with a mysql based login. I want to compare the
> first character of the first and last name of the user for a capital
> letter.

Why? What does that accomplish?

> <?php
> $fname=John;
> $lname=Smith;

Where's the quotes?

> if(strncmp(S,${lname},1) ===0) {
> ?>
> <h1>strncmp() must have returned returned non-false</h1>

non-false = true

> <?php
> } else {
>>
> <h3>Strncmp() must have returned false</h3>
> <?php
> }
> ?>

Rewrite:

<?php

$fname = "John";
$lname = "Smith";

if(preg_match("/[A-Z]/", substr($fname ,0 ,1)))
{
  echo "first letter is uppercase.";
}
else
{
  echo "first letter is not uppercase";
}

?>

There might be a better way than a regex but that's the first thing that
came to my mind.

HTH,
Chris.

attached mail follows:


Chris W. Parker wrote:

> Russ <mailto:russbucketcenturytel.net>
> on Wednesday, March 30, 2005 1:18 PM said:
>
>> I'm new to php and linux. I am trying to replace a password program I
>> used under windows with a mysql based login. I want to compare the
>> first character of the first and last name of the user for a capital
>> letter.
>
> Why? What does that accomplish?
>
>> <?php
>> $fname=John;
>> $lname=Smith;
>
> Where's the quotes?
>
>> if(strncmp(S,${lname},1) ===0) {
>> ?>
>> <h1>strncmp() must have returned returned non-false</h1>
>
> non-false = true
>
>> <?php
>> } else {
>>>
>> <h3>Strncmp() must have returned false</h3>
>> <?php
>> }
>> ?>
>
> Rewrite:
>
> <?php
>
> $fname = "John";
> $lname = "Smith";
>
> if(preg_match("/[A-Z]/", substr($fname ,0 ,1)))
> {
> echo "first letter is uppercase.";
> }
> else
> {
> echo "first letter is not uppercase";
> }
>
> ?>
>
> There might be a better way than a regex but that's the first thing that
> came to my mind.
>
>
> HTH,
> Chris.
Thanks Chris, I'll try that. I'm not really a programmer, done a little and
trying to learn as I go. I had quotes at one point but took them out tring
to get it to work.
--
Russ

attached mail follows:


I'm new to php and linux. I am trying to replace a password program I used
under windows with a mysql based login. I want to compare the first character
of the first and last name of the user for a capital letter. My login program
passes a user name and password. Below is a start to the program but I'm
alittle confused on how to set str1 to check all letters of the alphabet. Can
anyone point me to a document or give me an idea on how to do this? I can not
use .htaccess do to ISP (host) rules. Access is to a members only sectionof
the webpages for my Lions club.
--
Russ

attached mail follows:


Hi Kim,

       Thanks for your reply, I have'nt recived any other other help
       or suggestion from anyone other then you.

       Any how I have made it work it is working fine. Thanks again
       for your acknowledgement.

       Have a great day.............!

Regards,
                                                        - JFK
kishor
Nilgiri Networks

   

> Hi,
>
> I´ve never worked with postgres, but 2 things I can tell You.
>
> 1. look at php.net, search for postgres
> 2. If You expect quick help, You better copy some of the code into Your mails, otherwise You will receive no or poor help since the question is HUGE
>
> Sincerely
> Kim Madsen
> Systemdeveloper
>
> > -----Original Message-----
> > From: J.F.Kishor [mailto:kishorooty.tenet.res.in]
> > Sent: Wednesday, March 30, 2005 1:41 PM
> > To: php-generallists.php.net
> > Subject: [PHP] How to insert and select images from postgres db
> >
> > Hi,
> >
> > I am having a problem in storing and selecting images in and
> > from postgres.
> >
> > My requirement is I have to select the image from the database
> > and display it in User Interface.
> >
> > Can anyone help me through this problem, I'am in need of this
> > solution by today.
> >
> >
> >
> > Regards,
> >
> > - JFK
> > kishor
> > Nilgiri Networks
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--

attached mail follows:


Martin.C.Austinsupervalu.com wrote:
> $url = "<a href =\".$url."\">.HtmlEntities($url)."\">".</a>";
>
> It appears the parse error is at the end of your opening link tag, so PHP
> doesn't know what >.HtmlEntities($url) means. I'm at work so I can't test
> it, but that appears the culprit to me.
>
> $url = "<a href=\"$url\">" . HtmlEntities($url) . "</a>"; should suffice.

Please don't make a habit of changing the case of built-in PHP functions.