phplib-users Mailing List for PHPLIB (Page 9)
Brought to you by:
nhruby,
richardarcher
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(106) |
Sep
(99) |
Oct
(44) |
Nov
(97) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(56) |
Feb
(81) |
Mar
(134) |
Apr
(69) |
May
(106) |
Jun
(122) |
Jul
(98) |
Aug
(52) |
Sep
(184) |
Oct
(219) |
Nov
(102) |
Dec
(106) |
2003 |
Jan
(88) |
Feb
(37) |
Mar
(46) |
Apr
(51) |
May
(30) |
Jun
(17) |
Jul
(45) |
Aug
(19) |
Sep
(5) |
Oct
(4) |
Nov
(12) |
Dec
(7) |
2004 |
Jan
(11) |
Feb
(7) |
Mar
|
Apr
(15) |
May
(17) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
(8) |
Oct
(6) |
Nov
(21) |
Dec
(13) |
2005 |
Jan
(4) |
Feb
(3) |
Mar
(7) |
Apr
(7) |
May
|
Jun
(11) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2006 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(5) |
2007 |
Jan
(15) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
(3) |
Jul
(1) |
Aug
(19) |
Sep
(2) |
Oct
|
Nov
|
Dec
(6) |
2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
From: <pau...@mo...> - 2004-06-22 15:29:31
|
Nathan/Marko Thanks for the replies. Marko The policy I included was copied from the article mentioned. AS such it may have just been an "example" the author had invented and not a real/valid policy. I have tried to create one at the site mentioned in the article but it refuses to e mail me the certificate it creates (probably because I don't have CPP :-)) Marko/Nathan I have tried to insert the header in a number of different ways: In prepend.php, in sessions4.inc, in the web page itself: header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"') In the template: <meta http-equiv="P3P" content='CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'> None of these seem to work. I still can't access the site, but as I said this may be because this is not a valid policy. Any thoughts/suggestions? I'll keep searching. Paul *********************************************************************** This email and any attachments transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender and do not store, copy or disclose the content to any other person. It is the responsibility of the recipient to ensure that opening this message and/or any of its attachments will not adversely affect its systems. No responsibility is accepted by the Company. *********************************************************************** |
From: marko <mk...@mc...> - 2004-06-22 11:00:27
|
Paul, did you test your servers with IE6 and phpmyadmin (in case you have mysql running)? IE6 and Firefox worked in my case without trouble, though they also use session cookies. Marko |
From: marko <mk...@mc...> - 2004-06-22 08:21:34
|
Hi Nathaniel and Paul, I tested your proposal and inserted the line header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); as my first statement in my script. BUT still it doesn't work! IE wouldn't handle the session. Marko |
From: Nathaniel P. <np...@te...> - 2004-06-21 16:48:53
|
On 6/21/2004 9:25 AM, pau...@mo... wrote : >Marko > >Many thanks for the reply. > >I have done some more digging and found that IE6 implements the P3P privacy policy: > >http://www.oreillynet.com/pub/wlg/1539 > >"MSIE 6 has an inaccurate definition of third party cookies. If your domain is hosted on one server and your PHP stuff is on another, the IE6 P3P implementation considers any cookies sent from the second machine "third party". Third party cookies will be blocked automatically in most privacy settings if not accompanied by what MS considers "an appropriate Compact Policy". > >This appears to break the cookies and so breaks the sessions. The page suggests adding a header immediately before the cookie, ie: > >header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); > >Does any one have any thoughts on where best to put this? Presumably in session4.inc? Or would it be better in the page itself? > > I was going to email and suggest you look into P3P, but it looks like you've already figured that out. :) Anyway, if you want sessions to work, you'll need to make sure that this header is sent before the cookie used for sessions is sent. session4.inc is probably the best place for this, but be aware that this issue affects all cookies sent to IE6, so if there are sections of your site that doesn't use PHPlib, make sure to use the header there. If you want to put the header into session4.inc, the best place for it would be in the function put_headers(), before the switch statement, or (if that doesn't work, for some reason), in the function start() before the call to set_tokenname(). This will guarantee that the header is sent whenever PHPlib sessions are used. Another possibility, if you want this to be applied sitewide, would be to create a simple PHP file with the header() function in it, and then use the auto_prepend_file configuration in php.ini or in the Apache configuration to always execute this code anytime a PHP file is proccessed. -- ___________________________ Nathaniel Price http://www.tesserportal.net Webmaster |
From: <pau...@mo...> - 2004-06-21 16:23:53
|
Marko Many thanks for the reply. I have done some more digging and found that IE6 implements the P3P privacy policy: http://www.oreillynet.com/pub/wlg/1539 "MSIE 6 has an inaccurate definition of third party cookies. If your domain is hosted on one server and your PHP stuff is on another, the IE6 P3P implementation considers any cookies sent from the second machine "third party". Third party cookies will be blocked automatically in most privacy settings if not accompanied by what MS considers "an appropriate Compact Policy". This appears to break the cookies and so breaks the sessions. The page suggests adding a header immediately before the cookie, ie: header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); Does any one have any thoughts on where best to put this? Presumably in session4.inc? Or would it be better in the page itself? Many thanks Paul *********************************************************************** This email and any attachments transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender and do not store, copy or disclose the content to any other person. It is the responsibility of the recipient to ensure that opening this message and/or any of its attachments will not adversely affect its systems. No responsibility is accepted by the Company. *********************************************************************** |
From: marko <mk...@mc...> - 2004-06-21 12:55:01
|
Hi Paul, > What is stranger is that the same clients can login into a test server > using a similiar setup with no problems, which indicates that although > the problem is IE6 SP1 based there is some setting on the server that > will fix the problem. did you compare the two versions of PHP running on your two servers? Perhaps there is also a dependency on the PHP version used!? Marko |
From: marko <mk...@mc...> - 2004-06-21 11:28:59
|
Hi Paul, please see my previous post to this list titled: "[Phplib-users] Problems with Authentication in Mozilla & Firefox" now I could add also IE6 SP1! I ran into the same problems with IE as you did. With Mozilla and Firefox I could circumvent the problem by simply copying the cookies.txt file containing already the necessary session cookie. It looks like phplib's implementation of cookie creation runs into a problem. phpmyadmin doesn't run into trouble, but phplib DOES! Unfortunately I haven't found a solution for this, because of a lack of time and the possible work-around with the copied cookies.txt file for FireFox, so that I don't need to care about IE. But in principle I am also very interested in this subject, because there are users who don't have anything else than IE on their desktops... Marko |
From: <pau...@mo...> - 2004-06-21 10:49:43
|
Dear All We are using phplib 7.4 with apache 1.3.27/php 4.3.1 to provide authentication and sessions (local4.inc and Challenge_Crypt_Auth) Everything worked ok until we started upgrading client machines to IE 6 SP1. Those clients running this version can no longer login. THey are just returned to the login prompt with the "Either user name or password is invalid" message. We have found a few references to changes in IE 6 causing problems but none of the suggested changes (alter privacy zones in IE 6 etc) to fix it seem to work. It appears that the problem is not with phplib but with php sessions and cookies management What is stranger is that the same clients can login into a test server using a similiar setup with no problems, which indicates that although the problem is IE6 SP1 based there is some setting on the server that will fix the problem. I apologize for being so vague but I can't figure out what the exact problem is. Has anyone either come across this and fixed it or alternatively know where I might start looking? Many thanks Paul *********************************************************************** This email and any attachments transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender and do not store, copy or disclose the content to any other person. It is the responsibility of the recipient to ensure that opening this message and/or any of its attachments will not adversely affect its systems. No responsibility is accepted by the Company. *********************************************************************** |
From: Frank B. <fb...@sy...> - 2004-05-27 16:57:05
|
I think the error with Unix domain socket is because apache is running chroot /var/www - a change in default installation sometime between OpenBSD 2.9 and 3.5 - could this also be causing the problem with tcpip socket? I have found that $host="127.0.0.1" works, but $host='localhost" still does not. At 08:56 PM 5/24/04, Frank Bax wrote: >With $Host="" the error message changes to: > >PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could >not connect to server: No such file or directory > Is the server running locally and accepting > connections on Unix domain socket "/tmp/.s.PGSQL.5432"? > in /php/class/phplib-7.4/db_pgsql.inc on line 51 > >I had '-i' in startup script, but I even tried removing that in favour of > tcpip_socket = true >in /var/pgsql/data/postgresql.conf >But that didn't change anything. Is there another way to confirm this >functionality is indeed configured correcly? When I start command-line >interface with: > psql -h /tmp >It works fine - 'man psql' seems to indicate this confirms unix domain >socket is working? These also work: > psql -h localhost > psql -h 127.0.0.1 > >Frank > > >At 04:29 PM 5/24/04, Clark Freifeld wrote: >>I think this may be because PHP is attempting to connect to Postgres via >>an IP socket (even though they are on the same host) and Postgres is only >>accepting Unix socket connections, or vice-versa. In your local4.inc, try >>putting >> >>var $Host = ""; >> >>instead of "localhost" in the connection config for your database class >>and see if that works. I use Postgres and that's what I do and it works >>for me. >> >>I remember reading something about this in the Postgres docs but I don't >>recall exactly how it works. I think if you configure Postgres to accept >>IP connections, putting "localhost" for your $Host will work. >> >>Hope that helps. >> >>Clark >> >>On Sun, 23 May 2004, Frank Bax wrote: >> >> > I am currently running phplib 7.4 on OpenBSD 2.9 / PHP 4.0.4pl1 / >> pgsql 7.1 >> > I have created a new system on OpenBSD 3.5 / PHP 4.3.5RC3 / pgsql 7.3.5 >> > I start pgsql with: >> > su -l _pgsql -c "/usr/local/bin/pg_ctl start \ >> > -D /var/pgsql/data -l /var/pgsql/logfile.`date >> +\%Y\%m\%d` \ >> > -o '-i -B 512 -D /var/pgsql/data'" >> > I copied an existing database and php application to the new box for >> > testing, but when I try to access the application webpage, I get the >> > following message in apache error log: >> > PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: >> unknown >> > host name: localhost in /php/class/phplib-7.4/db_pgsql.inc on line 51 >> > >> > I'm not sure what step I might have missed during setup of the new system. |
From: Frank B. <fb...@sy...> - 2004-05-25 01:03:31
|
With $Host="" the error message changes to: PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? in /php/class/phplib-7.4/db_pgsql.inc on line 51 I had '-i' in startup script, but I even tried removing that in favour of tcpip_socket = true in /var/pgsql/data/postgresql.conf But that didn't change anything. Is there another way to confirm this functionality is indeed configured correcly? When I start command-line interface with: psql -h /tmp It works fine - 'man psql' seems to indicate this confirms unix domain socket is working? These also work: psql -h localhost psql -h 127.0.0.1 Frank At 04:29 PM 5/24/04, Clark Freifeld wrote: >I think this may be because PHP is attempting to connect to Postgres via >an IP socket (even though they are on the same host) and Postgres is only >accepting Unix socket connections, or vice-versa. In your local4.inc, try >putting > >var $Host = ""; > >instead of "localhost" in the connection config for your database class >and see if that works. I use Postgres and that's what I do and it works >for me. > >I remember reading something about this in the Postgres docs but I don't >recall exactly how it works. I think if you configure Postgres to accept >IP connections, putting "localhost" for your $Host will work. > >Hope that helps. > >Clark > >On Sun, 23 May 2004, Frank Bax wrote: > > > I am currently running phplib 7.4 on OpenBSD 2.9 / PHP 4.0.4pl1 / pgsql 7.1 > > I have created a new system on OpenBSD 3.5 / PHP 4.3.5RC3 / pgsql 7.3.5 > > I start pgsql with: > > su -l _pgsql -c "/usr/local/bin/pg_ctl start \ > > -D /var/pgsql/data -l /var/pgsql/logfile.`date > +\%Y\%m\%d` \ > > -o '-i -B 512 -D /var/pgsql/data'" > > I copied an existing database and php application to the new box for > > testing, but when I try to access the application webpage, I get the > > following message in apache error log: > > PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: unknown > > host name: localhost in /php/class/phplib-7.4/db_pgsql.inc on line 51 > > > > I'm not sure what step I might have missed during setup of the new system. > > > > Frank |
From: Clark F. <cl...@th...> - 2004-05-24 20:20:22
|
Frank, I think this may be because PHP is attempting to connect to Postgres via an IP socket (even though they are on the same host) and Postgres is only accepting Unix socket connections, or vice-versa. In your local4.inc, try putting var $Host = ""; instead of "localhost" in the connection config for your database class and see if that works. I use Postgres and that's what I do and it works for me. I remember reading something about this in the Postgres docs but I don't recall exactly how it works. I think if you configure Postgres to accept IP connections, putting "localhost" for your $Host will work. Hope that helps. Clark On Sun, 23 May 2004, Frank Bax wrote: > I am currently running phplib 7.4 on OpenBSD 2.9 / PHP 4.0.4pl1 / pgsql 7.1 > I have created a new system on OpenBSD 3.5 / PHP 4.3.5RC3 / pgsql 7.3.5 > I start pgsql with: > su -l _pgsql -c "/usr/local/bin/pg_ctl start \ > -D /var/pgsql/data -l /var/pgsql/logfile.`date +\%Y\%m\%d` \ > -o '-i -B 512 -D /var/pgsql/data'" > I copied an existing database and php application to the new box for > testing, but when I try to access the application webpage, I get the > following message in apache error log: > PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: unknown > host name: localhost in /php/class/phplib-7.4/db_pgsql.inc on line 51 > > I'm not sure what step I might have missed during setup of the new system. > > Frank |
From: Frank B. <fb...@sy...> - 2004-05-23 20:24:32
|
I am currently running phplib 7.4 on OpenBSD 2.9 / PHP 4.0.4pl1 / pgsql 7.1 I have created a new system on OpenBSD 3.5 / PHP 4.3.5RC3 / pgsql 7.3.5 I start pgsql with: su -l _pgsql -c "/usr/local/bin/pg_ctl start \ -D /var/pgsql/data -l /var/pgsql/logfile.`date +\%Y\%m\%d` \ -o '-i -B 512 -D /var/pgsql/data'" I copied an existing database and php application to the new box for testing, but when I try to access the application webpage, I get the following message in apache error log: PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: unknown host name: localhost in /php/class/phplib-7.4/db_pgsql.inc on line 51 I'm not sure what step I might have missed during setup of the new system. Frank |
From: marko <mk...@mc...> - 2004-05-13 12:26:33
|
Hi Clark, > I use Firefox 0.8 (on Red Hat Linux) and I've never had a problem with > cookie-based sessions in PHPLIB. My Firefox is on Windows 2k and the app is on SuSE 8.2 linux. > What if you first accept a cookie from another site (so that cookies.txt > and cookperm.txt will be created) and then go to your PHPLib site? cookperm.txt turned out to be not necessary, but cookies.txt is! I tried that with phpmyadmin. That worked, as I mentioned before. Afterwards I surfed to my app: and the same: it did not... still helpless.... The browser doesn't even ask me (though I set this as default behaviour) whether he should really set the cookie! Simply ignores the cookie request... Regards, Marko |
From: marko <mk...@mc...> - 2004-05-13 12:24:32
|
Hi Matt, > have you checked that cookies are enabled in the browser? yes, I asked the browser to ask whether I want to allow cookies. In fact it doesn't ask. Somehow phplib doesn't issue the cookie... > are set for a particular page. Is the session ID trying to be passed in the > url or just not there at all? ID doesn't appear in url on purpose! I wanted to have only cookies allowed. > I'm using firefox 0.8 and have never noticed any problems using session4 > and session4_custom. Hmmm... I verified that the entry in cookies.txt is sufficient. If this line gets deleted from the file the cookie wouldn't be saved anymore. the cookperm.txt is not necessary. I am a little helpless... Strange behaviour. I am using the windows version of the browser. The app itself is hosted on a linux server. Regards, Marko |
From: Andrew C. <ph...@ev...> - 2004-05-10 19:59:48
|
Nathaniel, I agree with your assessment. I was hesitant to post but, thought I would, just in case it was something well-known to which I was not privy ... and it did garner insight into a better approach for nested templates from Layne Weathers. The users with the problem are all on broadband but, with different providers in different parts of the country. I'm not sure what code I could post that would be relevant. The page does use PHPlib Authentication but, that seems to be working fine, for the most part (there are periodic complaints from users about being dumped back to the login screen but, I think it is typical for users to not understand about system time-outs, not using their back button after logging out to try to do something else, etc.) The users all have AOL software installed but, are not using them for dial-up service or using the AOL browser to access the application. Your comment about caching a static version of the page made me think of something: I am going to have one of the troubled users try loading a static version of the page to see if that makes a difference. If that loads, maybe the problem has something to do with the timing of how the data is being sent. Anyway, thanks for the response. Andrew Crawford ph...@ev... At 09:26 AM 5/10/2004 -0700, Nathaniel Price wrote: >On 5/7/2004 10:26 PM, Andrew Crawford wrote : >[snip] > >>However, now, around 10-15% of the users cannot load that view. When >>they try, they get a blank page (view source shows >>"<html><body></body></html>"). >> >>The system also has a search feature that uses the same script and >>outputs the same view but, with returned records limited by the search >>parameters - generally, 10-40 records instead of the full list of >>~600. The users who cannot see the full view CAN do a search and see the >>results set. >> >>It doesn't seem to be browser-specific. I have tested on more than a >>dozen different browsers on three platforms here and cannot reproduce the >>error. I have been able to verify the problem on a couple specific >>users' systems using remote-control software and confirmed that they have >>the same issue in IE and Netscape Navigator. It sounds like it will be >>cost-prohibitive to do any major re-installations, re-configurations, or >>system swaps on the user end to try to determine whether the problem is >>specific to the configurations of those machines or to their service providers. >> >>The users like the full list view for a number of tasks and aren't really >>gung-ho to have me break the results table up into multiple pages (which >>seems like the surest, quickest fix). However, I am hard-pressed to >>explain why more than 1/10th of the users are unable to load the page >>with the new display code. >> >>Has anyone run into anything like this? Any guesses about what is >>happening or how to stop it from happening? > >I can't be sure without more details about what your setup is, but I don't >think it's a problem with PHPlib. If I were to hazard a guess, it sounds >like there might be some sort of transparent proxy between you and your >clients that might be causing problems. > >Again, I can't offer much more specific help than that. If you'd like to >send some example code or something (Do you use PHPlib authentication on >this page?), or describe in more detail how the users connect to the >server (i.e. from a local network? from the internet? dial-up? broadband? >Major service provider, like AOL?), then perhaps we could help you more. >Otherwise, your best bet would probably be to either break up the table >into multiple pages, or maybe try cacheing the results into a static html >file every so often and having the users load up that instead. > >-- >___________________________ >Nathaniel Price >http://www.tesserportal.net >Webmaster |
From: Andrew C. <ph...@ev...> - 2004-05-10 19:59:48
|
Ah! That makes sense. It sounds like a much better approach to using nested templates. I was really disappointed when this popped up. I have been striving to keep my code, content (in a database), and formatting (in templates and CSS) completely separate. I'm not sure if this will have any impact on the immediate problem but, it does address a larger concern. Thank you, Andrew Crawford At 12:56 AM 5/8/2004 -0500, Layne Weathers wrote: >Quoth Andrew Crawford: > > > The table is complicated enough that the users need the column headers > > reproduced every 5 or 10 records to make it usable. Originally, I was > > generating this view entirely using nested templates. The view took way > > too long to load - over 80 seconds - and monopolized the server's CPU for > > the entire time. Several users even had timeout problems waiting for the > > page to load. Benchmarking revealed almost all of that time was spent in > > the section that output the column headers every few records. > > >Whenever I use nested templates, I hand the nested part off to a clean >template object, build the full list, and hand the parsed content back to >the primary template object. I often do this several times in one page. > >The problem is that when you use your global template object, the regular >expression tries to replace all known variables on each parse(). The fewer >variables used in your nested block, the greater the speed gain of this >method. > >It might be worth a try. > > >I've added a shortcut function to my Template extension class that I call >before each nested block to start with a clean loop template object: > function unset_vars() > { > $this->varkeys = $this->varvals = array(); > } > >Here is a simple sample building the options in a select: > > $loop_tpl->unset_vars(); > $loop_tpl->set_var("option", "\n <option >value=\"{value}\"{selected}>{text}</option>"); > > foreach($options as $text => $value) > { > $loop_tpl->set_var(array( > "value" => $value, > "text" => $text, > "selected" => ((is_array($some_var) and ($value == $some_var)) ? >" selected" : ""))); > $loop_tpl->parse("options", "option", true); > } > $tpl->set_var("options", $loop_tpl->get_var("options")); > >Layne Weathers |
From: Nathaniel P. <np...@te...> - 2004-05-10 16:25:25
|
On 5/7/2004 10:26 PM, Andrew Crawford wrote : [snip] > However, now, around 10-15% of the users cannot load that view. When > they try, they get a blank page (view source shows > "<html><body></body></html>"). > > The system also has a search feature that uses the same script and > outputs the same view but, with returned records limited by the search > parameters - generally, 10-40 records instead of the full list of > ~600. The users who cannot see the full view CAN do a search and see > the results set. > > It doesn't seem to be browser-specific. I have tested on more than a > dozen different browsers on three platforms here and cannot reproduce > the error. I have been able to verify the problem on a couple > specific users' systems using remote-control software and confirmed > that they have the same issue in IE and Netscape Navigator. It sounds > like it will be cost-prohibitive to do any major re-installations, > re-configurations, or system swaps on the user end to try to determine > whether the problem is specific to the configurations of those > machines or to their service providers. > > The users like the full list view for a number of tasks and aren't > really gung-ho to have me break the results table up into multiple > pages (which seems like the surest, quickest fix). However, I am > hard-pressed to explain why more than 1/10th of the users are unable > to load the page with the new display code. > > Has anyone run into anything like this? Any guesses about what is > happening or how to stop it from happening? I can't be sure without more details about what your setup is, but I don't think it's a problem with PHPlib. If I were to hazard a guess, it sounds like there might be some sort of transparent proxy between you and your clients that might be causing problems. Again, I can't offer much more specific help than that. If you'd like to send some example code or something (Do you use PHPlib authentication on this page?), or describe in more detail how the users connect to the server (i.e. from a local network? from the internet? dial-up? broadband? Major service provider, like AOL?), then perhaps we could help you more. Otherwise, your best bet would probably be to either break up the table into multiple pages, or maybe try cacheing the results into a static html file every so often and having the users load up that instead. -- ___________________________ Nathaniel Price http://www.tesserportal.net Webmaster |
From: Layne W. <la...@dr...> - 2004-05-08 05:56:44
|
Quoth Andrew Crawford: > The table is complicated enough that the users need the column headers=20 > reproduced every 5 or 10 records to make it usable. Originally, I was=20 > generating this view entirely using nested templates. The view took way= =20 > too long to load - over 80 seconds - and monopolized the server's CPU for= =20 > the entire time. Several users even had timeout problems waiting for the= =20 > page to load. Benchmarking revealed almost all of that time was spent in= =20 > the section that output the column headers every few records. Whenever I use nested templates, I hand the nested part off to a clean template object, build the full list, and hand the parsed content back to the primary template object. I often do this several times in one page. The problem is that when you use your global template object, the regular expression tries to replace all known variables on each parse(). The fewer variables used in your nested block, the greater the speed gain of this method. It might be worth a try. I've added a shortcut function to my Template extension class that I call before each nested block to start with a clean loop template object: function unset_vars() { $this->varkeys =3D $this->varvals =3D array(); } Here is a simple sample building the options in a select: $loop_tpl->unset_vars(); $loop_tpl->set_var("option", "\n <option value=3D\"{value}\"{selected}>{text}</option>"); =20 foreach($options as $text =3D> $value) { $loop_tpl->set_var(array( "value" =3D> $value, "text" =3D> $text, "selected" =3D> ((is_array($some_var) and ($value =3D=3D $some_= var)) ? " selected" : ""))); $loop_tpl->parse("options", "option", true); } $tpl->set_var("options", $loop_tpl->get_var("options")); Layne Weathers |
From: Andrew C. <ph...@ev...> - 2004-05-08 05:29:36
|
Greetings All, I am having a strange problem with a phplib-based database application. It uses phplib for database abstraction, authentication, and templating. The system generates a summary table view of the database, currently about 600 records and there are about 100 users, located all over the country, all on different broadband providers, with maybe 20 or so on at any given time. The table is complicated enough that the users need the column headers reproduced every 5 or 10 records to make it usable. Originally, I was generating this view entirely using nested templates. The view took way too long to load - over 80 seconds - and monopolized the server's CPU for the entire time. Several users even had timeout problems waiting for the page to load. Benchmarking revealed almost all of that time was spent in the section that output the column headers every few records. So, I re-wrote the table display routine without templates and got the load time down for that view to about 10 seconds - MUCH better. The HTML sent to the users' browsers is identical to when I was using phplib templates (compared with diff). It is long (6000+ lines) but, it validates as 100% standards-compliant HTML 4.01 with HTML Tidy. However, now, around 10-15% of the users cannot load that view. When they try, they get a blank page (view source shows "<html><body></body></html>"). The system also has a search feature that uses the same script and outputs the same view but, with returned records limited by the search parameters - generally, 10-40 records instead of the full list of ~600. The users who cannot see the full view CAN do a search and see the results set. It doesn't seem to be browser-specific. I have tested on more than a dozen different browsers on three platforms here and cannot reproduce the error. I have been able to verify the problem on a couple specific users' systems using remote-control software and confirmed that they have the same issue in IE and Netscape Navigator. It sounds like it will be cost-prohibitive to do any major re-installations, re-configurations, or system swaps on the user end to try to determine whether the problem is specific to the configurations of those machines or to their service providers. The users like the full list view for a number of tasks and aren't really gung-ho to have me break the results table up into multiple pages (which seems like the surest, quickest fix). However, I am hard-pressed to explain why more than 1/10th of the users are unable to load the page with the new display code. Has anyone run into anything like this? Any guesses about what is happening or how to stop it from happening? Andrew Crawford ph...@ev... |
From: Clark F. <cl...@th...> - 2004-05-07 15:37:32
|
I use Firefox 0.8 (on Red Hat Linux) and I've never had a problem with cookie-based sessions in PHPLIB. What if you first accept a cookie from another site (so that cookies.txt and cookperm.txt will be created) and then go to your PHPLib site? Clark On Fri, 7 May 2004, marko wrote: > Hi, > > since Mozilla 1.6 and also in Firefox 0.8 I cannot authenticate anymore > (at least not without problems). > > I am using session4.inc, which requires cookies. For some reason the > cookies won't be set properly by phplib. > > phpmyadmin e.g. works fine, but phplib doesn't... > > The funny thing is: if I copy the files cookies.txt and cookperm.txt from > the old Mozilla 1.5 into 1.6 (works also for Firefox), which don't exist > right after freshly installing the program or creating a new user profile, > everything works fine again! > > I use the latest snapshot from sourceforge. > > Did somebody meet the same behaviour? And does know the reason why? > > Marko |
From: marko <mk...@mc...> - 2004-05-07 09:19:01
|
Hi, since Mozilla 1.6 and also in Firefox 0.8 I cannot authenticate anymore (at least not without problems). I am using session4.inc, which requires cookies. For some reason the cookies won't be set properly by phplib. phpmyadmin e.g. works fine, but phplib doesn't... The funny thing is: if I copy the files cookies.txt and cookperm.txt from the old Mozilla 1.5 into 1.6 (works also for Firefox), which don't exist right after freshly installing the program or creating a new user profile, everything works fine again! I use the latest snapshot from sourceforge. Did somebody meet the same behaviour? And does know the reason why? Marko |
From: <fmo...@fm...> - 2004-05-05 17:26:58
|
The exact syntax is: <?php page_close() ?> assuming you're in an html context up to that point. Forgetting to put this in has bitten me in the butt before. Another source of the same problem would be a routine or condition in your PHP code which would cause an exit() from the page without execution reaching the page_close() call at the bottom of the page. If you have any program flow control in your code which would bypass this call, you'll need to make sure that page_close() is called somewhere else. Thus spake patrick on Wed, May 05, 2004 at 09:09:01AM CDT > Make sure you do > page_close > at the end of your page > > Norbert Felde wrote: > > Hello, > > > > My program lose session variable. > > > > I register a variable with $sess->register and it works fine. > > I can read its value with $_SESSION, and even the $sess->is_registered > > returns with true. > > I can read the value of this session variable just before page_close and > > after page_close. There is nothing else after page_close, I only print > > this value. > > > > If I refresh the page, my session variable is not set. I tried to print > > out its value just after session_start is called in function > > $sess->start in session4.inc but nothing. > > > > Register_globals is off in php.ini. > > I use the following versions: > > win xp > > apache: 2.0.49 > > php: 4.3.6 > > phplib 7.4 > > > > > > I have no idea what should I do to find the problem. > > > > I hope you could understend my problem and my english. > > > > Thanks, > > Norbert > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: Oracle 10g > > Get certified on the hottest thing ever to hit the market... Oracle 10g. > > Take an Oracle 10g class now, and we'll give you the exam FREE. > > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > > _______________________________________________ > > Phplib-users mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phplib-users > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users -- Lindsay Haisley | "Everything works | PGP public key FMP Computer Services | if you let it" | available at 512-259-1190 | (The Roadie) | <http://www.fmp.com/pubkeys> http://www.fmp.com | | |
From: Clark F. <cl...@th...> - 2004-05-05 15:54:19
|
Norbert, It sounds like you are doing a page_close(), so I'm guessing that's not the problem. Also, I'm not positive but I believe page_close() is not even necessary when using PHP4 native sessions, because PHP will automatically write the session at the end of output. Can you send along a code snippet (all the way from page_open to page_close) illustrating how you want to use your session variable and how it's not working? Also, make sure you are including local4.inc and session4.inc in your prepend.php, and using local4.inc to define your derived session class. Are you using sessions only, or are you using auth, perm or user as well? Are you using cookie or get mode for the session? If you are using cookies, you might check your browser files to see if the cookie is being set. Best, Clark On Wed, 5 May 2004, Norbert Felde wrote: > Hello, > > My program lose session variable. > > I register a variable with $sess->register and it works fine. > I can read its value with $_SESSION, and even the $sess->is_registered > returns with true. > I can read the value of this session variable just before page_close and > after page_close. There is nothing else after page_close, I only print > this value. > > If I refresh the page, my session variable is not set. I tried to print > out its value just after session_start is called in function > $sess->start in session4.inc but nothing. > > Register_globals is off in php.ini. > I use the following versions: > win xp > apache: > 2.0.49 > php: > 4.3.6 > phplib > 7.4 > > > I have no idea what should I do to find the problem. > > I hope you could understend my problem and my english. > > Thanks, > Norbert |
From: patrick <pm...@sa...> - 2004-05-05 14:09:10
|
Make sure you do page_close at the end of your page Norbert Felde wrote: > Hello, > > My program lose session variable. > > I register a variable with $sess->register and it works fine. > I can read its value with $_SESSION, and even the $sess->is_registered > returns with true. > I can read the value of this session variable just before page_close and > after page_close. There is nothing else after page_close, I only print > this value. > > If I refresh the page, my session variable is not set. I tried to print > out its value just after session_start is called in function > $sess->start in session4.inc but nothing. > > Register_globals is off in php.ini. > I use the following versions: > win xp > apache: 2.0.49 > php: 4.3.6 > phplib 7.4 > > > I have no idea what should I do to find the problem. > > I hope you could understend my problem and my english. > > Thanks, > Norbert > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > |
From: Norbert F. <fe...@hu...> - 2004-05-05 08:20:07
|
Hello, My program lose session variable. I register a variable with $sess->register and it works fine. I can read its value with $_SESSION, and even the $sess->is_registered returns with true. I can read the value of this session variable just before page_close and after page_close. There is nothing else after page_close, I only print this value. If I refresh the page, my session variable is not set. I tried to print out its value just after session_start is called in function $sess->start in session4.inc but nothing. Register_globals is off in php.ini. I use the following versions: win xp apache: 2.0.49 php: 4.3.6 phplib 7.4 I have no idea what should I do to find the problem. I hope you could understend my problem and my english. Thanks, Norbert |