From: <Nei...@rc...> - 2007-10-25 14:30:30
|
I am trying to put in a simple session tracker. I thought I had followed the instructions for overloading the session routines, but I'm getting nothing . . . Please suggest things to try, or point out what I haven't noticed! Here's how my files now begin: <?php session_start(); include_once('exe/includes/session_auth.php'); . . . and here's "session_auth.php": <?php // require_once('../../Connections/mysqlconnect.php'); // required in calling routines function sess_touch($sess_path, $sess_name) { $GLOBAL['sessid'] = session_id(); $now = time(); $sqlUPDATE = "UPDATE sesssions SET touch = " . $now . " WHERE sessid = '" . $GLOBAL['sessid'] . "'"; $sqlINSERT = "INSERT sessions (sessid, login, touch) VALUES ('" . $GLOBAL['sessid'] . "', " . $now . ", " . $now . ")"; if( (!mysql_query($sqlUPDATE)) & (!mysql_query($sqlINSERT)) ) { // fail } return 1; } function sess_close() { $now = time(); mysql_query("UPDATE sessions SET logout = $now WHERE sessid = '" . $GLOBAL['sessid'] . "'"); return 1; } function sess_write($sess_id, $data) { $now = time(); mysql_query("UPDATE sessions SET touch = $now WHERE sessid = '" . $GLOBAL['sessid'] . "'"); return 1; } function sess_destroy($sess_id) { $now = time(); mysql_query("UPDATE sessions SET logout = $now WHERE sessid = '" . $GLOBAL['sessid'] . "'"); return 1; } function sess_gc($sess_maxlifetime) { $now = time(); mysql_query("UPDATE sessions SET garbagecollection = $now WHERE touch + $sess_maxlifetime < $now"); return 1; } session_set_save_handler("sess_touch", // same for _open and _read "sess_close", "sess_touch", "sess_write", "sess_destroy", "sess_gc"); ?> Neil Rest -- Nei...@rc... http://users.rcn.com/neilrest/resume/ http://users.rcn.com/neilrest/resume/NeilRest.doc (Word format) |
From: ID D. <ga...@i-...> - 2007-10-25 15:41:05
|
Hello all, I have a project that I am currently quoting and would like to find someone interested in taking on the PHP portion. It should be a fairly simple project with basic database queries and a login. If you are interested in hearing more about the project, please give me a call or email me for the details. If you are interested, I will need to get a quote and timeline from you. I can be reached at ga...@i-... or 815/ 986-8090. Thank you for your time and consideration, Gale Armour ID Designs South Beloit, IL |
From: Kerry D. <ker...@ho...> - 2007-10-26 23:36:38
|
Neil, FWIW, in function sess_touch(), remove one 's' from "UPDATE sesssions" Also, in session_set_save_handler(), you've got function sess_touch listed twice. I'm not sure if that contributes to the problem. -----Original Message----- From: chi...@li... [mailto:chi...@li...] On Behalf Of Nei...@rc... Sent: Thursday, October 25, 2007 9:30 AM To: chi...@li... Subject: [chiPHPug-discuss] sessions I am trying to put in a simple session tracker. I thought I had followed the instructions for overloading the session routines, but I'm getting nothing . . . Please suggest things to try, or point out what I haven't noticed! Here's how my files now begin: <?php session_start(); include_once('exe/includes/session_auth.php'); . . . and here's "session_auth.php": <?php // require_once('../../Connections/mysqlconnect.php'); // required in calling routines function sess_touch($sess_path, $sess_name) { $GLOBAL['sessid'] = session_id(); $now = time(); $sqlUPDATE = "UPDATE sesssions SET touch = " . $now . " WHERE sessid = '" $GLOBAL['sessid'] . "'"; $sqlINSERT = "INSERT sessions (sessid, login, touch) VALUES ('" . $GLOBAL['sessid'] . "', " . $now . ", " . $now . ")"; if( (!mysql_query($sqlUPDATE)) & (!mysql_query($sqlINSERT)) ) { // fail } return 1; } function sess_close() { $now = time(); mysql_query("UPDATE sessions SET logout = $now WHERE sessid = '" . $GLOBAL['sessid'] . "'"); return 1; } function sess_write($sess_id, $data) { $now = time(); mysql_query("UPDATE sessions SET touch = $now WHERE sessid = '" . $GLOBAL['sessid'] . "'"); return 1; } function sess_destroy($sess_id) { $now = time(); mysql_query("UPDATE sessions SET logout = $now WHERE sessid = '" . $GLOBAL['sessid'] . "'"); return 1; } function sess_gc($sess_maxlifetime) { $now = time(); mysql_query("UPDATE sessions SET garbagecollection = $now WHERE touch + $sess_maxlifetime < $now"); return 1; } session_set_save_handler("sess_touch", // same for _open and _read "sess_close", "sess_touch", "sess_write", "sess_destroy", "sess_gc"); ?> Neil Rest -- Nei...@rc... http://users.rcn.com/neilrest/resume/ http://users.rcn.com/neilrest/resume/NeilRest.doc (Word format) ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ chiPHPug-discuss mailing list chi...@li... https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss |
From: Jason R. <ja...@ho...> - 2007-11-07 20:12:00
|
Hi Everyone! So its been a while since BARcamp Chicago 2007 and wanted to update everyone on a bunch of stuff.. OK, so first, Keith Schacht of ChicagoBeta/JobCoin/Facebook App fame had set up a free public job board for ChicagoBeta and BARcamp Chicago communities. There have been a few postings there (including a few from my company ;-) ) and wanted to let everyone know that its free to all and available. Check it out, post your jobs, etc.: http://barcampbeta.jobcoin.com/ Next up, we have some very cool events coming up this month. These are great places to meet other start-ups, smart people and, do as I do, get drunk off of free booze.. ;-) Thu Nov 8th 8:00am - Early Stage Marketplace: http://www.chicagolandchamber.org/sub/event_calendar_detail.asp?EVE_ID=930 Thu Nov 8th 5pm - Songza Launch Party (Aza and Humanized gang presented at BARcamp): http://www.songza.com/ Tue Nov 13th 6:15pm - MIT-EF Breakthrough Computer Interfaces (Aza again.. man he gets around ;-) ): http://www.mitefchicago.org/dojo/18/v.jsp?p=/home Thu Nov 15th 6:30pm - The great TECHcocktail 6! (bet you Aza will be there): http://www.techcocktail.com/blog/ Also, thanks to Henry Lee of Transwestern, we may have a very good venue for BARcamp next year. Connect with me or the BARcamp organizer list at LUNI to get involved! Lastly, I wanted to get feedback from all of you on something a lot of people asked for in the past. Should we have 2 BARcamps a year, spring and fall, rather than 1 in the summer? Email me back with a vote or thoughts. How many BARcamps per year? 1 or 2? Looking forward to seeing you all soon and hope this years been great for everyone! -jason |
From: derby <der...@gm...> - 2007-11-09 15:29:15
|
Does anyone have experience with PEAR? Why should anyone use PEAR? derby |
From: Jason R. <ja...@ho...> - 2007-11-09 16:57:40
|
PEAR fills a couple of roles for people. For some people it provides access to system libraries that may not be compiled in on the particular shared hosting environment that they happen to be using. Other people its application level libraries that they dont want to code themselves (I use a DNS pear module for this reason). Others its compatibility to legacy code (BLOWFISH encryption was once only available via PEAR). etc. etc. etc. It is nothing more than a library system, kinda like CPAN for Perl (although obviously not as mature). As a rule of thumb, if you dont understand something, either learn it well or dont use it. There is a lot of variation in code quality, compatibility and support in PEAR (just like CPAN). Wherever possible use the OS libraries that are compiled into PHP, and if you need something, get it compiled in. Hope that helps ;-) |
From: Richard L. <ce...@l-...> - 2007-11-15 17:00:25
|
On Fri, November 9, 2007 9:29 am, derby wrote: > Does anyone have experience with PEAR? Some. > Why should anyone use PEAR? Because the code is probably more robust than what you would write yourself, for the often-used modules of PEAR. And, if not, you can fix it and contribute back to the community instead of being a lone wolf :-) -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? |