php-general Digest 20 Jun 2009 11:10:00 -0000 Issue 6185

2009-06-20 Thread php-general-digest-help

php-general Digest 20 Jun 2009 11:10:00 - Issue 6185

Topics (messages 294355 through 294362):

Re: about locale settings
294355 by: Daniel Brown

Re: PEAR Spreadsheet_Excel_Writer setLocked method
294356 by: Skip Evans

Re: This Friday's OT Thread
294357 by: Nitsan Bin-Nun
294358 by: Dotan Cohen
294359 by: Dotan Cohen
294360 by: Eddie Drapkin

Re: isset question
294361 by: Paul M Foster
294362 by: Ashley Sheridan

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---
On Fri, Jun 19, 2009 at 15:40, Per Jessenp...@computer.org wrote:

 http://bugs.php.net/bug.php?id=48612

See my email to you a moment ago on the impeccability of your
timing, as well.  ;-P

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1
---End Message---
---BeginMessage---

Thodoris wrote:
I've used it for some time but never needed to lock a cell. Here is a 
piece of code that shows how to apply a format to a cell:

  Hope it helps. I think that by doing something like this:


$format_bold-setLocked();

while creating the format could do the trick but it is not tested.



No, this didn't do it. I already have some formats I've 
created for dollar amounts, right align, etc, and applying the 
setLocked() method to them had no affect.


Skip

--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut
---End Message---
---BeginMessage---
Collage? you better try highschool ;)

Anyway tomorrow my sis has bat-mitzva ;)

Good night folks!

On Fri, Jun 19, 2009 at 8:42 PM, Daniel Brown danbr...@php.net wrote:

Hey, folks;

It's been a while since we've launched a Friday OT thread, so here
 ya' go.  Feel free to post nonsense, babble, share links, blow off
 some steam, bitch and complain about a colleague, whatever.  Just
 remember that you're live to the world and are being archived and
 preserved for future generations.  ;-P

To start off, something that's affecting us all, as a world
 community, with more frequency.  Safe for work.

http://fart.ly/xos5z9

Here's hoping everyone has a great weekend!

 --
 /Daniel P. Brown
 daniel.br...@parasane.net || danbr...@php.net
 http://www.parasane.net/ || http://www.pilotpig.net/
 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1

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


---End Message---
---BeginMessage---
 I'm self-employed. I don't plan on ever laying myself off.


Wow, I really replaced laying with getting in my mental eye and
that sentence made too much sense. Please, don't ever do that to me
again!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
---End Message---
---BeginMessage---
 I'm self-employed. I don't plan on ever laying myself off.

    Mind out of the gutter, Rob.  Words like self, laying, and
 off will get you flagged.


How naive I was to think that I might be the only one to make the connection!


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
---End Message---
---BeginMessage---
Wait, that's not how everyone else gets ready for a coding marathon?

You guys are doing it wrong!

On Fri, Jun 19, 2009 at 7:03 PM, Dotan Cohendotanco...@gmail.com wrote:
 I'm self-employed. I don't plan on ever laying myself off.

    Mind out of the gutter, Rob.  Words like self, laying, and
 off will get you flagged.


 How naive I was to think that I might be the only one to make the connection!


 --
 Dotan Cohen

 http://what-is-what.com
 http://gibberish.co.il

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


---End Message---
---BeginMessage---
On Fri, Jun 19, 2009 at 07:52:40PM +0100, Ashley Sheridan wrote:

 On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
  On 18 June 2009 20:25, LAMP advised:
 
   using !empty() instead isset() will work if you don't care for PHP
   Notice: Undefined variable... If you want to avoid PHP Notice
   you have
   to use both:
  
   $msg.=  (isset($_POST['mort']) and !empty($_POST['mort'])) ? The
   mortgage amount is  $mort\n :  ;
 
  Absolute rubbish -- as it says at http://php.net/empty, empty($var) is
  the opposite of (boolean)$var, except that no warning is generated when
  the variable is not set. -- so protecting empty() with an isset() is
  a total waste of time, 

php-general Digest 20 Jun 2009 23:31:30 -0000 Issue 6186

2009-06-20 Thread php-general-digest-help

php-general Digest 20 Jun 2009 23:31:30 - Issue 6186

Topics (messages 294363 through 294373):

Re: Calendar
294363 by: tedd

Re: Multi-Sort -- how to do this?
294364 by: tedd

Re: isset question
294365 by: Reese
294366 by: Gary

resubmit form after validation error
294367 by: PJ
294370 by: Caner BULUT

PHP Mail Function
294368 by: Julian Muscat Doublesin

Re: redirect to a static page
294369 by: O. Lavell

Users Online?
294371 by: Chris Payne
294372 by: Michael A. Peters

Re: [PHP-DEV] PHP 5.3.0RC4
294373 by: Johannes Schlüter

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---

At 7:58 PM +0100 6/19/09, Ashley Sheridan wrote:

On Fri, 2009-06-19 at 15:30 +0530, Sudheer Satyanarayana wrote:

 salmarayan wrote:
  Does Any body please have the code of A Java Script Calendar 
that works with

  a PHP Html  Form..
  if yes can you please send it as i have one but does not work that
  Efficiently.
 
  Thanks in advance
   
 This might help if you are looking for a date picker


 http://techchorus.net/add-cool-date-picker-2-lines-javascript


 --

 With warm regards,
 Sudheer. S
 Business: http://binaryvibes.co.in, Tech stuff: 
http://techchorus.net, Personal: http://sudheer.net




I've always used Tigra calendar, and it's been very flexible for me for
a lot of sites. Don't know whether or not it is still maintained, as I
keep using the same source I picked up a couple of years back! If you
have trouble finding it, give me a shout.

Thanks
Ash


Ash et al:

I like to roll and maintain my own. While it's not javascript, it works.

http://webbytedd.com//tedd-php-calendar/  -- code is there

And it's fairly easy to hook up to a database, such as seen here:

http://php1.net/my-php-calendar/

The original code for the db version can be found in the php-calendar 
(http://php-calendar.com).


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com
---End Message---
---BeginMessage---

At 3:36 PM -0400 6/18/09, Robert Cummings wrote:

tedd wrote:

At 1:45 PM -0400 6/18/09, Robert Cummings wrote:
Thanks to Rob and Daniel for also playing, better luck next time. 
:-) - note smiley -- I do appreciate your time.

Mine version retains key associations. It wasn't a complete waste of time.

Cheers,
Rob.


Rob:

Nothing you provide me is a complete waste of time -- see here:

http://www.webbytedd.com//multisort-rob/

Many thanks for your code.


I meant to have a smiley at the end of it. I don't mind doing it, 
even thought he solution existed for multisort, thinking through the 
process is invaluable :)


Cheers,
Rob.


Rob:

Understood -- but just as well -- I don't pass up on any tidbits you 
provide even if I don't fully understand them (i.e., your push/pull 
example). And no I don't need an explanation, that understanding will 
come in time. It akin to fully understanding OOP. If you understand 
it the first time your exposed to it, you're lucky. After a few more 
exposures, you finally get it and wonder what the confusion was 
about. It just takes time.


Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com
---End Message---
---BeginMessage---

Waynn Lue wrote:

I notice that you're checking $_POST['mort'] but you're echoing $mort,
is that your actual code?


That was my observation as well. Is $mort = $POST['mort']; being
set somewhere else or not? If not, how is your script supposed to
know what value $mort should be?

And, what the other guys said. Gary, before you do anything with
submitted data you need to process it against strip_tags() and/or
htmlentities() at the very least, mysql_real_escape_string() if
the data goes to a db.

Reese

--



On 6/18/09, Gary gwp...@ptd.net wrote:

I have a form that gives the submitter a choice or either one set of
questions, or another. I am still getting the message even if the input was
left blank.  So on the line below,

$msg.=  isset($_POST['mort']) ? The mortgage amount is  $mort\n :  ;




---End Message---
---BeginMessage---
Yes... I echo the code onto the page as well as sending out the message. 
The echo is sort of a thank you page, this is what you submitted.  A 
message, which is not going into a DB, is also emailed to the submitter and 
cleint.

Gary
Waynn Lue waynn...@gmail.com wrote in message 
news:d29bea5e0906181231r165c5844wecd7d34026621...@mail.gmail.com...
I notice that you're checking $_POST['mort'] but you're echoing $mort,
 is that your actual code?

 On 6/18/09, Gary gwp...@ptd.net wrote:
 I have a form that gives the submitter a choice or either one set of
 questions, or 

Re: [PHP] isset question

2009-06-20 Thread Ashley Sheridan
On Sat, 2009-06-20 at 00:19 -0400, Paul M Foster wrote:
 On Fri, Jun 19, 2009 at 07:52:40PM +0100, Ashley Sheridan wrote:
 
  On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
   On 18 June 2009 20:25, LAMP advised:
  
using !empty() instead isset() will work if you don't care for PHP
Notice: Undefined variable... If you want to avoid PHP Notice
you have
to use both:
   
$msg.=  (isset($_POST['mort']) and !empty($_POST['mort'])) ? The
mortgage amount is  $mort\n :  ;
  
   Absolute rubbish -- as it says at http://php.net/empty, empty($var) is
   the opposite of (boolean)$var, except that no warning is generated when
   the variable is not set. -- so protecting empty() with an isset() is
   a total waste of time, space and cpu cycles.
 
 snip
 
  
  To be honest, you're still opening yourself up to attack that way. 
 
 Why and how?
 
 Paul
 
 -- 
 Paul M. Foster
 
I've only done a little reading on this, but you're opening yourself up
to a XSS attack. If someone posted 'script//malicious code
here/script' to your PHP script, you'd essentially be printing that
right back out onto your page.

Thanks
Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Calendar

2009-06-20 Thread tedd

At 7:58 PM +0100 6/19/09, Ashley Sheridan wrote:

On Fri, 2009-06-19 at 15:30 +0530, Sudheer Satyanarayana wrote:

 salmarayan wrote:
  Does Any body please have the code of A Java Script Calendar 
that works with

  a PHP Html  Form..
  if yes can you please send it as i have one but does not work that
  Efficiently.
 
  Thanks in advance
   
 This might help if you are looking for a date picker


 http://techchorus.net/add-cool-date-picker-2-lines-javascript


 --

 With warm regards,
 Sudheer. S
 Business: http://binaryvibes.co.in, Tech stuff: 
http://techchorus.net, Personal: http://sudheer.net




I've always used Tigra calendar, and it's been very flexible for me for
a lot of sites. Don't know whether or not it is still maintained, as I
keep using the same source I picked up a couple of years back! If you
have trouble finding it, give me a shout.

Thanks
Ash


Ash et al:

I like to roll and maintain my own. While it's not javascript, it works.

http://webbytedd.com//tedd-php-calendar/  -- code is there

And it's fairly easy to hook up to a database, such as seen here:

http://php1.net/my-php-calendar/

The original code for the db version can be found in the php-calendar 
(http://php-calendar.com).


Cheers,

tedd

--
---
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



Re: [PHP] Multi-Sort -- how to do this?

2009-06-20 Thread tedd

At 3:36 PM -0400 6/18/09, Robert Cummings wrote:

tedd wrote:

At 1:45 PM -0400 6/18/09, Robert Cummings wrote:
Thanks to Rob and Daniel for also playing, better luck next time. 
:-) - note smiley -- I do appreciate your time.

Mine version retains key associations. It wasn't a complete waste of time.

Cheers,
Rob.


Rob:

Nothing you provide me is a complete waste of time -- see here:

http://www.webbytedd.com//multisort-rob/

Many thanks for your code.


I meant to have a smiley at the end of it. I don't mind doing it, 
even thought he solution existed for multisort, thinking through the 
process is invaluable :)


Cheers,
Rob.


Rob:

Understood -- but just as well -- I don't pass up on any tidbits you 
provide even if I don't fully understand them (i.e., your push/pull 
example). And no I don't need an explanation, that understanding will 
come in time. It akin to fully understanding OOP. If you understand 
it the first time your exposed to it, you're lucky. After a few more 
exposures, you finally get it and wonder what the confusion was 
about. It just takes time.


Cheers,

tedd


--
---
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



Re: [PHP] isset question

2009-06-20 Thread Reese

Waynn Lue wrote:

I notice that you're checking $_POST['mort'] but you're echoing $mort,
is that your actual code?


That was my observation as well. Is $mort = $POST['mort']; being
set somewhere else or not? If not, how is your script supposed to
know what value $mort should be?

And, what the other guys said. Gary, before you do anything with
submitted data you need to process it against strip_tags() and/or
htmlentities() at the very least, mysql_real_escape_string() if
the data goes to a db.

Reese

--



On 6/18/09, Gary gwp...@ptd.net wrote:

I have a form that gives the submitter a choice or either one set of
questions, or another. I am still getting the message even if the input was
left blank.  So on the line below,

$msg.=  isset($_POST['mort']) ? The mortgage amount is  $mort\n :  ;





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



Re: [PHP] isset question

2009-06-20 Thread Gary
Yes... I echo the code onto the page as well as sending out the message. 
The echo is sort of a thank you page, this is what you submitted.  A 
message, which is not going into a DB, is also emailed to the submitter and 
cleint.

Gary
Waynn Lue waynn...@gmail.com wrote in message 
news:d29bea5e0906181231r165c5844wecd7d34026621...@mail.gmail.com...
I notice that you're checking $_POST['mort'] but you're echoing $mort,
 is that your actual code?

 On 6/18/09, Gary gwp...@ptd.net wrote:
 I have a form that gives the submitter a choice or either one set of
 questions, or another. I am still getting the message even if the input 
 was
 left blank.  So on the line below,

 $msg.=  isset($_POST['mort']) ? The mortgage amount is  $mort\n :  ;

 I get

 The mortgage amount is

 What am I missing here?

 Thanks

 Gary



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

 



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



[PHP] resubmit form after validation error

2009-06-20 Thread PJ
I'm having a bit of a time figuring out how to resubmit a form after
obligatory field missing error.
The problem is that the page is accessed from a search page href where
the uri is like = file.php$=123.
Since the method=post action=file.php?=?php echo $number; ? does
not work nor does PHP_SELF, I have set the action=otherfile.php. All
is well, if all fields are properly entered, but if there is an error,
how to resubmit the form for correction and resubmission without using
js or functions or redoing it all from scratch?

-- 
Hervé Kempf: Pour sauver la planète, sortez du capitalisme.
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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



[PHP] PHP Mail Function

2009-06-20 Thread Julian Muscat Doublesin
Hello Everyone,

I have written an e-mail function that sends e-mail to my domain that
forwards it to a gmail account.

When I use the gmail address directly it works fine. When I use my mail
domain i don't get anything.

Has anyone experienced this? Can anyone give me some advice?

Thanks in advance

Julian


[PHP] Re: redirect to a static page

2009-06-20 Thread O. Lavell
Vit wrote:

 Hi all,
 
 I'm trying to understand how to redirect to a static page
 
 here you are the code (it seem to be a stupid code, but I'm just
 debugging.
 
 ?php
 
   header( Location: http://www.google.com; );
 ?
 
 instead of being redirect to www.google,com, I get the following error:
 
 Warning: Cannot modify header information - headers already sent by
 
 what can be??? how can I solve it??

The header needs to be the very first output your script sends out. No 
other output may come before it. This is clearly discussed in the manual 
at http://www.php.net/header.

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



RE: [PHP] resubmit form after validation error

2009-06-20 Thread Caner BULUT
Hi,

You can use a variable to that. Like following. Example if the variable is 1
you start to processing form input.

Example 

form method=post action=file.php?action=1

And in file.php you check the action variable if it is 1 you can start the
processing data.

If($_GET['action']==1) {
 Echo done;
}

Thanks.
Caner.


-Original Message-
From: PJ [mailto:af.gour...@videotron.ca] 
Sent: 20 June 2009 22:55
To: php-general@lists.php.net
Subject: [PHP] resubmit form after validation error

I'm having a bit of a time figuring out how to resubmit a form after
obligatory field missing error.
The problem is that the page is accessed from a search page href where
the uri is like = file.php$=123.
Since the method=post action=file.php?=?php echo $number; ? does
not work nor does PHP_SELF, I have set the action=otherfile.php. All
is well, if all fields are properly entered, but if there is an error,
how to resubmit the form for correction and resubmission without using
js or functions or redoing it all from scratch?

-- 
Hervé Kempf: Pour sauver la planète, sortez du capitalisme.
-
Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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


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



[PHP] Users Online?

2009-06-20 Thread Chris Payne
Hi everyone,

I have a login system that allows a user to login to my control panel,
is there an easy way so that I can tell how many users / what users
are logged into my system?  What would I need to do to add this with
the minimum of hassle?  Would I just have to look at the sessions that
are currently active and if so, how?  I really want to add this
feature as it will help with creating a messaging system.

It might be simple but if you've never done it before it's the hardest
thing in the world :-)

Thank you

Chris

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



Re: [PHP] Users Online?

2009-06-20 Thread Michael A. Peters

Chris Payne wrote:

Hi everyone,

I have a login system that allows a user to login to my control panel,
is there an easy way so that I can tell how many users / what users
are logged into my system?


I assume there is since many community applications (IE bulletin boards) 
show logged in users.


It's probably easiest if you use a database for session handling, but 
you can probably do it it other ways as well.


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



[PHP] RE: [PHP-DEV] PHP 5.3.0RC4

2009-06-20 Thread Johannes Schlüter
Hi,

On Fri, 2009-06-19 at 12:13 +0200, Uwe Schindler wrote:
 /pangaea/install/php-5.3.0RC4/ext/pdo_mysql/mysql_statement.c: In function
 `pdo_mysql_stmt_dtor':
 
 /pangaea/install/php-5.3.0RC4/ext/pdo_mysql/mysql_statement.c:52: error:
 structure has no member named `stmt'

Which MySQL client libraries are you using? Looks like 4.0 or older.

I'll check whether I can fix those, while MySQL 4.1 was released in 2004
and MySQL's active support for 4.0 ended 2006, which means it's rather
old software...

johannes


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



RE: [PHP] PHP Mail Function

2009-06-20 Thread David Swenson
Julian,

From my understanding of PHP's mail() function, it doesn't do anything
more than send to the address you specified.

On that note, I'd check things like:
Email address typos
The email your sending to your domain, is it already being forwarded?
If so, do you get the email at your gmail account?
If it's not being forwarded, add $additionalheaders to your script and
CC: your gmail account when sending to your domain.  See if it shows up
there.

Anyway those are somethings you could try as you have supplied no code
to check syntax and/or given any other testing you've tried.

Good Luck,
David


-Original Message-
From: Julian Muscat Doublesin [mailto:opensourc...@gmail.com] 
Sent: Saturday, June 20, 2009 1:59 PM
To: php-general@lists.php.net
Subject: [PHP] PHP Mail Function


Hello Everyone,

I have written an e-mail function that sends e-mail to my domain that
forwards it to a gmail account.

When I use the gmail address directly it works fine. When I use my mail
domain i don't get anything.

Has anyone experienced this? Can anyone give me some advice?

Thanks in advance

Julian
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.364 / Virus Database: 270.12.81/2189 - Release Date:
06/20/09 06:15:00



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



Re: [PHP] isset question

2009-06-20 Thread Paul M Foster
On Sat, Jun 20, 2009 at 12:20:56PM +0100, Ashley Sheridan wrote:

 On Sat, 2009-06-20 at 00:19 -0400, Paul M Foster wrote:
  On Fri, Jun 19, 2009 at 07:52:40PM +0100, Ashley Sheridan wrote:
 
   On Fri, 2009-06-19 at 12:36 +0100, Ford, Mike wrote:
On 18 June 2009 20:25, LAMP advised:
   
 using !empty() instead isset() will work if you don't care for PHP
 Notice: Undefined variable... If you want to avoid PHP Notice
 you have
 to use both:

 $msg.=  (isset($_POST['mort']) and !empty($_POST['mort'])) ? The
 mortgage amount is  $mort\n :  ;
   
Absolute rubbish -- as it says at http://php.net/empty, empty($var) is
the opposite of (boolean)$var, except that no warning is generated when
the variable is not set. -- so protecting empty() with an isset() is
a total waste of time, space and cpu cycles.
 
  snip
 
   
   To be honest, you're still opening yourself up to attack that way.
 
  Why and how?
 
  Paul
 
  --
  Paul M. Foster
 
 I've only done a little reading on this, but you're opening yourself up
 to a XSS attack. If someone posted 'script//malicious code
 here/script' to your PHP script, you'd essentially be printing that
 right back out onto your page.

I see. You're not talking about being vulnerable because of isset/empty,
but by echoing it back to the page. Yes, I agree there. You have to
sanitize it first.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Users Online?

2009-06-20 Thread Paul M Foster
On Sat, Jun 20, 2009 at 01:33:52PM -0700, Chris Payne wrote:

 Hi everyone,
 
 I have a login system that allows a user to login to my control panel,
 is there an easy way so that I can tell how many users / what users
 are logged into my system?  What would I need to do to add this with
 the minimum of hassle?  Would I just have to look at the sessions that
 are currently active and if so, how?  I really want to add this
 feature as it will help with creating a messaging system.

Doing this purely with sessions is impossible (well, nearly), since
sessions can't see each other. Your best bet is to add two fields to
your table(s)-- datetime logged in and datetime logged out. You'll need
to work out a way to expire someone's login if they appear to be logged
in too long (they closed their brower or left it open but forgot about
the tab for your site).

Upon login, you could perform a query of the table(s), looking for the
number of records where the logout field is empty.

Paul

-- 
Paul M. Foster

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



RE: [PHP] Users Online?

2009-06-20 Thread David Swenson
Chris,

If it were me (and let me warn you, there's probably 100 different ways
to do this), but If I was using a table to log them into a control
panel (CP) of sorts, I'm sure you have other DB querries to handle the
CP stuff it self, correct?  Well if your already taking the time to
create a DB connection on each page of that CP, why not just make a
field that updates an active status, and/or add this to Pauls
suggestion of logged in/out times, then every page they visit updates
that time to show they are still active.  Then do something like my bank
does and set a time limit on each page, that if another page on the site
isn't visited in so many seconds, you force them to log out. (you could
even throw something in that asks the user if they want to stay logged
in, cuz that'd be a nice feature)  :)

Not sure if this was what you were lookin for but just an idea.

Best of luck,
David

-Original Message-
From: oxygene...@gmail.com [mailto:oxygene...@gmail.com] On Behalf Of
Chris Payne
Sent: Saturday, June 20, 2009 2:34 PM
To: php-general@lists.php.net
Subject: [PHP] Users Online?


Hi everyone,

I have a login system that allows a user to login to my control panel,
is there an easy way so that I can tell how many users / what users are
logged into my system?  What would I need to do to add this with the
minimum of hassle?  Would I just have to look at the sessions that are
currently active and if so, how?  I really want to add this feature as
it will help with creating a messaging system.

It might be simple but if you've never done it before it's the hardest
thing in the world :-)

Thank you

Chris

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

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.364 / Virus Database: 270.12.81/2189 - Release Date:
06/20/09 06:15:00



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