|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help
lists.php.net
Date: Tue Mar 11 2008 - 02:21:07 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 11 Mar 2008 07:21:07 -0000 Issue 5341
Topics (messages 271220 through 271256):
Re: Question about user management...
271220 by: Daniel Brown
271222 by: TG
271226 by: Jason Pruim
271227 by: Jason Pruim
271228 by: tedd
271230 by: Jason Pruim
271231 by: Daniel Brown
271233 by: tedd
271250 by: Eric Butera
271251 by: Eric Butera
271253 by: Mike
271256 by: Per Jessen
Re: Links hierarchy maintenance
271221 by: tedd
Re: cart in a session
271223 by: Bill
Re: SMTP
271224 by: Alain Roger
Session still open
271225 by: Bill
271229 by: Daniel Brown
271232 by: Bill
271234 by: Daniel Brown
271238 by: Bill
271239 by: Daniel Brown
/?feed=rss2
271235 by: John Taylor-Johnston
271236 by: John Taylor-Johnston
271254 by: John Taylor-Johnston
271255 by: John Taylor-Johnston
difference in time
271237 by: Lamp Lists
Re: Transferring files between computers using php
271240 by: bruce
CSV speed
271241 by: Danny Brow
271242 by: TG
271244 by: Wolf
271245 by: Danny Brow
271246 by: Larry Garfield
271247 by: Greg Donald
271248 by: Wolf
271249 by: Wolf
strtotime( 'last Sunday' ) and republicans
271243 by: Greg Donald
271252 by: Wolf
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com> wrote:
> Hi Everyone, Happy Monday to all of you!
>
> I am trying to think through a user management issue for a application
> I am working on. What I want to do, is be able to provide a multi user
> environment (All accessing the same page, but depending on company
> name they get different data) and be able to give certain people the
> ability to add/remove users.
>
> What I was thinking about doing was a combination of the company name
> (Which I set right now) and then a access level such as "50" for the
> "Owner" of the program, "40" for the "Managers" and "30" for the
> "user" of the program. also leaving me room to add other levels if
> required..
I generally do the same basic thing for permission levels, but a
reverse of what you're attempting to do.
The superuser (AKA root, administrator, God, whatever) has GID 0,
just like on a *NIX system. This is because it's the highest level
you can reach, and 0 is the lowest real number you can use. Thus, you
can add a virtually-infinite number of lesser users, as opposed to
being limited to 50, as in your case.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Sounds like a pretty typical setup.
Depending on your layout, you may be able to use a templating type system for
the pages as well. It's hard to tell if that's useful without more
information.
/tmpl/<companyid>/index.php
Not sure if that's what you meant by using the company name or if you were
going to do something like "company30" "company50" and such.
Lots of different ways to do what you're talking about, but sounds like
you're in the right path.
-TG
----- Original Message -----
From: "Daniel Brown" <parasane
gmail.com>
To: "Jason Pruim" <japruim
raoset.com>
Cc: "[php] PHP General List" <php-general
lists.php.net>
Date: Mon, 10 Mar 2008 15:14:05 -0400
Subject: Re: [PHP] Question about user management...
> On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com> wrote:
> > Hi Everyone, Happy Monday to all of you!
> >
> > I am trying to think through a user management issue for a application
> > I am working on. What I want to do, is be able to provide a multi user
> > environment (All accessing the same page, but depending on company
> > name they get different data) and be able to give certain people the
> > ability to add/remove users.
> >
> > What I was thinking about doing was a combination of the company name
> > (Which I set right now) and then a access level such as "50" for the
> > "Owner" of the program, "40" for the "Managers" and "30" for the
> > "user" of the program. also leaving me room to add other levels if
> > required..
>
> I generally do the same basic thing for permission levels, but a
> reverse of what you're attempting to do.
>
> The superuser (AKA root, administrator, God, whatever) has GID 0,
> just like on a *NIX system. This is because it's the highest level
> you can reach, and 0 is the lowest real number you can use. Thus, you
> can add a virtually-infinite number of lesser users, as opposed to
> being limited to 50, as in your case.
>
> --
> </Dan>
>
> Daniel P. Brown
> Senior Unix Geek
> <? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Hey TG,
I was thinking about doing it as "CompanyA" "CompanyB" etc... etc...
All stored in a database. And they can all go to the same main website
and be able to get at everything they need.
Thanks for looking! :)
On Mar 10, 2008, at 3:48 PM, TG wrote:
>
> Sounds like a pretty typical setup.
>
> Depending on your layout, you may be able to use a templating type
> system for
> the pages as well. It's hard to tell if that's useful without more
> information.
>
> /tmpl/<companyid>/index.php
>
> Not sure if that's what you meant by using the company name or if
> you were
> going to do something like "company30" "company50" and such.
>
> Lots of different ways to do what you're talking about, but sounds
> like
> you're in the right path.
>
> -TG
>
> ----- Original Message -----
> From: "Daniel Brown" <parasane
gmail.com>
> To: "Jason Pruim" <japruim
raoset.com>
> Cc: "[php] PHP General List" <php-general
lists.php.net>
> Date: Mon, 10 Mar 2008 15:14:05 -0400
> Subject: Re: [PHP] Question about user management...
>
>> On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com>
>> wrote:
>>> Hi Everyone, Happy Monday to all of you!
>>>
>>> I am trying to think through a user management issue for a
>>> application
>>> I am working on. What I want to do, is be able to provide a multi
>>> user
>>> environment (All accessing the same page, but depending on company
>>> name they get different data) and be able to give certain people the
>>> ability to add/remove users.
>>>
>>> What I was thinking about doing was a combination of the company
>>> name
>>> (Which I set right now) and then a access level such as "50" for the
>>> "Owner" of the program, "40" for the "Managers" and "30" for the
>>> "user" of the program. also leaving me room to add other levels if
>>> required..
>>
>> I generally do the same basic thing for permission levels, but a
>> reverse of what you're attempting to do.
>>
>> The superuser (AKA root, administrator, God, whatever) has GID 0,
>> just like on a *NIX system. This is because it's the highest level
>> you can reach, and 0 is the lowest real number you can use. Thus,
>> you
>> can add a virtually-infinite number of lesser users, as opposed to
>> being limited to 50, as in your case.
>>
>> --
>> </Dan>
>>
>> Daniel P. Brown
>> Senior Unix Geek
>> <? while(1) { $me = $mind--; sleep(86400); } ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
japruim
raoset.com
attached mail follows:
On Mar 10, 2008, at 3:14 PM, Daniel Brown wrote:
> On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com>
> wrote:
>> Hi Everyone, Happy Monday to all of you!
>>
>> I am trying to think through a user management issue for a
>> application
>> I am working on. What I want to do, is be able to provide a multi
>> user
>> environment (All accessing the same page, but depending on company
>> name they get different data) and be able to give certain people the
>> ability to add/remove users.
>>
>> What I was thinking about doing was a combination of the company name
>> (Which I set right now) and then a access level such as "50" for the
>> "Owner" of the program, "40" for the "Managers" and "30" for the
>> "user" of the program. also leaving me room to add other levels if
>> required..
>
> I generally do the same basic thing for permission levels, but a
> reverse of what you're attempting to do.
>
> The superuser (AKA root, administrator, God, whatever) has GID 0,
> just like on a *NIX system. This is because it's the highest level
> you can reach, and 0 is the lowest real number you can use. Thus, you
> can add a virtually-infinite number of lesser users, as opposed to
> being limited to 50, as in your case.
Which makes sense for when my KeWl ApP goes public and gets l33t
status! :)
That's what we all hope for though right? :)
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
japruim
raoset.com
attached mail follows:
At 3:14 PM -0400 3/10/08, Daniel Brown wrote:
>On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com> wrote:
>
>> What I was thinking about doing was a combination of the company name
>> (Which I set right now) and then a access level such as "50" for the
>> "Owner" of the program, "40" for the "Managers" and "30" for the
>> "user" of the program. also leaving me room to add other levels if
>> required..
>
> I generally do the same basic thing for permission levels, but a
>reverse of what you're attempting to do.
>
> The superuser (AKA root, administrator, God, whatever) has GID 0,
>just like on a *NIX system. This is because it's the highest level
>you can reach, and 0 is the lowest real number you can use. Thus, you
>can add a virtually-infinite number of lesser users, as opposed to
>being limited to 50, as in your case.
Yeah, but then if you try to add a super-superuser you have to go negative. :-)
Why not just define the users with define CONSTANT statement and use
that? Then the different types of users can be anything you want and
you can change the value easily if there's a problem.
Really, all the value really has to be is unique -- you could use
unique() for that, such as:
define("ADMIN", md5(uniqid(rand(), true)););
define("GENERAL_USER", md5(uniqid(rand(), true)););
define("LEVEL_ONE__USER", md5(uniqid(rand(), true)););
define("LEVEL_TWO__USER", md5(uniqid(rand(), true)););
define("WHATEVER__USER", md5(uniqid(rand(), true)););
and so on. That would work and you'll never have to be concerned
about it nor worry about someone guessing it, if that becomes a
problem.
Am I right?
Cheers,
tedd
PS: Oh, I just received the following email and thought I would pass it on:
HELLO,
MY NAME IS AGNES IN SEARCH OF A MAN WHO UNDERSTANDS THE MEANING OF
LOVE AS TRUST AND FAITH IN EACH OTHER RATHER THAN ONE WHO SEES LOVE
AS THE ONLY WAY OF FUN BUT A MATURED MAN WITH NICE VISION OF WHAT
THE WORLD IS ALL ABOUT SO PLEASE REPLY ME WITH THIS BOX IF YOU ARE
INTERESTED IN ME.
Anyone want a woman who yells all the time?
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
On Mar 10, 2008, at 4:07 PM, tedd wrote:
> At 3:14 PM -0400 3/10/08, Daniel Brown wrote:
>> On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com>
>> wrote:
>>
>>> What I was thinking about doing was a combination of the company
>>> name
>>> (Which I set right now) and then a access level such as "50" for
>>> the
>>> "Owner" of the program, "40" for the "Managers" and "30" for the
>>> "user" of the program. also leaving me room to add other levels if
>>> required..
>>
>> I generally do the same basic thing for permission levels, but a
>> reverse of what you're attempting to do.
>>
>> The superuser (AKA root, administrator, God, whatever) has GID 0,
>> just like on a *NIX system. This is because it's the highest level
>> you can reach, and 0 is the lowest real number you can use. Thus,
>> you
>> can add a virtually-infinite number of lesser users, as opposed to
>> being limited to 50, as in your case.
>
> Yeah, but then if you try to add a super-superuser you have to go
> negative. :-)
>
> Why not just define the users with define CONSTANT statement and use
> that? Then the different types of users can be anything you want and
> you can change the value easily if there's a problem.
>
> Really, all the value really has to be is unique -- you could use
> unique() for that, such as:
>
> define("ADMIN", md5(uniqid(rand(), true)););
> define("GENERAL_USER", md5(uniqid(rand(), true)););
> define("LEVEL_ONE__USER", md5(uniqid(rand(), true)););
> define("LEVEL_TWO__USER", md5(uniqid(rand(), true)););
> define("WHATEVER__USER", md5(uniqid(rand(), true)););
with the chance to bring up an old thread about the universe not being
random and everything being relational and all that... Any idea what
the chances are that this would ever reproduce the same number? Or
with the uniqid() portion will that check the other values?
>
>
> and so on. That would work and you'll never have to be concerned
> about it nor worry about someone guessing it, if that becomes a
> problem.
>
> Am I right?
>
> Cheers,
>
> tedd
>
> PS: Oh, I just received the following email and thought I would pass
> it on:
>
> HELLO,
> MY NAME IS AGNES IN SEARCH OF A MAN WHO UNDERSTANDS THE MEANING OF
> LOVE AS TRUST AND FAITH IN EACH OTHER RATHER THAN ONE WHO SEES LOVE
> AS THE ONLY WAY OF FUN BUT A MATURED MAN WITH NICE VISION OF WHAT
> THE WORLD IS ALL ABOUT SO PLEASE REPLY ME WITH THIS BOX IF YOU ARE
> INTERESTED IN ME.
>
> Anyone want a woman who yells all the time?
Don't they all yell now? :)
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
japruim
raoset.com
attached mail follows:
On Mon, Mar 10, 2008 at 4:07 PM, tedd <tedd.sperling
gmail.com> wrote:
> At 3:14 PM -0400 3/10/08, Daniel Brown wrote:
> > The superuser (AKA root, administrator, God, whatever) has GID 0,
> >just like on a *NIX system. This is because it's the highest level
> >you can reach, and 0 is the lowest real number you can use. Thus, you
> >can add a virtually-infinite number of lesser users, as opposed to
> >being limited to 50, as in your case.
>
> Yeah, but then if you try to add a super-superuser you have to go negative. :-)
[snip!]
In actuality, there would be no such thing. However, for
posterity, negatives will work. So long as:
<? if($_SESSION['userlevel'] < $group_level) { ?>
.... evaluates to true. ;-P
> PS: Oh, I just received the following email and thought I would pass it on:
>
> HELLO,
> MY NAME IS AGNES IN SEARCH OF A MAN WHO UNDERSTANDS THE MEANING OF
> LOVE AS TRUST AND FAITH IN EACH OTHER RATHER THAN ONE WHO SEES LOVE
> AS THE ONLY WAY OF FUN BUT A MATURED MAN WITH NICE VISION OF WHAT
> THE WORLD IS ALL ABOUT SO PLEASE REPLY ME WITH THIS BOX IF YOU ARE
> INTERESTED IN ME.
>
> Anyone want a woman who yells all the time?
I don't think I could handle two. So if AGNES won't beat me
nightly with a sack of oranges ("because it doesn't leave bruises, but
it gets the point across"), Debs is going to come home and find her
stuff in a box.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
At 4:13 PM -0400 3/10/08, Jason Pruim wrote:
>On Mar 10, 2008, at 4:07 PM, tedd wrote:
>
>>define("ADMIN", md5(uniqid(rand(), true)););
>>define("GENERAL_USER", md5(uniqid(rand(), true)););
>>define("LEVEL_ONE_USER", md5(uniqid(rand(), true)););
>>define("LEVEL_TWO_USER", md5(uniqid(rand(), true)););
>>define("WHATEVER_USER", md5(uniqid(rand(), true)););
>
>with the chance to bring up an old thread about the universe not
>being random and everything being relational and all that... Any
>idea what the chances are that this would ever reproduce the same
>number? Or with the uniqid() portion will that check the other
>values?
I think the chances are very remote. You probably have a better
chance of winning the lottery ten times in a row.
On the other hand, if you assign the number yourself, your chances of
making a mistake is far greater.
But, now that I think about it -- you don't need a number at all, you
could use:
define("WHATEVER_USER","WHATEVER_USER");
The value portion in the define statement can be a string -- so cut
to the chase and make it as difficult on yourself as you want.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
On Mon, Mar 10, 2008 at 4:07 PM, tedd <tedd.sperling
gmail.com> wrote:
> At 3:14 PM -0400 3/10/08, Daniel Brown wrote:
> >On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com> wrote:
> >
>
> >> What I was thinking about doing was a combination of the company name
> >> (Which I set right now) and then a access level such as "50" for the
> >> "Owner" of the program, "40" for the "Managers" and "30" for the
> >> "user" of the program. also leaving me room to add other levels if
> >> required..
> >
> > I generally do the same basic thing for permission levels, but a
> >reverse of what you're attempting to do.
> >
> > The superuser (AKA root, administrator, God, whatever) has GID 0,
> >just like on a *NIX system. This is because it's the highest level
> >you can reach, and 0 is the lowest real number you can use. Thus, you
> >can add a virtually-infinite number of lesser users, as opposed to
> >being limited to 50, as in your case.
>
> Yeah, but then if you try to add a super-superuser you have to go negative. :-)
>
> Why not just define the users with define CONSTANT statement and use
> that? Then the different types of users can be anything you want and
> you can change the value easily if there's a problem.
>
> Really, all the value really has to be is unique -- you could use
> unique() for that, such as:
>
> define("ADMIN", md5(uniqid(rand(), true)););
> define("GENERAL_USER", md5(uniqid(rand(), true)););
> define("LEVEL_ONE__USER", md5(uniqid(rand(), true)););
> define("LEVEL_TWO__USER", md5(uniqid(rand(), true)););
> define("WHATEVER__USER", md5(uniqid(rand(), true)););
>
> and so on. That would work and you'll never have to be concerned
> about it nor worry about someone guessing it, if that becomes a
> problem.
>
> Am I right?
>
> Cheers,
>
> tedd
>
> PS: Oh, I just received the following email and thought I would pass it on:
>
> HELLO,
> MY NAME IS AGNES IN SEARCH OF A MAN WHO UNDERSTANDS THE MEANING OF
> LOVE AS TRUST AND FAITH IN EACH OTHER RATHER THAN ONE WHO SEES LOVE
> AS THE ONLY WAY OF FUN BUT A MATURED MAN WITH NICE VISION OF WHAT
> THE WORLD IS ALL ABOUT SO PLEASE REPLY ME WITH THIS BOX IF YOU ARE
> INTERESTED IN ME.
>
> Anyone want a woman who yells all the time?
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I sometimes set stuff up like this:
user
userId
user_permission
userId permissionId
permission
permissionId sort
Then the level of said permission is based on the rank "sort" value.
That way if you want to add a super super user, just change that
value.
But I also map these to constants like you said too. Using all those
unique id calls is going to really be slow FWIW. Every permission
system is fairly unique in the apps I program though so nothing is
really set in stone.
attached mail follows:
On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com> wrote:
> Hi Everyone, Happy Monday to all of you!
>
> I am trying to think through a user management issue for a application
> I am working on. What I want to do, is be able to provide a multi user
> environment (All accessing the same page, but depending on company
> name they get different data) and be able to give certain people the
> ability to add/remove users.
>
> What I was thinking about doing was a combination of the company name
> (Which I set right now) and then a access level such as "50" for the
> "Owner" of the program, "40" for the "Managers" and "30" for the
> "user" of the program. also leaving me room to add other levels if
> required..
>
> Although now that I'm typing this out.... I think I may have thought
> my way through the problem....
>
> What about setting up a separate login/password with a different web
> address so that "Owner's" can go to an admin section and add/remove
> users... promote/demote users... And all that fun kind of stuff.
>
> Is there any issues that anyone can see with what I'm thinking? Either
> with my original solution, or my secondary solution? :)
>
>
> --
>
> Jason Pruim
> Raoset Inc.
> Technology Manager
> MQC Specialist
> 3251 132nd ave
> Holland, MI, 49424-9337
> www.raoset.com
> japruim
raoset.com
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Read up on "ACL's."
http://en.wikipedia.org/wiki/Access_control_list
http://framework.zend.com/manual/en/zend.acl.html
attached mail follows:
Wait, what?
You are defining user role ids as MD5 hashes of UUIDs created from
random numbers that change on every request?
Am I missing something or is this completely insane advice?
On Mar 10, 2008, at 1:07 PM, tedd wrote:
> At 3:14 PM -0400 3/10/08, Daniel Brown wrote:
>> On Mon, Mar 10, 2008 at 3:08 PM, Jason Pruim <japruim
raoset.com>
>> wrote:
>>
>>> What I was thinking about doing was a combination of the company
>>> name
>>> (Which I set right now) and then a access level such as "50" for
>>> the
>>> "Owner" of the program, "40" for the "Managers" and "30" for the
>>> "user" of the program. also leaving me room to add other levels if
>>> required..
>>
>> I generally do the same basic thing for permission levels, but a
>> reverse of what you're attempting to do.
>>
>> The superuser (AKA root, administrator, God, whatever) has GID 0,
>> just like on a *NIX system. This is because it's the highest level
>> you can reach, and 0 is the lowest real number you can use. Thus,
>> you
>> can add a virtually-infinite number of lesser users, as opposed to
>> being limited to 50, as in your case.
>
> Yeah, but then if you try to add a super-superuser you have to go
> negative. :-)
>
> Why not just define the users with define CONSTANT statement and use
> that? Then the different types of users can be anything you want and
> you can change the value easily if there's a problem.
>
> Really, all the value really has to be is unique -- you could use
> unique() for that, such as:
>
> define("ADMIN", md5(uniqid(rand(), true)););
> define("GENERAL_USER", md5(uniqid(rand(), true)););
> define("LEVEL_ONE__USER", md5(uniqid(rand(), true)););
> define("LEVEL_TWO__USER", md5(uniqid(rand(), true)););
> define("WHATEVER__USER", md5(uniqid(rand(), true)););
>
> and so on. That would work and you'll never have to be concerned
> about it nor worry about someone guessing it, if that becomes a
> problem.
>
> Am I right?
>
> Cheers,
>
> tedd
>
> PS: Oh, I just received the following email and thought I would pass
> it on:
>
> HELLO,
> MY NAME IS AGNES IN SEARCH OF A MAN WHO UNDERSTANDS THE MEANING OF
> LOVE AS TRUST AND FAITH IN EACH OTHER RATHER THAN ONE WHO SEES LOVE
> AS THE ONLY WAY OF FUN BUT A MATURED MAN WITH NICE VISION OF WHAT
> THE WORLD IS ALL ABOUT SO PLEASE REPLY ME WITH THIS BOX IF YOU ARE
> INTERESTED IN ME.
>
> Anyone want a woman who yells all the time?
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Eric Butera wrote:
>
> Read up on "ACL's."
>
Apart from Zend which you've mentiond below, is there anything in/for
PHP that will help implement ACLs for a PHP application?
> http://en.wikipedia.org/wiki/Access_control_list
> http://framework.zend.com/manual/en/zend.acl.html
Does anyone use the Zend ACL stuff?
/Per Jessen, Zürich
attached mail follows:
At 6:13 PM -0700 3/9/08, Adil Drissi wrote:
>Yes like that, but you can consider also that the
>vertical menu has different style for the link of the
>current page. Anyway it does not matter for this
>problem. Can you show us how your php function looks
>like? Or maybe you are just doing a test for each link
>for your function to know if it is the link that
>should be displayed differently. I was wondering if
>there is a way to do the same thing without the
>overhead of all that "if " statements.
> >
>> Two menus, do you mean like this:
>>
> >
>http://webbytedd.com/clients/beckyscan/about-company.php
No offense meant, but if you're concerned about the "if" overhead
then I question if you would understand how the double menu works.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
>> Is it a good idea to put a cart in a session var since the cart will be
>> an
>> array ?
>
> Yes, and it's far more secure than putting the actual data into a
> cookie, since that can be changed on the client-side to alter prices
> and other data.
Thanks
attached mail follows:
Ok, thanks for info, i've downloaded the MailEnable SW for free and i was
able to check that my PHP mail function really send correctly emails :-)
thanks a lot,
A.
On Mon, Mar 10, 2008 at 3:33 PM, Daniel Brown <parasane
gmail.com> wrote:
> On Sun, Mar 9, 2008 at 4:38 PM, Alain Roger <raf.news
gmail.com> wrote:
> > Hi,
> >
> > i know that this is not necessary the best forum for that, but i need
> to get
> > a real feedback and i guess you already faced the same issue as mine.
> > basically, i develop php web application on windows XP platform.
> > So i have apache 2.24 installed and PHP 5.2.4.
> >
> > now i would like to test if my application send emails, so i've checked
> my
> > php.ini file and it seems ok.
> > i tried to use IIS from windows to define a default SMTP server, but as
> my
> > emails are not sent, i guess something is wrong with IIS.
>
> So which HTTP server are you using? You stated earlier that you
> have Apache 2.24 on there, but here you say that you're using IIS. If
> you're using Apache, the IIS web server configuration will have
> nothing to do with anything.
>
> > so does it exist a free SMTP server (similar that linux daemon) but
> running
> > on windows XP ?
>
> I may be incorrect on this, but I'm pretty sure that
> Win2K/XP/Vista have Microsoft Exchange bundled in for SMTP. Check in
> Add/Remove Programs > Windows Components > Internet Information
> Services (I think, but I'm guessing.... I really don't use Windows
> that often). Even though it has the same name (IIS), in this case,
> it's the category for all Internet services. There should be
> something mentioning SMTP there.
>
> > if yes, where can i find it and what steps should i perform to be sure
> my
> > emails are sent ?
>
> Check the logs for Exchange/SMTP or whatever other MTA you decide
> to use and see if there's anything mentioned about the problem. It
> could be an authentication/negotiation issue. Also, check your
> Windows firewall (or third-party software) to ensure that you can
> connect to localhost:25. The easiest way to test this is as follows:
>
> Start > Run
> Type: cmd
> Type: telnet localhost 25
> If it connects, type: HELO localhost
> Note the response.
>
> You can then try sending a message through the server manually, if
> you'd like. While still connected via Telnet as shown above, type the
> following (replacing things as necessary):
>
> MAIL FROM: you
your_dev_box_host_name.fqdn.tld
> RCPT TO: youraddress
domain.tld
> DATA
> Subject: Testing Email from Telnet
> This is a test.
> .
>
> Always end with a period on a line of its own. That should show
> you what, if any, error messages are being kicked out by your SMTP
> server.
>
> --
> </Dan>
>
> Daniel P. Brown
> Senior Unix Geek
> <? while(1) { $me = $mind--; sleep(86400); } ?>
>
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
attached mail follows:
Hi
Ubuntu7.10 LAMP
A PHP session destroys itself as soon as the client disconnects from the
site.
Why if I connect from another machine, log in, and disconnect without
logging off, and return 5 mins later, my session is still alive ?
Thanks
attached mail follows:
On Mon, Mar 10, 2008 at 3:59 PM, Bill <billlab51
hotmail.com> wrote:
> Hi
>
> Ubuntu7.10 LAMP
>
> A PHP session destroys itself as soon as the client disconnects from the
> site.
>
> Why if I connect from another machine, log in, and disconnect without
> logging off, and return 5 mins later, my session is still alive ?
A session only expires in three cases:
a.) An explicit session_destroy() is sent.*
b.) The user-side cookie with the session key expires.
c.) The session corrupts.+
* You can also unset() or session_unset() all of the $_SESSION
variables, but it still won't kill the user's cookie.
+ The session won't always automatically be destroyed in this
case, so don't rely on it.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Hi Daniel,
>> Why if I connect from another machine, log in, and disconnect without
>> logging off, and return 5 mins later, my session is still alive ?
>
> A session only expires in three cases:
> a.) An explicit session_destroy() is sent.*
> b.) The user-side cookie with the session key expires.
> c.) The session corrupts.+
I didn't set any cookie so it must be the php session cookie.
How can I check for the visitor's presence ?
I can't set a timer or check for activity since the visitor can be studying
an online document.
I must rely on the browser connection.
Thanks
attached mail follows:
On Mon, Mar 10, 2008 at 4:32 PM, Bill <billlab51
hotmail.com> wrote:
> I didn't set any cookie so it must be the php session cookie.
> How can I check for the visitor's presence ?
> I can't set a timer or check for activity since the visitor can be studying
> an online document.
> I must rely on the browser connection.
I had sent a solution to another user on the list a few days ago.
You can find it here in the archives:
http://www.nabble.com/Logging-session-timeout-in-DB-to15845123.html
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
Hi Daniel,
> http://www.nabble.com/Logging-session-timeout-in-DB-to15845123.html
It can build a lot of stress on the server.
What if I use connection_aborted() ?
In the status line of the page I can write a 'connected' timer and use it to
check the connection !?
At most I'll have a 30 secs. time lapse. (30 secs. is the default execution
time for scripts)
What do you think of that?
Thanks
attached mail follows:
On Mon, Mar 10, 2008 at 6:23 PM, Bill <billlab51
hotmail.com> wrote:
> At most I'll have a 30 secs. time lapse. (30 secs. is the default execution
> time for scripts)
>
> What do you think of that?
That could work for very short sessions, sure. This was for a
larger, longer, community-style script. And it wouldn't cause very
much stress on the server, actually, but with large communities of
655,350+ (using a Magic Number[tm]), you
surely wouldn't want the cron to run every 10 minutes.
The example from the link is set to see if a user is still active
on the site. If all you want to do is find out if they still have the
socket open, then there are much smaller, simpler ways.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
attached mail follows:
It used to have a feed, by accident.
Now someone munches up too much bandwidth.
http://www.foo.com//?feed=rss2
How can I divert this to 127.0.0.1 or something to convince this one to
leave my bandwidth alone?
John
attached mail follows:
I do. CPanel too. How would I write that into an htaccess ?
Shawn McKenzie wrote:
> John Taylor-Johnston wrote:
>
>
> If you have apache, I would use a rewrite rule to return not found.
>
>
attached mail follows:
Any other inspiration?
Thanks,
John
John Taylor-Johnston wrote:
> It used to have a feed, by accident.
> Now someone munches up too much bandwidth.
> http://www.foo.com/?feed=rss2
> How can I divert this to 127.0.0.1 or something to convince this one to
> leave my bandwidth alone?
> John
attached mail follows:
Any other inspiration?
Thanks,
John
John Taylor-Johnston wrote:
> It used to have a feed, by accident.
> Now someone munches up too much bandwidth.
> http://www.foo.com/?feed=rss2
> How can I divert this to 127.0.0.1 or something to convince this one to
> leave my bandwidth alone?
> John
attached mail follows:
hi to all!
on one eZine site, I have to show when the article is posted but as difference from NOW. like "posted 32 minutes ago", or "posted 5 days ago".
is there already sucha php/mysql function?
thanks.
-ll
---------------------------------
Never miss a thing. Make Yahoo your homepage.
attached mail follows:
rahul...
you can easily set up an nfs share on one of the systems, and have the other
2 boxes connect to the share wit w/r privs...
this would allow a box to write to the share, with the other boxes being
able read the files...
if all the boxes are linux/fedora/rhel, and they're all connected to the
system... it's easy to set up.
peace..
-----Original Message-----
From: Rahul [mailto:rahul986
gmail.com]
Sent: Thursday, March 06, 2008 7:40 PM
To: php-general
lists.php.net
Subject: Re: [PHP] Re: Transferring files between computers using php
Thank you all so much for replying... I guess I was very vague in
describing the situation. I will write in detail:
I have three computers A, B and C. To login to B and C I should use A
because it has a SSH key. I don't have any other way of accessing these
two computers. Now, if I need to transfer a file between B and C, I am
unable to find a way that would work... because I don't know how to
authenticate without SSH keys... I was gathering some data in B and C
using PHP. Now, I need these two computers to coordinate a little and
didn't want to use a server in between and so I was thinking of
establishing a direct connection between them..
Zareef Ahmed wrote:
> On 3/7/08, Shawn McKenzie <nospam
mckenzies.net> wrote:
>> Rahul wrote:
>>> I have a small file to be transferred between two computers every few
>>> seconds. I'm using unix with a bare bones version of php, i.e. just the
>>> original thing that gets installed when I run "yum install php". As
>> there is
>>> no webserver on any of these machines, I was wondering if there is a way
>> to
>>> transfer a small file between them and if there is, could someone be
>> kind
>>> enough to provide me with an example please?
>>>
>>> Thank You
>>>
>>>
>> FYI... If you're using yum I assume it's a Linux machine (maybe Fedora)
>> and not Unix.
>
>
>
> If you want to use rsync and scp in a cronjob (for continuous transfer at
a
> predefined interval), you may need to set your server (read ssh) to accept
> connection without password.
> Ref : http://linuxproblem.org/art_9.html
>
> BUT If you really want to do that from PHP, you can install a web server
and
> enable http as your stream for opening files. (In php.ini)
> You can read the file using fopen or any other file functions, then can
> write that file to the server on which script will be running, then you
can
> set this script as your cron job.
>
> For example :
>
> $filecontents=file_get_contents("http://firstserver/file.txt");
>
> $fp=fopen("path to local file", "mode");
>
> Now use $fiiecontents to write the file using $fp resource.
>
> BUT remember, using rsync is always a better solution, and
file_get_contents
> and file functions are resource hungry, specially they will consume more
> memory of your system.
>
>
>
> --
>> 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:
I have about 10 csv files I need to open to access data. It takes a lot
of time to search each file for the values I need. Would it be best to
just dump all the cvs files to an SQL db and then just grab what I need
from there? I'm starting to think it would make a lot of sense. What do
you guys think?
Thanks,
Dan
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
attached mail follows:
If you can't store the values in a real DB, then that might be an option.
You might consider using a temporary table if it's available in the
database you're using, that way you don't have to worry about implicitly
creating then destroying the table.
The only problem is how temporary the temporary table may be. If you can do
everything you need in one connection, then you should be good. Otherwise
you'd want to use either a persistant connection or use a real table.
You may also load all your CSV data into an array, but that may use up more
memory and be slower and/or more cumbersome to search.
You could try out a few scenarios and see how they work speed-wise and impact
on system memory and such.
-TG
----- Original Message -----
From: Danny Brow <maillist
fullmotions.com>
To: PHP <php-general
lists.php.net>
Date: Mon, 10 Mar 2008 21:09:15 -0400
Subject: [PHP] CSV speed
> I have about 10 csv files I need to open to access data. It takes a lot
> of time to search each file for the values I need. Would it be best to
> just dump all the cvs files to an SQL db and then just grab what I need
> from there? I'm starting to think it would make a lot of sense. What do
> you guys think?
>
> Thanks,
> Dan
attached mail follows:
Danny Brow wrote:
> I have about 10 csv files I need to open to access data. It takes a lot
> of time to search each file for the values I need. Would it be best to
> just dump all the cvs files to an SQL db and then just grab what I need
> from there? I'm starting to think it would make a lot of sense. What do
> you guys think?
>
> Thanks,
> Dan
Dan,
I can tell you that depending on the size of your files is going to
dictate the route you want to go. I have a CSV with 568,000+ lines with
19 different pieces to each line. The files are around 180M apiece and
it takes my server about 2 seconds to run a system grep against the
files. I can run a recursive call 7 times against a MySQL database with
the same information and it takes it about 4 seconds.
IF you have system call ability, a grep wouldn't be bad, otherwise I'd
suggest loading the csv files into MySQL tables and checking them for
the information, then dropping the tables when you get the next files.
You can backup the databases such as a cron job overnight even.
HTH,
Wolf
attached mail follows:
On Mon, 2008-03-10 at 22:36 -0400, Wolf wrote:
> Danny Brow wrote:
> > I have about 10 csv files I need to open to access data. It takes a lot
> > of time to search each file for the values I need. Would it be best to
> > just dump all the cvs files to an SQL db and then just grab what I need
> > from there? I'm starting to think it would make a lot of sense. What do
> > you guys think?
> >
> > Thanks,
> > Dan
>
>
> Dan,
>
> I can tell you that depending on the size of your files is going to
> dictate the route you want to go. I have a CSV with 568,000+ lines with
> 19 different pieces to each line. The files are around 180M apiece and
> it takes my server about 2 seconds to run a system grep against the
> files. I can run a recursive call 7 times against a MySQL database with
> the same information and it takes it about 4 seconds.
>
> IF you have system call ability, a grep wouldn't be bad, otherwise I'd
> suggest loading the csv files into MySQL tables and checking them for
> the information, then dropping the tables when you get the next files.
> You can backup the databases such as a cron job overnight even.
>
> HTH,
> Wolf
>
>
Thanks that sounds like a good idea. I'm still plugging away with how I
started. I want to know how much faster it will be going with a db. I
was actually thinking of using diff for each updated file to and upload
that to the DB.
Dan
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
attached mail follows:
You may want to consider an SQLite database. Any PHP 5 install is likely to
support it, and it should be very fast for reads. (Not so much for writes,
but if you're dealing with something that can use CSV, it will probably work
in SQLite, too.)
On Monday 10 March 2008, TG wrote:
> If you can't store the values in a real DB, then that might be an option.
> You might consider using a temporary table if it's available in the
> database you're using, that way you don't have to worry about implicitly
> creating then destroying the table.
>
> The only problem is how temporary the temporary table may be. If you can
> do everything you need in one connection, then you should be good.
> Otherwise you'd want to use either a persistant connection or use a real
> table.
>
> You may also load all your CSV data into an array, but that may use up more
> memory and be slower and/or more cumbersome to search.
>
> You could try out a few scenarios and see how they work speed-wise and
> impact on system memory and such.
>
> -TG
>
> ----- Original Message -----
> From: Danny Brow <maillist
fullmotions.com>
> To: PHP <php-general
lists.php.net>
> Date: Mon, 10 Mar 2008 21:09:15 -0400
> Subject: [PHP] CSV speed
>
> > I have about 10 csv files I need to open to access data. It takes a lot
> > of time to search each file for the values I need. Would it be best to
> > just dump all the cvs files to an SQL db and then just grab what I need
> > from there? I'm starting to think it would make a lot of sense. What do
> > you guys think?
> >
> > Thanks,
> > Dan
--
Larry Garfield AIM: LOLG42
larry
garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
attached mail follows:
On Mon, Mar 10, 2008 at 8:09 PM, Danny Brow <maillist
fullmotions.com> wrote:
> I have about 10 csv files I need to open to access data. It takes a lot
> of time to search each file for the values I need. Would it be best to
> just dump all the cvs files to an SQL db and then just grab what I need
> from there? I'm starting to think it would make a lot of sense. What do
> you guys think?
grep foo whatever.csv | php ./script.php
--
Greg Donald
http://destiney.com/
attached mail follows:
Danny Brow wrote:
> On Mon, 2008-03-10 at 22:36 -0400, Wolf wrote:
>> Danny Brow wrote:
>>> I have about 10 csv files I need to open to access data. It takes a lot
>>> of time to search each file for the values I need. Would it be best to
>>> just dump all the cvs files to an SQL db and then just grab what I need
>>> from there? I'm starting to think it would make a lot of sense. What do
>>> you guys think?
>>>
>>> Thanks,
>>> Dan
>>
>> Dan,
>>
>> I can tell you that depending on the size of your files is going to
>> dictate the route you want to go. I have a CSV with 568,000+ lines with
>> 19 different pieces to each line. The files are around 180M apiece and
>> it takes my server about 2 seconds to run a system grep against the
>> files. I can run a recursive call 7 times against a MySQL database with
>> the same information and it takes it about 4 seconds.
>>
>> IF you have system call ability, a grep wouldn't be bad, otherwise I'd
>> suggest loading the csv files into MySQL tables and checking them for
>> the information, then dropping the tables when you get the next files.
>> You can backup the databases such as a cron job overnight even.
>>
>> HTH,
>> Wolf
>>
>>
>
>
> Thanks that sounds like a good idea. I'm still plugging away with how I
> started. I want to know how much faster it will be going with a db. I
> was actually thinking of using diff for each updated file to and upload
> that to the DB.
>
> Dan
Running a diff and loading the changes wouldn't be a bad way to go, one
thing to take into account as well would be any tracking of the changes
that you would need to do as well. IE, if you update an entry, write it
to a changes table with a date attached as to when it happened.
Wolf
attached mail follows:
Greg Donald wrote:
> On Mon, Mar 10, 2008 at 8:09 PM, Danny Brow <maillist
fullmotions.com> wrote:
>> I have about 10 csv files I need to open to access data. It takes a lot
>> of time to search each file for the values I need. Would it be best to
>> just dump all the cvs files to an SQL db and then just grab what I need
>> from there? I'm starting to think it would make a lot of sense. What do
>> you guys think?
>
> grep foo whatever.csv | php ./script.php
While that could work if the server is set up to allow you to run system
calls, but you don't find that available outside of test environments.
Also depending on the file sizes, you'll see some differences.
Wolf
attached mail follows:
Hey Rob,
Remember on 2007-09-18 at 22:45:37 when you suggested I do this:
http://marc.info/?l=php-general&m=119015558426248&w=2
Well.. today strtotime( 'last Sunday' ) screwed me and I'm writing to
say that I nearly fell out of my chair laughing when I realized what
the problem was, who caused it, and who "helped" me code it. :)
This issue only appears on an ancient PHP4 install as far as I can tell:
echo "Current time():\n";
echo date( 'Y-m-d H:i:s', time() );
echo "\nBroken strtotime( 'last Sunday' )\n";
echo date( 'Y-m-d H:i:s', strtotime( 'last Sunday' ) );
echo "\n";
> /usr/local/php4/bin/php test.php
Current time():
2008-03-10 20:03:39
Broken strtotime( 'last Sunday' )
2008-03-08 23:00:00
23:00? Guess what we did to out clocks this past weekend?
I blame the republicans in general, and the short one named 'W' specifically.
I won't bother mentioning the fix as I'm sure 83,293,874,713 people
will post the same correct code by the end of the day tomorrow. No
one runs PHP4 except _my_ clients anyway. *shrug*
--
Greg Donald
http://destiney.com/
attached mail follows:
Greg Donald wrote:
> Hey Rob,
>
> Remember on 2007-09-18 at 22:45:37 when you suggested I do this:
>
> http://marc.info/?l=php-general&m=119015558426248&w=2
>
> Well.. today strtotime( 'last Sunday' ) screwed me and I'm writing to
> say that I nearly fell out of my chair laughing when I realized what
> the problem was, who caused it, and who "helped" me code it. :)
>
> This issue only appears on an ancient PHP4 install as far as I can tell:
>
> echo "Current time():\n";
> echo date( 'Y-m-d H:i:s', time() );
> echo "\nBroken strtotime( 'last Sunday' )\n";
> echo date( 'Y-m-d H:i:s', strtotime( 'last Sunday' ) );
> echo "\n";
>
>> /usr/local/php4/bin/php test.php
> Current time():
> 2008-03-10 20:03:39
> Broken strtotime( 'last Sunday' )
> 2008-03-08 23:00:00
>
> 23:00? Guess what we did to out clocks this past weekend?
>
> I blame the republicans in general, and the short one named 'W' specifically.
>
> I won't bother mentioning the fix as I'm sure 83,293,874,713 people
> will post the same correct code by the end of the day tomorrow. No
> one runs PHP4 except _my_ clients anyway. *shrug*
Watch throwing that blame around there Greg, you get to thank the
democrats for NAFTA and the hurting the heartlands including the one
who's running now and controlled her man by the short hairs... well I
guess Monica did that.. And she's pimping out her daughter... ;)
And yeah, the code is out there for all the daylight savings changes... ;)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]