php-general Digest 14 Jan 2001 02:22:50 -0000 Issue 453 Topics (messages 34360 through 34435): load balancing with php/apache? 34360 by: Erick Papadakis 34374 by: Tim Zickus 34376 by: Rasmus Lerdorf 34377 by: Joe Stump 34378 by: Rasmus Lerdorf 34380 by: Cal Evans 34386 by: Michael Kimsal 34387 by: Rasmus Lerdorf 34398 by: jeremy brand 34400 by: jeremy brand 34403 by: Cal Evans 34404 by: Michael Stearne 34405 by: Joe Stump 34406 by: Joe Stump 34408 by: jeremy brand 34409 by: jeremy brand Guru Needed - the parser is corrupting my html!! 34361 by: Jamie Burns 34362 by: Cynic 34363 by: Sterling Hughes 34364 by: Jamie Burns 34365 by: Cynic TRY AGAIN mysql php4.04 and safe_mode 34366 by: andreas \(.work\) 34379 by: andreas \(.work\) Re: Lost connection to MySQL server during query 34367 by: Michael Govorun 34369 by: Jason Brooke How to make a line and bar graph 34368 by: SED 34389 by: Philip Hallstrom Frontpage Discussion Group/PHP Replacement 34370 by: Cybercandy Ltd 34422 by: Richard Lynch Wondering whats wrong? 34371 by: K.Simon 34373 by: Toby Butzon 34375 by: Sterling Hughes [notice] child pid 666 exit signal Segmentation fault (11) 34372 by: Johan Björk Calendar holidays 34381 by: bill 34423 by: Richard Lynch graphic problem... 34382 by: Georg Buschbeck 34383 by: Johan Holst Nielsen 34392 by: Matt McClanahan Re: Simple form not passing variables, Why?? 34384 by: Christian Reiniger 34388 by: Philip Olson Re: Send Authorization: base64 Header 34385 by: Hrishi cookie stopped working??? 34390 by: Don Howland 34424 by: Richard Lynch Re: Refreshing Window 34391 by: Matt McClanahan Use <?= instead of <%= 34393 by: Arcady Genkin 34394 by: mOrP 34396 by: Arcady Genkin 34397 by: Toby Butzon 34399 by: Alexander Wagner 34401 by: Philip Olson Apache Problem 34395 by: Chris 34415 by: Chris Hayes Re: [PHP-DEV] comments in php 34402 by: Toby Butzon cookies 34407 by: Steve Lawson Re: mixing HTML and PHP code 34410 by: Michael Govorun 34413 by: Iván Sánchez Ortega \"MR\" 34414 by: Iván Sánchez Ortega \"MR\" User/Group for PHP 34411 by: Steve Lawson 34425 by: Richard Lynch Re: mysql php4.04 and safe_mode 34412 by: nospam Send browser a 404 not found header? 34416 by: Jamie Burns 34429 by: Jamie Burns problem using flock() 34417 by: 10,000 Screaming Monkeys 34426 by: jeremy brand Re: Templates 34418 by: Michael Kimsal 34427 by: andrew 34430 by: Michael Kimsal 34431 by: andrew 34433 by: Michael Kimsal 34434 by: andrew Re: ereg works in .php, not in .inc 34419 by: Richard Lynch Re: Problem building php 3.0.18 34420 by: Richard Lynch Re: Put data in a odbc connect 34421 by: Richard Lynch problem building php_gd.dll 34428 by: Cynic RTFM me to IIF file format creation... 34432 by: Dallas Kropka rewriting the browser's url 34435 by: Jared Howard Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
hello people this might be a very silly question, but folks in my company have now started asking some enterprise questions like "sure, we'll do php but how about load balancing?" i have a feeling that this can be achieved with some caching on apache? how can i achieve this? thanks/erick __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
We use Cisco LocalDirector to do load balancing in our web cluster. It's very configurable and has worked very well (so far!). - Tim > this might be a very silly question, but folks in my > company have now started asking some enterprise > questions like "sure, we'll do php but how about load > balancing?" i have a feeling that this can be achieved > with some caching on apache? how can i achieve this?
> this might be a very silly question, but folks in my > company have now started asking some enterprise > questions like "sure, we'll do php but how about load > balancing?" i have a feeling that this can be achieved > with some caching on apache? how can i achieve this? Surely they don't expect a scripting language to be doing load balancing for them? There are dozens if not hundreds of ways to load balance your web server. Read some of these: http://www.dmoz.org/Computers/Software/Internet/Site_Management/Load_Balancing/ http://www.linuxvirtualserver.org/ http://linas.org/linux/load.html -Rasmus
> http://www.linuxvirtualserver.org/ We use LVS on our website - it works great! We have 2 load balancers with the HA package and 6 PHP webservers running behind it (with a central DB server). In short, it's possible and works quite well. BTW We user FreeBSD for webservers if that's any help (though linux, NT, solaris, etc would all work) --Joe > http://linas.org/linux/load.html > > -Rasmus > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
> > http://www.linuxvirtualserver.org/ > > We use LVS on our website - it works great! We have 2 load balancers with the > HA package and 6 PHP webservers running behind it (with a central DB server). Yes, I have heard very good things about LVS. Haven't had a chance to set it up myself yet. Definitely something for the TODO list. -Rasmus
How does it deal with sessions? Or do use store sessions in the database? Cal -----Original Message----- From: Joe Stump [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 13, 2001 11:22 AM To: Rasmus Lerdorf Cc: [EMAIL PROTECTED] Subject: Re: [PHP] load balancing with php/apache? > http://www.linuxvirtualserver.org/ We use LVS on our website - it works great! We have 2 load balancers with the HA package and 6 PHP webservers running behind it (with a central DB server). In short, it's possible and works quite well. BTW We user FreeBSD for webservers if that's any help (though linux, NT, solaris, etc would all work) --Joe > http://linas.org/linux/load.html > > -Rasmus > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
We've used local director in the past, as well as the 'f5' product (big IP? - I forgot the company name). Maybe it's 'big ip' from f5. Shows you how much we think about it - it just does it's job. As others pointed out, you can go with a software version under Linux, and I think W2k enterprise has some type of load balancer available for it too. All a load balancer will do is route requests to different web servers - what the web servers do with the requests (run ASP, PHP, Perl, CF, etc.) is entirely irrelevant to the load balancing situation. The 'enterprise' issue with respect to PHP is a bit of a red herring, IMO. VBScript doesn't do load balancing, and that never stopped anyone from deploying ASP pages... Good luck. :) Erick Papadakis wrote: > hello people > > this might be a very silly question, but folks in my > company have now started asking some enterprise > questions like "sure, we'll do php but how about load > balancing?" i have a feeling that this can be achieved > with some caching on apache? how can i achieve this? > > thanks/erick > >
The session id is not an issue, but yes, obviously you will need to store the session data itself somewhere where all the machines can get at it. So either on a common NFS share, ldap or some sort of database. PHP's session handling allows you to write your own backend session datastore functions using session_set_save_handler() http://php.net/manual/en/function.session-set-save-handler.php -Rasmus On Sat, 13 Jan 2001, Cal Evans wrote: > How does it deal with sessions? Or do use store sessions in the database? > > Cal > > -----Original Message----- > From: Joe Stump [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 13, 2001 11:22 AM > To: Rasmus Lerdorf > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] load balancing with php/apache? > > > > http://www.linuxvirtualserver.org/ > > We use LVS on our website - it works great! We have 2 load balancers with > the > HA package and 6 PHP webservers running behind it (with a central DB > server). > > In short, it's possible and works quite well. BTW We user FreeBSD for > webservers > if that's any help (though linux, NT, solaris, etc would all work) > > --Joe > > > > > > http://linas.org/linux/load.html > > > > -Rasmus > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > > Joe Stump, PHP Hacker > [EMAIL PROTECTED] > http://www.miester.org/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
> > We use LVS on our website - it works great! We have 2 load balancers with the > > HA package and 6 PHP webservers running behind it (with a central DB server). > > Yes, I have heard very good things about LVS. Haven't had a chance to set > it up myself yet. Definitely something for the TODO list. LVS with linux-ha is a win-win situation. Even if you loose a LVS, the failover is transparent. The connections hang for about 5-15 seconds, then transfer over to the other machine. With the traffic that we have, we opted to use direct routing, this way there is no translation (thus no additional CPU on the LVS machine) needed for the answers; the web servers talk directly back to the client themselves. We were planning on using Local Directors, then cost became a major issue. I'm actually glad we did it this way, because personally I like envesting my knowledge in open solutions rather than learning proprietary OSs and strategies. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com
We have a centralized DB server. Sessions are handled by us, the programmers, not the cluster. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Sat, 13 Jan 2001, Cal Evans wrote: > Date: Sat, 13 Jan 2001 11:51:01 -0600 > From: Cal Evans <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: RE: [PHP] load balancing with php/apache? > > How does it deal with sessions? Or do use store sessions in the database? > > Cal > > -----Original Message----- > From: Joe Stump [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 13, 2001 11:22 AM > To: Rasmus Lerdorf > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] load balancing with php/apache? > > > > http://www.linuxvirtualserver.org/ > > We use LVS on our website - it works great! We have 2 load balancers with > the > HA package and 6 PHP webservers running behind it (with a central DB > server). > > In short, it's possible and works quite well. BTW We user FreeBSD for > webservers > if that's any help (though linux, NT, solaris, etc would all work) > > --Joe > > > > > > http://linas.org/linux/load.html > > > > -Rasmus > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > > Joe Stump, PHP Hacker > [EMAIL PROTECTED] > http://www.miester.org/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
When you say "handled by us" do you mean you: 1) Write the sess_* files to a shared drive 2) Store them in the database 3) ignore them totally, who needs users anyhow? 4) some other option? Cal http://www.calevans.com -----Original Message----- From: jeremy brand [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 13, 2001 2:20 PM To: Cal Evans Cc: [EMAIL PROTECTED] Subject: RE: [PHP] load balancing with php/apache? We have a centralized DB server. Sessions are handled by us, the programmers, not the cluster. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Sat, 13 Jan 2001, Cal Evans wrote: > Date: Sat, 13 Jan 2001 11:51:01 -0600 > From: Cal Evans <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: RE: [PHP] load balancing with php/apache? > > How does it deal with sessions? Or do use store sessions in the database? > > Cal > > -----Original Message----- > From: Joe Stump [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 13, 2001 11:22 AM > To: Rasmus Lerdorf > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] load balancing with php/apache? > > > > http://www.linuxvirtualserver.org/ > > We use LVS on our website - it works great! We have 2 load balancers with > the > HA package and 6 PHP webservers running behind it (with a central DB > server). > > In short, it's possible and works quite well. BTW We user FreeBSD for > webservers > if that's any help (though linux, NT, solaris, etc would all work) > > --Joe > > > > > > http://linas.org/linux/load.html > > > > -Rasmus > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > > Joe Stump, PHP Hacker > [EMAIL PROTECTED] > http://www.miester.org/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Any of the above. It's up to you. Most people probably store the session info in a database. But you could also do it in a shared drive. But I got a little static a while ago when I suggested storing shared session data on an NFS mounted drive. NFSes are too slow I guess. Michael On Saturday, January 13, 2001, at 03:43 PM, Cal Evans wrote: > When you say "handled by us" do you mean you: > > 1) Write the sess_* files to a shared drive > 2) Store them in the database > 3) ignore them totally, who needs users anyhow? > 4) some other option? > > Cal > http://www.calevans.com > > > -----Original Message----- > From: jeremy brand [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 13, 2001 2:20 PM > To: Cal Evans > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] load balancing with php/apache? > > > We have a centralized DB server. Sessions are handled by us, the > programmers, not the cluster. > > Jeremy > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > Get your own Free, Private email at http://www.smackdown.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > On Sat, 13 Jan 2001, Cal Evans wrote: > > > Date: Sat, 13 Jan 2001 11:51:01 -0600 > > From: Cal Evans <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] > > Subject: RE: [PHP] load balancing with php/apache? > > > > How does it deal with sessions? Or do use store sessions in the database? > > > > Cal > > > > -----Original Message----- > > From: Joe Stump [mailto:[EMAIL PROTECTED]] > > Sent: Saturday, January 13, 2001 11:22 AM > > To: Rasmus Lerdorf > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] load balancing with php/apache? > > > > > > > http://www.linuxvirtualserver.org/ > > > > We use LVS on our website - it works great! We have 2 load balancers with > > the > > HA package and 6 PHP webservers running behind it (with a central DB > > server). > > > > In short, it's possible and works quite well. BTW We user FreeBSD for > > webservers > > if that's any help (though linux, NT, solaris, etc would all work) > > > > --Joe > > > > > > > > > > > http://linas.org/linux/load.html > > > > > > -Rasmus > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > > > > Joe Stump, PHP Hacker > > [EMAIL PROTECTED] > > http://www.miester.org/ > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > >
I work with Jer - we use DB based session management. You log in - get a cookie and everything is handled with that session id. --Joe On Sat, Jan 13, 2001 at 02:43:19PM -0600, Cal Evans wrote: > When you say "handled by us" do you mean you: > > 1) Write the sess_* files to a shared drive > 2) Store them in the database > 3) ignore them totally, who needs users anyhow? > 4) some other option? > > Cal > http://www.calevans.com > > > -----Original Message----- > From: jeremy brand [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 13, 2001 2:20 PM > To: Cal Evans > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] load balancing with php/apache? > > > We have a centralized DB server. Sessions are handled by us, the > programmers, not the cluster. > > Jeremy > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > Get your own Free, Private email at http://www.smackdown.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > On Sat, 13 Jan 2001, Cal Evans wrote: > > > Date: Sat, 13 Jan 2001 11:51:01 -0600 > > From: Cal Evans <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] > > Subject: RE: [PHP] load balancing with php/apache? > > > > How does it deal with sessions? Or do use store sessions in the database? > > > > Cal > > > > -----Original Message----- > > From: Joe Stump [mailto:[EMAIL PROTECTED]] > > Sent: Saturday, January 13, 2001 11:22 AM > > To: Rasmus Lerdorf > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] load balancing with php/apache? > > > > > > > http://www.linuxvirtualserver.org/ > > > > We use LVS on our website - it works great! We have 2 load balancers with > > the > > HA package and 6 PHP webservers running behind it (with a central DB > > server). > > > > In short, it's possible and works quite well. BTW We user FreeBSD for > > webservers > > if that's any help (though linux, NT, solaris, etc would all work) > > > > --Joe > > > > > > > > > > > http://linas.org/linux/load.html > > > > > > -Rasmus > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > > > > Joe Stump, PHP Hacker > > [EMAIL PROTECTED] > > http://www.miester.org/ > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
> Any of the above. It's up to you. Most people probably store the session info in a >database. But you could also do it in a shared drive. But I got a little static a >while ago when I suggested storing shared session data on an NFS mounted drive. NFSes >are too slow I guess. Whoever said NFS is slow hasn't used a NetApp --Joe > > Michael > > > On Saturday, January 13, 2001, at 03:43 PM, Cal Evans wrote: > > > When you say "handled by us" do you mean you: > > > > 1) Write the sess_* files to a shared drive > > 2) Store them in the database > > 3) ignore them totally, who needs users anyhow? > > 4) some other option? > > > > Cal > > http://www.calevans.com > > > > > > -----Original Message----- > > From: jeremy brand [mailto:[EMAIL PROTECTED]] > > Sent: Saturday, January 13, 2001 2:20 PM > > To: Cal Evans > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] load balancing with php/apache? > > > > > > We have a centralized DB server. Sessions are handled by us, the > > programmers, not the cluster. > > > > Jeremy > > > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] > > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > > Get your own Free, Private email at http://www.smackdown.com/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > > > On Sat, 13 Jan 2001, Cal Evans wrote: > > > > > Date: Sat, 13 Jan 2001 11:51:01 -0600 > > > From: Cal Evans <[EMAIL PROTECTED]> > > > To: [EMAIL PROTECTED] > > > Subject: RE: [PHP] load balancing with php/apache? > > > > > > How does it deal with sessions? Or do use store sessions in the database? > > > > > > Cal > > > > > > -----Original Message----- > > > From: Joe Stump [mailto:[EMAIL PROTECTED]] > > > Sent: Saturday, January 13, 2001 11:22 AM > > > To: Rasmus Lerdorf > > > Cc: [EMAIL PROTECTED] > > > Subject: Re: [PHP] load balancing with php/apache? > > > > > > > > > > http://www.linuxvirtualserver.org/ > > > > > > We use LVS on our website - it works great! We have 2 load balancers with > > > the > > > HA package and 6 PHP webservers running behind it (with a central DB > > > server). > > > > > > In short, it's possible and works quite well. BTW We user FreeBSD for > > > webservers > > > if that's any help (though linux, NT, solaris, etc would all work) > > > > > > --Joe > > > > > > > > > > > > > > > > http://linas.org/linux/load.html > > > > > > > > -Rasmus > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > > > > > > Joe Stump, PHP Hacker > > > [EMAIL PROTECTED] > > > http://www.miester.org/ > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
we store the sessions in the DB. Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Sat, 13 Jan 2001, Cal Evans wrote: > Date: Sat, 13 Jan 2001 14:43:19 -0600 > From: Cal Evans <[EMAIL PROTECTED]> > To: jeremy brand <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] load balancing with php/apache? > > When you say "handled by us" do you mean you: > > 1) Write the sess_* files to a shared drive > 2) Store them in the database > 3) ignore them totally, who needs users anyhow? > 4) some other option? > > Cal > http://www.calevans.com > > > -----Original Message----- > From: jeremy brand [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 13, 2001 2:20 PM > To: Cal Evans > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] load balancing with php/apache? > > > We have a centralized DB server. Sessions are handled by us, the > programmers, not the cluster. > > Jeremy > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > Get your own Free, Private email at http://www.smackdown.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > On Sat, 13 Jan 2001, Cal Evans wrote: > > > Date: Sat, 13 Jan 2001 11:51:01 -0600 > > From: Cal Evans <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] > > Subject: RE: [PHP] load balancing with php/apache? > > > > How does it deal with sessions? Or do use store sessions in the database? > > > > Cal > > > > -----Original Message----- > > From: Joe Stump [mailto:[EMAIL PROTECTED]] > > Sent: Saturday, January 13, 2001 11:22 AM > > To: Rasmus Lerdorf > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] load balancing with php/apache? > > > > > > > http://www.linuxvirtualserver.org/ > > > > We use LVS on our website - it works great! We have 2 load balancers with > > the > > HA package and 6 PHP webservers running behind it (with a central DB > > server). > > > > In short, it's possible and works quite well. BTW We user FreeBSD for > > webservers > > if that's any help (though linux, NT, solaris, etc would all work) > > > > --Joe > > > > > > > > > > > http://linas.org/linux/load.html > > > > > > -Rasmus > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > > > > Joe Stump, PHP Hacker > > [EMAIL PROTECTED] > > http://www.miester.org/ > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Oh, BTW, we don't use PHP sessions, we use our own. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Sat, 13 Jan 2001, jeremy brand wrote: > Date: Sat, 13 Jan 2001 13:44:18 -0800 (PST) > From: jeremy brand <[EMAIL PROTECTED]> > To: Cal Evans <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] load balancing with php/apache? > > we store the sessions in the DB. > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > Get your own Free, Private email at http://www.smackdown.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > On Sat, 13 Jan 2001, Cal Evans wrote: > > > Date: Sat, 13 Jan 2001 14:43:19 -0600 > > From: Cal Evans <[EMAIL PROTECTED]> > > To: jeremy brand <[EMAIL PROTECTED]> > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] load balancing with php/apache? > > > > When you say "handled by us" do you mean you: > > > > 1) Write the sess_* files to a shared drive > > 2) Store them in the database > > 3) ignore them totally, who needs users anyhow? > > 4) some other option? > > > > Cal > > http://www.calevans.com > > > > > > -----Original Message----- > > From: jeremy brand [mailto:[EMAIL PROTECTED]] > > Sent: Saturday, January 13, 2001 2:20 PM > > To: Cal Evans > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] load balancing with php/apache? > > > > > > We have a centralized DB server. Sessions are handled by us, the > > programmers, not the cluster. > > > > Jeremy > > > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] > > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > > Get your own Free, Private email at http://www.smackdown.com/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > > > On Sat, 13 Jan 2001, Cal Evans wrote: > > > > > Date: Sat, 13 Jan 2001 11:51:01 -0600 > > > From: Cal Evans <[EMAIL PROTECTED]> > > > To: [EMAIL PROTECTED] > > > Subject: RE: [PHP] load balancing with php/apache? > > > > > > How does it deal with sessions? Or do use store sessions in the database? > > > > > > Cal > > > > > > -----Original Message----- > > > From: Joe Stump [mailto:[EMAIL PROTECTED]] > > > Sent: Saturday, January 13, 2001 11:22 AM > > > To: Rasmus Lerdorf > > > Cc: [EMAIL PROTECTED] > > > Subject: Re: [PHP] load balancing with php/apache? > > > > > > > > > > http://www.linuxvirtualserver.org/ > > > > > > We use LVS on our website - it works great! We have 2 load balancers with > > > the > > > HA package and 6 PHP webservers running behind it (with a central DB > > > server). > > > > > > In short, it's possible and works quite well. BTW We user FreeBSD for > > > webservers > > > if that's any help (though linux, NT, solaris, etc would all work) > > > > > > --Joe > > > > > > > > > > > > > > > > http://linas.org/linux/load.html > > > > > > > > -Rasmus > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > > > > > > Joe Stump, PHP Hacker > > > [EMAIL PROTECTED] > > > http://www.miester.org/ > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
hey guys... my dumb isp has turned on ' --enable-trans-sid ' for all of the users on their webserver without telling them. while i am sure this feature has some benefits, it is breaking my code, big time. besides sticking the session value onto the end of every suspected server request, it is corrupting my javascript code in strange ways! Look at these examples... ================================ SPOT THE DIFFERENCE! ORIGINAL CODE: function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); CORRUPTED CODE: function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x="a[i])&&x.oSrc;i++)" x.src="x.oSrc;" } var d="document;" if(d.images){ if(!d.MM_p) d.MM_p="new" Array(); ================================ see those speech marks around: )" x.src="x.oSrc;" and d="document;" they (and many more elsewhere in my code) are corrupting my javascript?!?!?!?! please help, this is a live system and my isp has forced my into an emergency situation. can i turn off transparent sid's through a run time or configuration file (i cannot recompile) ? anyone know how to stop this corruption? if it helps, i use the include() function to get and output the html template from my code. jamie burns.
this is a bug in PHP (several reports in bug db). either ask your ISP to disable trans-sid in your virtual host, or do it yourself in .htaccess At 15:52 13.1. 2001, Jamie Burns wrote the following: -------------------------------------------------------------- >hey guys... > >my dumb isp has turned on ' --enable-trans-sid ' for all of the users on their >webserver without telling them. > >while i am sure this feature has some benefits, it is breaking my code, big time. >besides sticking the session value onto the end of every suspected server request, it >is corrupting my javascript code in strange ways! Look at these examples... > >================================ > >SPOT THE DIFFERENCE! > >ORIGINAL CODE: > > function MM_swapImgRestore() { //v3.0 > var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) >x.src=x.oSrc; > } > > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); > >CORRUPTED CODE: > > function MM_swapImgRestore() { //v3.0 > var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x="a[i])&&x.oSrc;i++)" >x.src="x.oSrc;" > } > > var d="document;" if(d.images){ if(!d.MM_p) d.MM_p="new" Array(); > >================================ > >see those speech marks around: > > )" x.src="x.oSrc;" and d="document;" > >they (and many more elsewhere in my code) are corrupting my javascript?!?!?!?! > >please help, this is a live system and my isp has forced my into an emergency >situation. > >can i turn off transparent sid's through a run time or configuration file (i cannot >recompile) ? > >anyone know how to stop this corruption? > >if it helps, i use the include() function to get and output the html template from my >code. > >jamie burns. ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. [EMAIL PROTECTED]
As a note, you can also place: <?php ini_set("session.use_trans_sid", "0"); // ... Insert messed up code here ini_set("session.use_trans_sid", "1"); ?> And that will solve your problem... -Sterling Cynic wrote: > > this is a bug in PHP (several reports in bug db). either ask > your ISP to disable trans-sid in your virtual host, or do it > yourself in .htaccess > > At 15:52 13.1. 2001, Jamie Burns wrote the following: > -------------------------------------------------------------- > >hey guys... > > > >my dumb isp has turned on ' --enable-trans-sid ' for all of the users on their >webserver without telling them. > > > >while i am sure this feature has some benefits, it is breaking my code, big time. >besides sticking the session value onto the end of every suspected server request, it >is corrupting my javascript code in strange ways! Look at these examples... > > > >================================ > > > >SPOT THE DIFFERENCE! > > > >ORIGINAL CODE: > > > > function MM_swapImgRestore() { //v3.0 > > var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) >x.src=x.oSrc; > > } > > > > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); > > > >CORRUPTED CODE: > > > > function MM_swapImgRestore() { //v3.0 > > var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x="a[i])&&x.oSrc;i++)" >x.src="x.oSrc;" > > } > > > > var d="document;" if(d.images){ if(!d.MM_p) d.MM_p="new" Array(); > > > >================================ > > > >see those speech marks around: > > > > )" x.src="x.oSrc;" and d="document;" > > > >they (and many more elsewhere in my code) are corrupting my javascript?!?!?!?! > > > >please help, this is a live system and my isp has forced my into an emergency >situation. > > > >can i turn off transparent sid's through a run time or configuration file (i cannot >recompile) ? > > > >anyone know how to stop this corruption? > > > >if it helps, i use the include() function to get and output the html template from >my code. > > > >jamie burns. > ------end of quote------ > > ____________________________________________________________ > Cynic: > > A member of a group of ancient Greek philosophers who taught > that virtue constitutes happiness and that self control is > the essential part of virtue. > > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
thanks! what do i need to put in my apache config? j ----- Original Message ----- From: "Cynic" <[EMAIL PROTECTED]> To: "Jamie Burns" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, January 13, 2001 3:06 PM Subject: Re: [PHP] Guru Needed - the parser is corrupting my html!! > this is a bug in PHP (several reports in bug db). either ask > your ISP to disable trans-sid in your virtual host, or do it > yourself in .htaccess > > > At 15:52 13.1. 2001, Jamie Burns wrote the following: > -------------------------------------------------------------- > >hey guys... > > > >my dumb isp has turned on ' --enable-trans-sid ' for all of the users on their webserver without telling them. > > > >while i am sure this feature has some benefits, it is breaking my code, big time. besides sticking the session value onto the end of every suspected server request, it is corrupting my javascript code in strange ways! Look at these examples... > > > >================================ > > > >SPOT THE DIFFERENCE! > > > >ORIGINAL CODE: > > > > function MM_swapImgRestore() { file://v3.0 > > var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; > > } > > > > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); > > > >CORRUPTED CODE: > > > > function MM_swapImgRestore() { file://v3.0 > > var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x="a[i])&&x.oSrc;i++)" x.src="x.oSrc;" > > } > > > > var d="document;" if(d.images){ if(!d.MM_p) d.MM_p="new" Array(); > > > >================================ > > > >see those speech marks around: > > > > )" x.src="x.oSrc;" and d="document;" > > > >they (and many more elsewhere in my code) are corrupting my javascript?!?!?!?! > > > >please help, this is a live system and my isp has forced my into an emergency situation. > > > >can i turn off transparent sid's through a run time or configuration file (i cannot recompile) ? > > > >anyone know how to stop this corruption? > > > >if it helps, i use the include() function to get and output the html template from my code. > > > >jamie burns. > ------end of quote------ > > > > ____________________________________________________________ > Cynic: > > A member of a group of ancient Greek philosophers who taught > that virtue constitutes happiness and that self control is > the essential part of virtue. > > [EMAIL PROTECTED] >
php_flag session.use_trans_sid 0 At 16:08 13.1. 2001, Jamie Burns wrote the following: -------------------------------------------------------------- >thanks! > >what do i need to put in my apache config? > >j > >----- Original Message ----- >From: "Cynic" <[EMAIL PROTECTED]> >To: "Jamie Burns" <[EMAIL PROTECTED]>; ><[EMAIL PROTECTED]> >Sent: Saturday, January 13, 2001 3:06 PM >Subject: Re: [PHP] Guru Needed - the parser is corrupting my html!! > > >> this is a bug in PHP (several reports in bug db). either ask >> your ISP to disable trans-sid in your virtual host, or do it >> yourself in .htaccess >> >> >> At 15:52 13.1. 2001, Jamie Burns wrote the following: >> -------------------------------------------------------------- >> >hey guys... >> > >> >my dumb isp has turned on ' --enable-trans-sid ' for all of the users on >their webserver without telling them. >> > >> >while i am sure this feature has some benefits, it is breaking my code, >big time. besides sticking the session value onto the end of every suspected >server request, it is corrupting my javascript code in strange ways! Look at >these examples... >> > >> >================================ >> > >> >SPOT THE DIFFERENCE! >> > >> >ORIGINAL CODE: >> > >> > function MM_swapImgRestore() { file://v3.0 >> > var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) >x.src=x.oSrc; >> > } >> > >> > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); >> > >> >CORRUPTED CODE: >> > >> > function MM_swapImgRestore() { file://v3.0 >> > var i,x,a=document.MM_sr; >for(i=0;a&&i<a.length&&(x="a[i])&&x.oSrc;i++)" x.src="x.oSrc;" >> > } >> > >> > var d="document;" if(d.images){ if(!d.MM_p) d.MM_p="new" Array(); >> > >> >================================ >> > >> >see those speech marks around: >> > >> > )" x.src="x.oSrc;" and d="document;" >> > >> >they (and many more elsewhere in my code) are corrupting my >javascript?!?!?!?! >> > >> >please help, this is a live system and my isp has forced my into an >emergency situation. >> > >> >can i turn off transparent sid's through a run time or configuration file >(i cannot recompile) ? >> > >> >anyone know how to stop this corruption? >> > >> >if it helps, i use the include() function to get and output the html >template from my code. >> > >> >jamie burns. >> ------end of quote------ >> >> >> >> ____________________________________________________________ >> Cynic: >> >> A member of a group of ancient Greek philosophers who taught >> that virtue constitutes happiness and that self control is >> the essential part of virtue. >> >> [EMAIL PROTECTED] >> ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. [EMAIL PROTECTED]
hi list, sorry, but we cant manage a Load Data Infile cause we always get: Can't get stat of '/tmp/phpNNAQSM' (Errcode: 2) OUR Code is working fine in different project where safe_mode = OFF ============================= heres the line where we try to move the file to a webfolder in our directory move_uploaded_file ($textfile, "/home/sites/site2/web/Tango/tmp/mySql.txt"); chmod("/home/sites/site2/web/Tango/tmp/mySql.txt", 0644); ============================= any ideas for us ? is there a way that we can set the upload_tmp_dir path in a .htaccess file ? its also not working if we edit php.ini upload_tmp_dir = . thank you andreas
hi, our problem that changing the upload_tmp_dir in php.ini has NO effect !!! yes we restarted apache greetings andreas > Your infile must be world readable, or at least MySQL must have read > prviledges on it. > Maybe it is a function of directory permissions. > > - Scott > > > > -----Original Message----- > > From: andreas (@work) [mailto:[EMAIL PROTECTED]] > > Sent: January 13, 2001 9:14 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] TRY AGAIN mysql php4.04 and safe_mode > > > > > > hi list, > > > > sorry, but we cant manage > > > > a Load Data Infile > > > > > > cause we always get: > > Can't get stat of '/tmp/phpNNAQSM' (Errcode: 2) > > > > OUR Code is working fine in different project where safe_mode = OFF > > > > > > > > ============================= > > > > heres the line where we try to move the file to a webfolder in our > > directory > > > > move_uploaded_file ($textfile, > > "/home/sites/site2/web/Tango/tmp/mySql.txt"); > > chmod("/home/sites/site2/web/Tango/tmp/mySql.txt", 0644); > > > > ============================= > > > > > > > > any ideas for us ? > > > > > > > > is there a way that we can set the upload_tmp_dir path in a > > .htaccess file > > ? > > > > > > its also not working if we edit php.ini > > > > upload_tmp_dir = . > > > > > > > > > > thank you > > > > > > > > andreas > >
> Any help appreciated - otherwise I have to go look at postgresql :( :) -- -Michael
Go to http://www.mysql.com You'll see a 'Search' field near the top left. Type the string: Lost connection to MySQL ..into it. It brings up about 50 results Also, load up http://www.mysql.com/documentation/mysql/bychapter/manual_Problems.html#Prob lems jason > > > Any help appreciated - otherwise I have to go look at postgresql :( > :) > > -- > -Michael
Hi, I want to let PHP create/render a line and bar graph from inputted numbers. I now all the PHP basics but I don't know how to let PHP make the graphs from the variables. Can anyone point me to a solution or a resource-site? Regards, Sumarlidi Einar Dadason SED - Graphic Design ------------------------------------------ Phone: (+354) 4615501 Mobile: (+354) 8960376 Fax: (+354) 4615503 E-mail: [EMAIL PROTECTED] Homepage: www.sed.is <- New Homepage! ------------------------------------------
You might check out: http://www.advgraph.regiocom.net/ In article <[EMAIL PROTECTED]> you write: >Hi, > >I want to let PHP create/render a line and bar graph from inputted numbers. >I now all the PHP basics but I don't know how to let PHP make the graphs >from the variables. > >Can anyone point me to a solution or a resource-site? > >Regards, >Sumarlidi Einar Dadason > >SED - Graphic Design > >------------------------------------------ >Phone: (+354) 4615501 >Mobile: (+354) 8960376 >Fax: (+354) 4615503 >E-mail: [EMAIL PROTECTED] >Homepage: www.sed.is <- New Homepage! >------------------------------------------ > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] >
A bit of an embarrassing question this, and a long shot too. Please don't laugh. Does anyone know if there is a php program that I can use to replace the discussion group in frontpage 2000. I want something that can read the existing discussion files generated by FP200 so that I don't have to start from scratch and throw away existing discussions. Needless to say the fronpage 2000 server extensions that run the board I have at the moment have broken. Any suggestions appreciated. Allan Cybercandy
I dunno about importing the data, but Phorum is a pretty darned good PHP discussion group program... Hopefully, FP just stores all the stuff in some tables and you can export the data as CSV or tab-delimited. ----- Original Message ----- From: "Cybercandy Ltd" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Saturday, January 13, 2001 10:02 AM Subject: [PHP] Frontpage Discussion Group/PHP Replacement > A bit of an embarrassing question this, > and a long shot too. Please don't laugh. > > Does anyone know if there is a php program > that I can use to replace the discussion group in frontpage 2000. > > I want something that can read the existing discussion files generated > by FP200 so that I don't have to start from scratch and throw > away existing discussions. > > Needless to say the fronpage 2000 server extensions that run > the board I have at the moment have broken. > > Any suggestions appreciated. > > Allan > Cybercandy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hello, running the following script (exec.php) on telnet account i get this error: Warning: Supplied argument is not a valid file handler resource in exec.php on line 21 Can anybody tell me whats wrong with it? Normally it should fetch the newsgroups on my local news server and insert them into rows on a mysql database. This script is part of myPHPusenet-0.9.9. I hope the script was not too long. THE SCRIPT: ********************************************************* #!/usr/bin/php -q <? $start = gettimeofday(); include("conf.inc.php"); include("newsgroups.inc.php"); @mysql_connect($hostname, $username, $password) OR DIE ("Could not connect"); @mysql_select_db("$database") OR DIE ("Could not open database"); $i = 0; $j = 0; while($i < sizeof($groups) ) { $fp = fsockopen("$server", 119); set_socket_blocking($fp, true); $response = fgets($fp, 256); fputs("$fp", "GROUP $groups[$i]\n"); $gruppe = fgets($fp, 1024); $range = split(" ", $gruppe); $range_start = $range[2]; $range_end = $range[3]; $db_ng_name[$i] = ereg_replace("\.","_", $groups[$i]); $query1 = "UPDATE last SET last.last = '$range_end' WHERE newsgroup = '$db_ng_name[$i]'"; $query2 = "SELECT last FROM last WHERE (newsgroup LIKE '$db_ng_name[$i]')"; $runit2 = MYSQL_QUERY($query2); $result = @MYSQL_RESULT($runit2,0,last); IF (@MYSQL_NUMROWS($runit2) == 1) { $range_start = $result; while($range_start < $range_end) { system("parse.php $server $groups[$i] $range_start"); $range_start++; $j++; } } ELSE { PRINT "No new posts in $groups[$i]\n"; } $runit1 = MYSQL_QUERY($query1); $i++; } $tables = MYSQL_LIST_TABLES($database); $k = 0; WHILE ($k < MYSQL_NUM_ROWS ($tables)) { $area_names[$k] = MYSQL_TABLENAME ($tables, $k); $query = "SELECT count(*) AS total_nr FROM $area_names[$k]"; $q_string = @MYSQL_QUERY($query); $fundet = @MYSQL_RESULT($q_string,0,total_nr); $total += $fundet; $k++; } $date = date("d"); $month = date("F"); $shortmonth = date("M"); $year = date("Y"); $hour = date("H"); $min = date("i"); $sec = date("s"); $end = gettimeofday(); $exec_time = number_format( (($end["sec"] + $end["usec"]/1000000) - ($start["sec"] + $start["usec"]/1000000)), 3); $contents = "Hi!\n\nThe newsparser was run $date $month $year at $hour:$min:$sec, and it inserted $j posts in the\ndatabasen, there are now $total posts in the \n\nDatabase the update took $exec_time seconds.\n\n-- \n\nYours Truly.\n\tmyPHP usenet"; mail("$email", "$subject", "$contents", "From:$USER@$HOSTNAME\nReply-To: [EMAIL PROTECTED]"); $fp = fopen($logname, "a") or die ("Could not open logfile"); $logmess = "$shortmonth $date $hour:$min:$sec the newsparser inserted $j posts, there are now $total total\n"; $write = fputs($fp, $logmess); fclose($fp); ?>
This is a matter of figuring out why the variable isn't a valid file handle resource. To do so, find where it should be made such a resource (the line that says $fp = fsockopen...etc... is probably it), and add some error checking. I believe this function has its own way of returning what's wrong; check php.net/fsockopen and take a look at additional arguments... Then you must simply output the resulting error message (which is assumed to be resulting because the file handle is not being created). --Toby ----- Original Message ----- From: "K.Simon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 13, 2001 11:07 AM Subject: [PHP] Wondering whats wrong? Hello, running the following script (exec.php) on telnet account i get this error: Warning: Supplied argument is not a valid file handler resource in exec.php on line 21 Can anybody tell me whats wrong with it? Normally it should fetch the newsgroups on my local news server and insert them into rows on a mysql database. This script is part of myPHPusenet-0.9.9. I hope the script was not too long. THE SCRIPT: ********************************************************* #!/usr/bin/php -q <? $start = gettimeofday(); include("conf.inc.php"); include("newsgroups.inc.php"); @mysql_connect($hostname, $username, $password) OR DIE ("Could not connect"); @mysql_select_db("$database") OR DIE ("Could not open database"); $i = 0; $j = 0; while($i < sizeof($groups) ) { $fp = fsockopen("$server", 119); set_socket_blocking($fp, true); $response = fgets($fp, 256); fputs("$fp", "GROUP $groups[$i]\n"); $gruppe = fgets($fp, 1024); $range = split(" ", $gruppe); $range_start = $range[2]; $range_end = $range[3]; $db_ng_name[$i] = ereg_replace("\.","_", $groups[$i]); $query1 = "UPDATE last SET last.last = '$range_end' WHERE newsgroup = '$db_ng_name[$i]'"; $query2 = "SELECT last FROM last WHERE (newsgroup LIKE '$db_ng_name[$i]')"; $runit2 = MYSQL_QUERY($query2); $result = @MYSQL_RESULT($runit2,0,last); IF (@MYSQL_NUMROWS($runit2) == 1) { $range_start = $result; while($range_start < $range_end) { system("parse.php $server $groups[$i] $range_start"); $range_start++; $j++; } } ELSE { PRINT "No new posts in $groups[$i]\n"; } $runit1 = MYSQL_QUERY($query1); $i++; } $tables = MYSQL_LIST_TABLES($database); $k = 0; WHILE ($k < MYSQL_NUM_ROWS ($tables)) { $area_names[$k] = MYSQL_TABLENAME ($tables, $k); $query = "SELECT count(*) AS total_nr FROM $area_names[$k]"; $q_string = @MYSQL_QUERY($query); $fundet = @MYSQL_RESULT($q_string,0,total_nr); $total += $fundet; $k++; } $date = date("d"); $month = date("F"); $shortmonth = date("M"); $year = date("Y"); $hour = date("H"); $min = date("i"); $sec = date("s"); $end = gettimeofday(); $exec_time = number_format( (($end["sec"] + $end["usec"]/1000000) - ($start["sec"] + $start["usec"]/1000000)), 3); $contents = "Hi!\n\nThe newsparser was run $date $month $year at $hour:$min:$sec, and it inserted $j posts in the\ndatabasen, there are now $total posts in the \n\nDatabase the update took $exec_time seconds.\n\n-- \n\nYours Truly.\n\tmyPHP usenet"; mail("$email", "$subject", "$contents", "From:$USER@$HOSTNAME\nReply-To: [EMAIL PROTECTED]"); $fp = fopen($logname, "a") or die ("Could not open logfile"); $logmess = "$shortmonth $date $hour:$min:$sec the newsparser inserted $j posts, there are now $total total\n"; $write = fputs($fp, $logmess); fclose($fp); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Toby Butzon wrote: > > This is a matter of figuring out why the variable isn't a > valid file handle resource. To do so, find where it should > be made such a resource (the line that says $fp = > fsockopen...etc... is probably it), and add some error > checking. I believe this function has its own way of > returning what's wrong; check php.net/fsockopen and take a > look at additional arguments... Then you must simply output > the resulting error message (which is assumed to be > resulting because the file handle is not being created). > > --Toby > That is good advice, but i don't think that's the poster's problem. The problem is the following code: fputs("$fp", "GROUP $groups[$i]\n"); You cannot stringify a resource (with PHP 4). Therefore the offending code must look like: fputs($fp, "GROUP $groups[$i]\n"); In order to work... -Sterling > ----- Original Message ----- > From: "K.Simon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, January 13, 2001 11:07 AM > Subject: [PHP] Wondering whats wrong? > > Hello, > running the following script (exec.php) on telnet account i > get this error: > Warning: Supplied argument is not a valid file handler > resource in exec.php on line 21 > Can anybody tell me whats wrong with it? Normally it should > fetch the newsgroups on my local news server and insert them > into rows on a mysql database. This script is part of > myPHPusenet-0.9.9. > I hope the script was not too long. > > THE SCRIPT: > ********************************************************* > > #!/usr/bin/php -q > > <? > > $start = gettimeofday(); > > include("conf.inc.php"); > include("newsgroups.inc.php"); > > @mysql_connect($hostname, $username, $password) OR DIE > ("Could not connect"); > @mysql_select_db("$database") OR DIE ("Could not open > database"); > > $i = 0; > $j = 0; > > while($i < sizeof($groups) ) { > > $fp = fsockopen("$server", 119); > set_socket_blocking($fp, true); > $response = fgets($fp, 256); > fputs("$fp", "GROUP $groups[$i]\n"); > $gruppe = fgets($fp, 1024); > $range = split(" ", $gruppe); > $range_start = $range[2]; > $range_end = $range[3]; > > $db_ng_name[$i] = ereg_replace("\.","_", $groups[$i]); > > $query1 = "UPDATE last SET last.last = '$range_end' WHERE > newsgroup = '$db_ng_name[$i]'"; > $query2 = "SELECT last FROM last WHERE (newsgroup LIKE > '$db_ng_name[$i]')"; > $runit2 = MYSQL_QUERY($query2); > $result = @MYSQL_RESULT($runit2,0,last); > > IF (@MYSQL_NUMROWS($runit2) == 1) { > > $range_start = $result; > > while($range_start < $range_end) { > > system("parse.php $server $groups[$i] $range_start"); > > $range_start++; > $j++; > > } > > } > > ELSE { > PRINT "No new posts in $groups[$i]\n"; > } > > $runit1 = MYSQL_QUERY($query1); > > $i++; > } > > $tables = MYSQL_LIST_TABLES($database); > $k = 0; > > WHILE ($k < MYSQL_NUM_ROWS ($tables)) { > $area_names[$k] = MYSQL_TABLENAME ($tables, $k); > $query = "SELECT count(*) AS total_nr FROM $area_names[$k]"; > $q_string = @MYSQL_QUERY($query); > $fundet = @MYSQL_RESULT($q_string,0,total_nr); > > $total += $fundet; > $k++; > } > > $date = date("d"); > $month = date("F"); > $shortmonth = date("M"); > $year = date("Y"); > $hour = date("H"); > $min = date("i"); > $sec = date("s"); > > $end = gettimeofday(); > > $exec_time = number_format( (($end["sec"] + > $end["usec"]/1000000) - ($start["sec"] + > $start["usec"]/1000000)), 3); > > $contents = "Hi!\n\nThe newsparser was run $date $month > $year at $hour:$min:$sec, and it inserted $j posts in > the\ndatabasen, there are now $total posts in the > \n\nDatabase the update took $exec_time seconds.\n\n-- > \n\nYours Truly.\n\tmyPHP usenet"; > > mail("$email", "$subject", "$contents", > "From:$USER@$HOSTNAME\nReply-To: [EMAIL PROTECTED]"); > > $fp = fopen($logname, "a") or die ("Could not open > logfile"); > $logmess = "$shortmonth $date $hour:$min:$sec the newsparser > inserted $j posts, there are now $total total\n"; > $write = fputs($fp, $logmess); > fclose($fp); > > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
My Apache 1.3.12 server with PHP 4.0.4 and MySQL 3.23.27, occationally spits out a Segmentation fault in the error_log. I'm not entirely sure which page is being loaded at the time, and I'm not sure of what exactly is being done, so I thought I'd try to do some tracing with gdb, which I have never ever used before this date. Can someone read out any information from this output I've struggled hard to gather? :-) To me, it seems to be a problem with memory allocation or something similar, but I'm not sure why since the scripts on the actual server is not doing anything special really. I'm running a RedHat 7.0 installation on a 1 ghz Intel box with 512 mb of ram. Total memory usage is not high. Other servers I have with a much higher load and also running PHP have never had this problem. So what does this stuff mean now: Attempt #1: ========= (gdb) set args -X -f /home/httpd/conf/httpd.conf (gdb) r Starting program: /home/httpd/bin/httpd -X -f /home/httpd/conf/httpd.conf Program received signal SIGSEGV, Segmentation fault. 0x80ef78d in _efree (ptr=0x829a7e0) at zend_alloc.c:212 212 REMOVE_POINTER_FROM_LIST(p); Attempt #2: ========= (gdb) set args -X -f /home/httpd/conf/httpd.conf (gdb) r Starting program: /home/httpd/bin/httpd -X -f /home/httpd/conf/httpd.conf Program received signal SIGSEGV, Segmentation fault. 0x401ae964 in chunk_alloc (ar_ptr=0x40251ce0, nb=16) at malloc.c:2770 2770 malloc.c: No such file or directory. (gdb) BT #0 0x401ae964 in chunk_alloc (ar_ptr=0x40251ce0, nb=16) at malloc.c:2770 #1 0x401ae7e6 in __libc_malloc (bytes=8) at malloc.c:2703 #2 0x80eeb88 in virtual_file_ex (state=0xbfff9158, path=0x82dcef4 "header.html", verify_path=0) at tsrm_virtual_cwd.c:307 #3 0x8089842 in expand_filepath (filepath=0x82dcef4 "header.html", real_path=0x0) at fopen-wrappers.c:977 #4 0x8088370 in php_fopen_and_set_opened_path (path=0x82dcef4 "header.html", mode=0x81b5183 "rb", opened_path=0xbfffb398) at fopen-wrappers.c:248 #5 0x808881a in php_fopen_with_path (filename=0x82dcef4 "header.html", mode=0x81b5183 "rb", path=0x0, opened_path=0xbfffb398) at fopen-wrappers.c:399 #6 0x8089647 in php_fopen_url_wrapper (path=0x82dcef4 "header.html", mode=0x81b5183 "rb", options=1, issock=0xbfffb2a4, socketd=0xbfffb2a8, opened_path=0xbfffb398) at fopen-wrappers.c:899 #7 0x80851ca in php_fopen_wrapper_for_zend (filename=0x82dcef4 "header.html", opened_path=0xbfffb398) at main.c:493 #8 0x81013c6 in open_file_for_scanning (file_handle=0xbfffb390) at zend-scanner.c:2830 #9 0x81014de in compile_file (file_handle=0xbfffb390, type=2) at zend-scanner.c:2928 #10 0x810164a in compile_filename (type=2, filename=0x8335ff4) at zend-scanner.c:2982 #11 0x8121dc0 in execute (op_array=0x830a51c) at ./zend_execute.c:2014 #12 0x80fae0d in zend_execute_scripts (type=8, file_count=3) at zend.c:717 #13 0x8085f5f in php_execute_script (primary_file=0xbffff790) at main.c:1200 #14 0x8104da0 in apache_php_module_main (r=0x82a90bc, display_source_mode=0) at sapi_apache.c:89 #15 0x8083a70 in send_php () #16 0x8083aa5 in send_parsed_php () #17 0x812a1e9 in ap_invoke_handler () #18 0x813e39f in process_request_internal () #19 0x813e400 in ap_process_request () #20 0x813581d in child_main () #21 0x81359c8 in make_child () #22 0x8135b38 in startup_children () #23 0x8136176 in standalone_main () #24 0x81369b7 in main () #25 0x4014fb65 in __libc_start_main (main=0x8136610 <main>, argc=4, ubp_av=0xbffffb14, init=0x806afec <_init>, fini=0x81af0ec <_fini>, rtld_fini=0x4000df24 <_dl_fini>, stack_end=0xbffffb0c) at ../sysdeps/generic/libc-start.c:111 --- Johan Björk
If I create an office calendar using PHP & mySQL, how can I program normal days off for (U.S.) holidays like Christmas, Fourth of July, Easter, etc.
For the most part, you probably have to have some custom code to handle them. I suspect there are authoritative sources of the legal holidays online somewhere that you can query dynamically... What exactly do you want to *do* with the holidays and your calendar is probably the first question you have to answer for yourself. ----- Original Message ----- From: bill <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Saturday, January 13, 2001 11:46 AM Subject: [PHP] Calendar holidays > If I create an office calendar using PHP & mySQL, how can I program > normal days off for (U.S.) holidays like Christmas, Fourth of July, > Easter, etc. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
i have a problem with the quality of the output picture... you can have a look yourself.. http://tooltime.dyndns.org/~georg/test/ this is the code that creates the pic...: <?PHP header("Content-type: image/png"); $src_img=ImageCreateFromPNG("tool.png"); ImagePNG($src_img); ?> so as you can see the pictures isn't modified. my system: linux-box: 2.2.18 i the jpeg/png/gd/tiff libaries installed thankx georg
GD library only support PNG 256 color.... your PNG have more colors! With Best Regards Johan ----- Original Message ----- From: "Georg Buschbeck" <[EMAIL PROTECTED]> To: "PHP-Liste (general)" <[EMAIL PROTECTED]> Sent: Saturday, January 13, 2001 7:10 PM Subject: [PHP] graphic problem... i have a problem with the quality of the output picture... you can have a look yourself.. http://tooltime.dyndns.org/~georg/test/ this is the code that creates the pic...: <?PHP header("Content-type: image/png"); $src_img=ImageCreateFromPNG("tool.png"); ImagePNG($src_img); ?> so as you can see the pictures isn't modified. my system: linux-box: 2.2.18 i the jpeg/png/gd/tiff libaries installed thankx georg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Georg, If you're running Apache/Unix, php_imlib would allow you to manipulate png's with more than 256 colors. http://mmcc.cx/php_imlib/ Matt On Sat, 13 Jan 2001, Johan Holst Nielsen wrote: > GD library only support PNG 256 color.... your PNG have more colors! > > With Best Regards > > Johan > > > ----- Original Message ----- > From: "Georg Buschbeck" <[EMAIL PROTECTED]> > To: "PHP-Liste (general)" <[EMAIL PROTECTED]> > Sent: Saturday, January 13, 2001 7:10 PM > Subject: [PHP] graphic problem... > > > i have a problem with the quality of the output picture... > you can have a look yourself.. > http://tooltime.dyndns.org/~georg/test/ > this is the code that creates the pic...: > <?PHP > header("Content-type: image/png"); > $src_img=ImageCreateFromPNG("tool.png"); > ImagePNG($src_img); > ?> > > so as you can see the pictures isn't modified. > > my system: > linux-box: 2.2.18 > i the jpeg/png/gd/tiff libaries installed > > thankx > georg > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
On Saturday 13 January 2001 00:36, jeff fitzmyers wrote: > The code below does not work. What could be causing > Please enter user name here: > <FORM> Pull out your favourite HTML documentation and read again through the discussion of the <form> tag -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra
Within your configurations, is register_globals on? I try this code and it works just fine. Although if register_globals setting in php.ini is off it will not, try replacing : echo ($name); with print $HTTP_GET_VARS["name"]; And see what happens. If you want $name type variables to register as global, then turn the setting to on. Strangly, iirc, this should be on by default though. The fact that you have name=Bob in url would suggest this to be the "problem". Read about these settings here : http://www.php.net/manual/en/configuration.php#ini.register-globals Philip Olson http://www.cornado.com/ On Sat, 13 Jan 2001, Christian Reiniger wrote: > On Saturday 13 January 2001 00:36, jeff fitzmyers wrote: > > > The code below does not work. What could be causing > > > Please enter user name here: > > <FORM> > > Pull out your favourite HTML documentation and read again through the > discussion of the <form> tag > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > The use of COBOL cripples the mind; its teaching should, therefore, > be regarded as a criminal offence. > > - Edsger W. Dijkstra > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
i'dve waited for your reply but i'm going home now so check the RFC : http://www.freesoft.org/CIE/RFC/index.htm look for Hypertext transfer protocol, v 1.0 in that look for a chapter called client authentication or somehting like that. that should do it. Hrishi
Greetings all, I left the php list a few years ago when I lost the clients who wanted (could afford) php scripts (I'm still using 2.12b..lol). Several scripts are still running well after all these years. Now, I'm building an online programming resume for myself and using php/msql to track potential employers as they visit. I'm using a cookie to set a visitor id, then I read the cookie on each page and make database updates to track page/timeonpage visiting sequence. If no cookie is found then it must be the first visit and a small login window opens to enter name/email. On submit, a db record is created and visitor id assigned and put in cookie and db field. That way I can track all visits from the cookie id regardless of number of different visits. It was all working perfectly two days ago. I got up yesterday to polish a few other things and found that I can't get php to read any cookies. It has to be a read problem because I can't get the cookie that was set when it was working the day before. This is a problem for all three of my browsers on two machines as well some friends who tried it out. It could be an expires problem, but I didn't do anything to that either. Here is the set cookie from the new db record visitor script: $vin is a random 6 character string calculated before the set cookie SetCookie("cpvin","$vin","time()+1500"); I also tried: SetCookie("cpvin","$vin","Monday, 31-12-01 23:59:59 GMT"); (this is what I was using when it worked, then stopped) All variables pass and record creation works... just can't set or read the cookie? As far as the read on each page: if ($cpvin);//already been set update database entry on $cpvin else; $firstvisit = "yes"; endif; Today I tried putting: $cpvin = $HTTP_COOKIE_VARS["cpvin"]; at the top.. no luck there either. Later in the script there is an: onload() JavaScript which opens the login box when $firstvisit = yes. The site is at: http://donhowland.com (that's me) feel free to register as often as you like, it's not ready to open until I get this last item working and I'll dump the database when I open it. I have a cookie check section at the top so I can see the cookie status. Any ideas of what whet wrong? I didn't do anything that I know of. If you want to respond please contact me directly, as I'm not currently on the list. Thanks for any ideas, Don Howland [EMAIL PROTECTED] PS. I'm working on a url encoded id to track visitors until I can figure out what happened. It will work by not as smoothly as the cookie.
> I left the php list a few years ago when I lost the clients who wanted > (could afford) php scripts (I'm still using 2.12b..lol). Several > scripts are still running well after all these years. You probably should consider upgrading... > Now, I'm building an online programming resume for myself and using > php/msql to track potential employers as they visit. I'm using a cookie > to set a visitor id, then I read the cookie on each page and make > database updates to track page/timeonpage visiting sequence. And switch to MySQL while you're at it. mSQL is not much maintained, last I heard. You'll probably be able to do a global search&replace of msql_ for mysql_ and you're done. > Here is the set cookie from the new db record visitor script: > > $vin is a random 6 character string calculated before the set cookie > > SetCookie("cpvin","$vin","time()+1500"); "time()+1500" is pretty much going to end up being 0 by the time it gets to the cookie -- So you were using session cookies all this time, and they died as soon as you quit your browser. You want time()+1500 without the quotes -- It's a calculation, not a string. Also, the quotes on $vin are gratuitous -- They don't really hurt anything, but they're pretty pointless. > I also tried: > SetCookie("cpvin","$vin","Monday, 31-12-01 23:59:59 GMT"); (this is what > I was using when it worked, then stopped) I reckon those might have worked until the New Year, if you got all the characters right...
On Sat, 13 Jan 2001, Mark Lo wrote: > Hi, > > I would like to know the method to refresh one window when closing > another windows. That'd be a Javascript thing. onClose one window, refresh the other. Matt
I have noticed that <?= works just as well as <%=. Since this is not in documentation, how safe is it to use it? Many thanks, -- Arcady Genkin Don't read everything you believe.
Can someone point me to the documentation of '<?=' and '<%=', 'cause I don't know what it does. Thanks mOrP > -----Original Message----- > From: Arcady Genkin [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 13, 2001 8:48 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Use <?= instead of <%= > > > I have noticed that <?= works just as well as <%=. Since this is not > in documentation, how safe is it to use it? > > Many thanks, > -- > Arcady Genkin > Don't read everything you believe. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
"mOrP" <[EMAIL PROTECTED]> writes: [badly formatted message fixed] > > I have noticed that <?= works just as well as <%=. Since this is not > > in documentation, how safe is it to use it? > > Can someone point me to the documentation of '<?=' and '<%=', 'cause I don't > know what it does. See http://www.php.net/manual/en/language.basic-syntax.php -- Arcady Genkin Don't read everything you believe.
Take a look at http://www.php.net/manual/en/language.basic-syntax.php. Regarding the use of <?= and <%=... Basically, they're a shorthand version for <? echo 'something' ?>. (The <?= equivelent would be <?= 'something' ?>.) The use of <%= is discouraged (as is <%) because it was only added to make things easier for ASP devels and people working in FrontPage. The use of <?= at all has been debated; check the archives if you're interested... it's an undying debate ;) --Toby ----- Original Message ----- From: "mOrP" <[EMAIL PROTECTED]> > Can someone point me to the documentation of '<?=' and '<%=', 'cause I don't > know what it does. > > -----Original Message----- > > From: Arcady Genkin [mailto:[EMAIL PROTECTED]] > > I have noticed that <?= works just as well as <%=. Since this is not > > in documentation, how safe is it to use it? > > Arcady Genkin
Arcady Genkin wrote: > I have noticed that <?= works just as well as <%=. Since this is not > in documentation, how safe is it to use it? Pretty safe, I think. Possibly even safer than those asp-style tags, regarding possible changes in the future. Wagner -- Sanity is calming, but madness is more interesting.
My understanding is : 1. <?= is essentially php4+ specific 2. Will not work if short_tags_open setting is off (in php.ini) because of the fact that <? is a short tag. Regarding its relation to the ASP counterpart, it is not directly related to <%= as that is an ASP tag which refers to the asp_tags setting which if on, <%= will work, if not on, it will not. Information and references to this can be found here : http://www.php.net/manual/language.basic-syntax.php http://www.php.net/manual/en/configuration.php#ini.asp-tags http://www.php.net/manual/en/configuration.php#ini.short-open-tag I've personally never tried asp tags. Earlier within this thread , the following php internals were posted by Jim Winstead : http://cvs.php.net/viewcvs.cgi/php3/language-scanner.lex.diff?r1=1.3&r2=1.4 http://cvs.php.net/viewcvs.cgi/php3/language-scanner.lex.diff?r1=1.6&r2=1.7 All in all, if others will be playing with your scripts, don't use asp style as usually this is usually turned off. Use of <?= is mildly dangerous (and debated, my view is 'bad') to use given the reasons above. Philip Olson http://www.cornado.com/ On 13 Jan 2001, Arcady Genkin wrote: > I have noticed that <?= works just as well as <%=. Since this is not > in documentation, how safe is it to use it? > > Many thanks, > -- > Arcady Genkin > Don't read everything you believe. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I was always using pws until recently when I got Apache for windows. Unfortunately when apache gets to a php file it doesnt parse it, it thinks its a file to download. I uncommented the php lines in the http.conf file but still no use. Does anyone know how to fix this?
> I was always using pws until recently when I got Apache for windows. = > Unfortunately when apache gets to a php file it doesnt parse it, it = > thinks its a file to download. I uncommented the php lines in the = > http.conf file but still no use. Does anyone know how to fix this? Make sure to get these lines in the right place in httpd.conf then RESTART Apache: #with the scriptaliases: scriptalias /php/ c:/php/ # where c:/php/ is your php directory! so this is a windows example! #at AddType one or more of these: AddType application/x-httpd-php .php AddType application/x-httpd-php .php3 AddType application/x-httpd-php .phtml /*I believe it can also be AddType application/x-httpd-php .php .php3 .phtml */ Action application/x-httpd-php "/php/php.exe" #Optionally add index.php to the automatically opened files (opened when link lacks filename): DirectoryIndex index.html index.php3 index.htm index.php hth, Chris -------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------
Please note that php-dev is for the developers of PHP, not scripting in PHP. With that said, you have posed a good question. To keep my description brief, comments do not hinder source code processing time enough to be considered detrimental. My limited explaination: They save enough time otherwise where it shouldn't make one bit of difference. Imagine having to write/read/maintain code that isn't commented; it would simply be a nightmare. Well commented code make things easier to understand most of the time. Just use comments in main places and when you feel that your code needs some explaination (if you're like me, you might come back the next day and wonder "Is that right?" or "How does this work?", even though you just wrote it the day before). I know the explaination's pretty short, but you get the idea. --Toby <znip>
You have to call setcookie() before anything is outputted....that was it sounds like. SL.
> Date: Thu, 11 Jan 2001 19:41:34 -0500 (EST) > From: Ignacio Vazquez-Abrams <[EMAIL PROTECTED]> > > emacs sucks! vi forever! :P > > -- > Ignacio Vazquez-Abrams <[EMAIL PROTECTED]> Hey, guy, please, be delicate, I love it, it's my wife. vi is my brother -- -Michael
"Mark Maggelet" ... > I think you missed something: > > <? > while (fetch_row_from_query()){ > $output = data_from_fetched_row(); > $more_output = more_data_from_fetched_row();?> > <TR> > <TD><?echo $output?></TD> > <TD><?echo $more_output?></TD> > </TR> > <?}?> > </TABLE> > tell me that's not easier on your eyes :) Yes, but i wrote that because the way i learned PHP... As i learnt from the manual, i thought that a while() loop could have 2 different sintax: while($something) { do_something(); } while($something): ?> some html goes here <? endwhile; And i tought that the embedded html has to be just embedded html, and that i had to put ?> <? that way... (i finnaly used the { } way) But now, i see that PHP is much more flexible than i tought... <? and ?> just "turn on and off" PHP parsing & executing, something outside <? ?> can be thought as just echoed... <? ?> quotes have nothing to do with loop sintax as they are just ignored... I've really caught the idea of how <? ?> works with loops.
"Alex Black" ... > > <? > > connect_to_database(); > > parse_query(); > > execute_query(); > > > > echo "<TABLE>"; > > > > while (fetch_row_from_query()) > > { > > $output = data_from_fetched_row(); > > $more_output = more_data_from_fetched_row(); > > > > echo "<TR><TD> $output </TD><TD> $more_output </TD></TR>"; > > > > } > > echo "</TABLE>"; > > ?> > > Well, this may be a bit specific, but that is probably part of your problem. > You have no structure associated with your application design: > > what are you doing making a connection to a database on the same page you > spit out the results from? Nonononono... that was just an example. My real code looks more like this example: ------------- <? include "common_head.php"; echo "<SPAN CLASS='title'>Welcome to blah blah section</SPAN>"; echo "<TABLE><TR><TD>Name</TD><TD>Email</TD></TR>"; $query=ociparse($conection,"select name,email from people where blah blah blah"); ociexecute($query); while (ocifetch($query)) { $name=ociresult($query,"NAME"); $email=ociresult($query,"EMAIL"); echo "<TR><TD>$name</TD><TD>$email</TD></TR>"; } ocifreecursor($query); // optional include "common_footer.php"; ?> -------------- In common_head.php i have the conect-to-database functions, and because the way include() works, i can happily use $connection in the main code. It also makes a login&password comprobation, getting data from cookies and the stuff. common_head.php also has a main component: the UPPER WEB DESIGN. That means that the upper logo, left-side menus, CSS links, common javascript code and stuff is also stored there. common_footer just has the bottom part of the design - bottom common links, and lots of well measured </TABLE> closings. The trick is tell the web designer to work the main common design in dreamweaver or so, then pick the HTML code, and separate it in "upper" and "bottom"... in the middle of that you have the space to put whatever you are spitting out from the DB. And aside from that, i don't have a one and only common_head.php ... i have a separate plain common head, in plain HTML... the real common_head.php should look like (definitively not real PHP sintax): ------------ <? connect_to_database(); do_cookie_stuff(); // First of spitting any HTML, // you get from cookies, make comprobations, // and re-store cookies or whatever... // This do_cookie_stuff can be a little hard. include "plain_html_head.php"; ?> ---------------- That way, your dreamweaver expert can design the main design (better with some stupid test text in the place of the spitted-out-from-database-data), and you as PHPer only have to cut out the HTML code (not a really hard work) into two parts. As i see, it can work perfectly this way. How you format the spitted data and stuff is another matter.... but anyway, getting the code that dreamweaver generates and implementing it shouldn't be a real hard task. -- _ Iván Sánchez Ortega "MR" /|/| |_> (eme)(erre)(punto)(arroba)wanadoo.es / | | | \ / | \ No, mamá, no toques ese cab#@@%%## [NO CARRIER]
Yo, Anyone know of a cfg option that would make files written by php be a different user/group than the apache server user/group? With my current setup, the only way to give php write access also allows any surfer write access to that same folder...which is "not a good thing". Thanks, SL.
>Anyone know of a cfg option that would make files written >by php be a different user/group than the apache server user/group? You could run PHP as a CGI wrapped by suExec (http://apache.org) -- Be sure not to use --with-safe-mode, as suExec and Safe Mode do mostly the same thing, but they fight with each other trying to do it, and it pukes. (Symptom: You get the PHP binary dumped to your browser.) >With my current setup, the only way to give php write access also >allows any surfer write access to that same folder...which is "not a good thing". No. You can write it to a directory *OUTSIDE* the web tree which is writable by the user 'nobody'. On most Un*x boxes, /tmp is nobody-writable, so that might be a good place to put the files. What you do with them after that... Well, it depends on what you're trying to do... If you want to use PHP as a Module for performance reasons, you pretty much need to put some serious though in how to do this -- The problem being that PHP runs as a nobody user, and if you make it possible for nobody to create/write files/directories, there is danger.
create a dir called tmp in de dir where de script runs chmod 777 that dir and the run the script again .. -- If it can be dreamt, it can be build "andreas (@work)" <[EMAIL PROTECTED]> wrote in message 003501c07ce5$41a15120$fe78a8c0@devel01">news:003501c07ce5$41a15120$fe78a8c0@devel01... hi list, sorry, but we cant manage a Load Data Infile cause we always get: Can't get stat of '/tmp/phpNNAQSM' (Errcode: 2) OUR Code is working fine in different project where safe_mode = OFF ============================= heres the line where we try to move the file to a webfolder in our directory move_uploaded_file ($textfile, "/home/sites/site2/web/Tango/tmp/mySql.txt"); chmod("/home/sites/site2/web/Hafele/tmp/mySql.txt", 0644); ============================= any ideas for us ? is there a way that we can set the upload_tmp_dir path in a .htaccess file ? thank you andreas
Hi.. How can I send a browser a "404 not found" page? I tried putting this in a script: header("Status: 404 Not Found"); exit; before any other output, but i keep getting the standard page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD> <BODY></BODY></HTML> from php. any ideas? jamie burns.
ahhh, cracked it ;) header("HTTP/1.1 404 Not Found"); echo('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'); exit; will produce the nice IE 404 error document... in fact, echoing anything under a certain size, after the header, seems to get IE to do its thing. Jamie Burns. ----- Original Message ----- From: "Jamie Burns" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 13, 2001 11:49 PM Subject: [PHP] Send browser a 404 not found header? Hi.. How can I send a browser a "404 not found" page? I tried putting this in a script: header("Status: 404 Not Found"); exit; before any other output, but i keep getting the standard page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD> <BODY></BODY></HTML> from php. any ideas? jamie burns.
Hi, I'm having a problem with one of the PHP scripts I've written and I'm hoping someone can point me in the right direction. The portion of the script that is giving me trouble is the locking of, and writing to, a logfile (plain text). I'm using flock() as I understand it and have looked at the online manual page for it to no avail... What's happening is, under "high" traffic conditions on the website I wrote the script for, the logfile is occasionally getting clobbered. I tried one of the suggestions on the man page (the one by [EMAIL PROTECTED]), but it resulted in the logfile being appended to, rather than properly updated as I want. (better than being clobbered, but rather confusing to cleanup after later...) Here is an example snippit of the script. Can anyone tell me what I might be doing wrong, or suggest a better/more efficient way to write this? <BEGIN CODE SNIP> if (@fopen($dlfile, "r")) { $log_entries = file($download_log); $total = count($log_entries); $dl_time = time(); for ($i=0; $total>$i; $i++) { $split = explode("||", $log_entries[$i]); if ($stats_url == $split[1]) { // If the file being downloaded is already in the logfile, // increment the download count and update the $dl_time $fp = fopen($download_log, "r"); flock($fp,1); $x = fread($fp, filesize($download_log)); fclose($fp); $fp = fopen($download_log, "w"); flock($fp,2); // Increment download counter $add = $split[0]+1; // Do the actual update of the download count & latest dl time $x = str_replace("$split[0]||$split[1]||$split[2]||$split[3]||$split[4]||", "$add||$split[1]||$split[2]||$dl_time||$split[4]||", $x); fwrite($fp, $x); fclose($fp); $write = 1; } } if ($write != 1) { // The file being downloaded is not in the logfile -- // add it now and start its counter at 1 $fp = fopen($download_log, "a"); flock($fp,2); $fw = fwrite($fp, "1||$stats_url||$dl_time||$dl_time||dir2=$dir2&file=$urlfile||\n"); fclose($fp); } } <END CODE SNIP> Thanks...I'm desperate... - Jamie -- The sweetest cherry in an apple pie <[EMAIL PROTECTED]> (Single purpose Email address)
Hello 10,000 Screaming Monkeys, (Sorry, I couldn't resist!) You should test the return value of flock(), not just run it. It is designed to tell you whether or not something is safe to do, and since you are not testing the result, you are simply ignoring what it is trying to tell you. I have a small script that uses flock(): http://www.nirvani.net/software/dr-fun/ As you can see, I am testing the result, and taking an action (in this case, sleeping, then trying again). Hope this helps. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Sat, 13 Jan 2001, 10,000 Screaming Monkeys wrote: > Date: Sat, 13 Jan 2001 17:54:31 -0600 > From: "10,000 Screaming Monkeys" <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: [PHP] problem using flock() > > Hi, > > I'm having a problem with one of the PHP scripts I've written and I'm > hoping someone can point me in the right direction. The portion of > the script that is giving me trouble is the locking of, and writing to, > a logfile (plain text). I'm using flock() as I understand it and have > looked at the online manual page for it to no avail... > > What's happening is, under "high" traffic conditions on the website I > wrote the script for, the logfile is occasionally getting clobbered. I > tried one of the suggestions on the man page (the one by > [EMAIL PROTECTED]), but it resulted in the logfile being appended to, > rather than properly updated as I want. (better than being clobbered, > but rather confusing to cleanup after later...) > > Here is an example snippit of the script. Can anyone tell me what I > might be doing wrong, or suggest a better/more efficient way to write > this? > > <BEGIN CODE SNIP> > if (@fopen($dlfile, "r")) { > > $log_entries = file($download_log); > $total = count($log_entries); > $dl_time = time(); > > for ($i=0; $total>$i; $i++) { > $split = explode("||", $log_entries[$i]); > > if ($stats_url == $split[1]) { > // If the file being downloaded is already in the logfile, > // increment the download count and update the $dl_time > > $fp = fopen($download_log, "r"); > flock($fp,1); > $x = fread($fp, filesize($download_log)); > fclose($fp); > > $fp = fopen($download_log, "w"); > flock($fp,2); > > // Increment download counter > $add = $split[0]+1; > > // Do the actual update of the download count & latest dl time > $x = str_replace("$split[0]||$split[1]||$split[2]||$split[3]||$split[4]||", >"$add||$split[1]||$split[2]||$dl_time||$split[4]||", $x); > > fwrite($fp, $x); > > fclose($fp); > $write = 1; > } > > } > if ($write != 1) { > > // The file being downloaded is not in the logfile -- > // add it now and start its counter at 1 > > $fp = fopen($download_log, "a"); > flock($fp,2); > $fw = fwrite($fp, >"1||$stats_url||$dl_time||$dl_time||dir2=$dir2&file=$urlfile||\n"); > fclose($fp); > > } > } > <END CODE SNIP> > > Thanks...I'm desperate... > > - Jamie > > -- > The sweetest cherry in an apple pie > <[EMAIL PROTECTED]> (Single purpose Email address) > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
[EMAIL PROTECTED] wrote: > I looked around the web for templates and founf FastTemplates. Not exactly > what i was looking for thoug > lets say I have > $file = "111" > and there is a template "template.txt" > and it contains > "file #$file is blahlah" > > how can I make that a template? > > Thanks > - Peter > Any reason 'template.txt' couldn't just say file $<?=$file;?> is blahlah then include('template.txt'); in your main file? Not sure why you'd want to complicate things with something like FastTemplates - I understand it has a use and purpose, but the only long term benefit I see from involved schemes like that won't be realized anyway (discussion for another day).
Michael, Wouldn't a benefit be that you could pass a database query in via that variable, either via form submit or value of a clicked link? I know PHP can do this without a separate templating engine, but if you do use one then you can submit an array to a specific template. Is there a way to do this via built in functions without constructing the set of page object's first, or can you only do this in templates? regards, andrew On 1/13/01 7:06 PM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > >> I looked around the web for templates and founf FastTemplates. Not exactly >> what i was looking for thoug >> lets say I have >> $file = "111" >> and there is a template "template.txt" >> and it contains >> "file #$file is blahlah" >> >> how can I make that a template? >> >> Thanks >> - Peter >> > > Any reason 'template.txt' couldn't just say > > file $<?=$file;?> is blahlah > > then include('template.txt'); in your main file? > > Not sure why you'd want to complicate things with > something like FastTemplates - I understand it has a use > and purpose, but the only long term benefit I see from > involved schemes like that won't be realized anyway > (discussion for another day). > > >
I thought I understood your question, but I think I need a clarification. Can you elaborate a bit? I think I have an answer, but I'm not 100% what you're meaning here. Thanks. andrew wrote: > Michael, > > Wouldn't a benefit be that you could pass a database query in via that > variable, either via form submit or value of a clicked link? > > I know PHP can do this without a separate templating engine, but if you do > use one then you can submit an array to a specific template. Is there a way > to do this via built in functions without constructing the set of page > object's first, or can you only do this in templates? > > regards, > andrew > > On 1/13/01 7:06 PM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote: > > > > > > > [EMAIL PROTECTED] wrote: > > > >> I looked around the web for templates and founf FastTemplates. Not exactly > >> what i was looking for thoug > >> lets say I have > >> $file = "111" > >> and there is a template "template.txt" > >> and it contains > >> "file #$file is blahlah" > >> > >> how can I make that a template? > >> > >> Thanks > >> - Peter > >> > > > > Any reason 'template.txt' couldn't just say > > > > file $<?=$file;?> is blahlah > > > > then include('template.txt'); in your main file? > > > > Not sure why you'd want to complicate things with > > something like FastTemplates - I understand it has a use > > and purpose, but the only long term benefit I see from > > involved schemes like that won't be realized anyway > > (discussion for another day). > > > > > >
Sure, My understanding of templating engines 1.array or item is assigned to a variable 2.php placeholders in a html page match in name to above variable. 3.a parser separate from php subsitutes the variable values set in (1) into (2) I've seen plenty of examples where there is a file containing lists of variable to item assignment, and thase files are passed to a one of a few template pages for layout. There must be a way to pass the result set of an SQL query into the set of placeholders - the end result would be that you could call whole sites via simple queries. All you have to pass in would be the SQL parameter. i.e. Table named 'Pvalues' Pvalues Sample Row ---- ------ page_id contactus.html page_name Contact Us page_title Contact US header_text Please send an email body_text [EMAIL PROTECTED] footer_text thanks! You can even generate a list of links dynamically for nav bar via: "select page_name, page_id from Pvalues", if you account for performance issues. If the usre clicks on the "contact us" link, it returns a page_id value of contactus.html. So then: "select * from Pvalues where page_id = "contactus.html" Then call a templating parser and pass it the values of the select statement and which template to use. Can this be done, or I am way off base on this? regards, andrew On 1/13/01 7:27 PM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote: > I thought I understood your question, but I think I need a clarification. > Can you elaborate a bit? I think I have an answer, but I'm not 100% what > you're meaning here. > > Thanks. > > > andrew wrote: > >> Michael, >> >> Wouldn't a benefit be that you could pass a database query in via that >> variable, either via form submit or value of a clicked link? >> >> I know PHP can do this without a separate templating engine, but if you do >> use one then you can submit an array to a specific template. Is there a way >> to do this via built in functions without constructing the set of page >> object's first, or can you only do this in templates? >> >> regards, >> andrew >> >> On 1/13/01 7:06 PM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote: >> >>> >>> >>> [EMAIL PROTECTED] wrote: >>> >>>> I looked around the web for templates and founf FastTemplates. Not exactly >>>> what i was looking for thoug >>>> lets say I have >>>> $file = "111" >>>> and there is a template "template.txt" >>>> and it contains >>>> "file #$file is blahlah" >>>> >>>> how can I make that a template? >>>> >>>> Thanks >>>> - Peter >>>> >>> >>> Any reason 'template.txt' couldn't just say >>> >>> file $<?=$file;?> is blahlah >>> >>> then include('template.txt'); in your main file? >>> >>> Not sure why you'd want to complicate things with >>> something like FastTemplates - I understand it has a use >>> and purpose, but the only long term benefit I see from >>> involved schemes like that won't be realized anyway >>> (discussion for another day). >>> >>> >>> >
I'm sure it could be done, just with a bit of planning. The notion of passing in sql results is not foreign - we do it sometimes to our own 'templates', but our templates are generally just HTML with a bit of PHP in there, whereas the initial PHP page is PHP with a tiny bit of HTML. If there's a large result set that needs parsing through, we'll normally do it in the PHP code, and write the results out to a variable, substituted in the 'template'. You could instead have a 'template system' or php itself loop through that in the 'template' itself - whichever makes more sense to the end coders. I'd THINK you could do what you wanted with an array $sql = one row of SQL results, in a has. Passing $sql to the template, you could then have $sql["page_id"] $sql["page_name"] etc. Pulling stuff from the database drivers into an associate array would do this - is this what you're talking about? andrew wrote: > Sure, > > My understanding of templating engines > 1.array or item is assigned to a variable > 2.php placeholders in a html page match in name to above variable. > 3.a parser separate from php subsitutes the variable values set in (1) > into (2) > > I've seen plenty of examples where there is a file containing lists of > variable to item assignment, and thase files are passed to a one of a few > template pages for layout. > > There must be a way to pass the result set of an SQL query into the set of > placeholders - the end result would be that you could call whole sites via > simple queries. All you have to pass in would be the SQL parameter. > > i.e. Table named 'Pvalues' > > Pvalues Sample Row > ---- ------ > page_id contactus.html > page_name Contact Us > page_title Contact US > header_text Please send an email > body_text [EMAIL PROTECTED] > footer_text thanks! > > You can even generate a list of links dynamically for nav bar via: > > "select page_name, page_id from Pvalues", if you account for performance > issues. > > If the usre clicks on the "contact us" link, it returns a page_id value of > contactus.html. So then: > > "select * from Pvalues where page_id = "contactus.html" > > Then call a templating parser and pass it the values of the select statement > and which template to use. > > Can this be done, or I am way off base on this? > > regards, > andrew
Yup, I believe so - I've been wrestling with this idea for a while and trying to figure out how to integrate it into the parser explained in a PHPBuilder Article on Cached Modules: http://www.phpbuilder.net/columns/jprins20000201.php3 In the above, I think the point is to create little block templates on a page, that can essentially return html. Now, the article mostly covers how to cache this for peformance reasons, but integrating FastTemplates with it in the manner below makes sense. Are you doing something similar? regards, andrew On 1/13/01 8:37 PM, "Michael Kimsal" <[EMAIL PROTECTED]> wrote: > I'm sure it could be done, just with a bit of planning. > > The notion of passing in sql results is not foreign - we do it > sometimes to our own 'templates', but our templates are generally > just HTML with a bit of PHP in there, whereas the initial PHP page > is PHP with a tiny bit of HTML. If there's a large result set that needs > parsing through, we'll normally do it in the PHP code, and write the results > out to > a variable, substituted in the 'template'. You could instead have a 'template > system' or php itself loop through that in the 'template' itself - whichever > makes > more sense to the end coders. > > I'd THINK you could do what you wanted with an array > > $sql = one row of SQL results, in a has. > > Passing $sql to the template, you could then have > $sql["page_id"] > $sql["page_name"] > etc. > > Pulling stuff from the database drivers into an associate array would do this > - > is this what you're talking about? > > > andrew wrote: > >> Sure, >> >> My understanding of templating engines >> 1.array or item is assigned to a variable >> 2.php placeholders in a html page match in name to above variable. >> 3.a parser separate from php subsitutes the variable values set in (1) >> into (2) >> >> I've seen plenty of examples where there is a file containing lists of >> variable to item assignment, and thase files are passed to a one of a few >> template pages for layout. >> >> There must be a way to pass the result set of an SQL query into the set of >> placeholders - the end result would be that you could call whole sites via >> simple queries. All you have to pass in would be the SQL parameter. >> >> i.e. Table named 'Pvalues' >> >> Pvalues Sample Row >> ---- ------ >> page_id contactus.html >> page_name Contact Us >> page_title Contact US >> header_text Please send an email >> body_text [EMAIL PROTECTED] >> footer_text thanks! >> >> You can even generate a list of links dynamically for nav bar via: >> >> "select page_name, page_id from Pvalues", if you account for performance >> issues. >> >> If the usre clicks on the "contact us" link, it returns a page_id value of >> contactus.html. So then: >> >> "select * from Pvalues where page_id = "contactus.html" >> >> Then call a templating parser and pass it the values of the select statement >> and which template to use. >> >> Can this be done, or I am way off base on this? >> >> regards, >> andrew > >
Do you have <?php and ?> in your .inc file?... ----- Original Message ----- From: Ted Goranson <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Saturday, January 13, 2001 12:35 AM Subject: [PHP] ereg works in .php, not in .inc > Friends-- > > I have a script that processes another script for display. I change > all variables named similar to "$Help1x1" to Help: > > The following line accomplishes this readily when used in a .php > suffixed script when called directly from browser. > > $content = ereg_replace ("[\$]Help[0-9]x[a-z]? =", > "<STRONG>Help:</STRONG>", $content); > > However, if I instead call a .php script that includes an .inc with > this command, it doesn't work. If important, the entire script is > below. Sometimes, the last two str_replace lines also fail from .inc. > > Is this something simple that I'm missing? > > Best, Ted > > <?php > > $fp = fopen("/usr/local/apache/php/Level1Questions.inc", "r"); > $content = fread($fp, 100000); > $content = str_replace ("//", "", $content); > $content = str_replace ("<?php", "", $content); > $content = str_replace ("?>", "", $content); > $content = str_replace ("**", "<BR><BR>", $content); > $content = str_replace ("Question:", "<STRONG>Question:</STRONG>", $content); > $content = str_replace ("Answer:", "<STRONG>Answer:</STRONG>", $content); > $content = str_replace ("Answers:", "<STRONG>Answers:</STRONG>", $content); > $content = str_replace ("@@@", "</STRONG></P>", $content); > $content = str_replace ("@@", "<P align=center><STRONG>", $content); > $content = str_replace ("++++++", "<HR>", $content); > $content = ereg_replace ("[\$]Help[0-9]x[a-z]? =", > "<STRONG>Help:</STRONG>", $content); > $content = ereg_replace ("[\$]BigHelp[0-9]x[0-9] =", > "<STRONG>TEXT:</STRONG>", $content); > > echo "$content"; > > ?> > _____________ > Ted Goranson > Fusecap and Sirius-Beta, Virginia Beach USA > 757/426-6704 > [EMAIL PROTECTED] > Symmetry Conference: http://www.isis-s.unsw.edu.au > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
If you're smart enough to edit a spec file, you could just compile from source... :-) ----- Original Message ----- From: "Michael A. Peters" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Saturday, January 13, 2001 12:36 AM Subject: [PHP] Problem building php 3.0.18 > Howdy- > > I'm having a slight problem when attempting to build php 3.0.18 > > First of all I'd like to say the rpm spec file I inherited for this is a > mess- I may clean it up (likely start from scratch...), but the spec > file I'm using isn't the issue. > > mod_php builds just dandy- but I get bad linking errors when attempting > to build the calendar.so and crypt.so modules. > > here's the problem: > cd dl > ./setup > > make 'CFLAGS=-I/usr/include/apache -I. -I../' calendar.so crypt.so > gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o > calendar/calendar.o calendar/calendar.c > gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o calendar/dow.o > calendar/dow.c > gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o > calendar/french.o calendar/french.c > gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o > calendar/gregor.o calendar/gregor.c > gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o > calendar/jewish.o calendar/jewish.c > gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o > calendar/julian.o calendar/julian.c > gcc -I/usr/include/apache -I. -I../ -DCOMPILE_DL=1 -c -o > calendar/easter.o calendar/easter.c > ld -o calendar.so calendar/calendar.o calendar/dow.o calendar/french.o > calendar/gregor.o calendar/jewish.o calendar/julian.o calendar/easter.o > ld: warning: cannot find entry symbol _start; defaulting to 08048080 > calendar/calendar.o: In function `cal_jdtogreg': > calendar/calendar.o(.text+0x29): undefined reference to `getParameters' > calendar/calendar.o(.text+0x42): undefined reference to > `convert_to_long' > yada (more errors of same) > > This spec file is known to build php-3.0.16 no problem. > The spec file build 3.0.18 if I comment out the attempts to build > calendar.so and crypt.so- including all the other *so modules (mysql.so, > pgsql.so, gd.so, yada yada) > > Issue happens on both glibc 2.2 (red hat 7.0) and glibc 2.1.3 (rh 6.2) > Compiler on both is gcc 2.95.3, ld on RH7 is gnu ld 2.10.90 (not sure on > rh6) > > Anyone know what the issue is? > > my spec file can be viewed at http://24.5.29.77/SPECS/mod_php3.spec if > anyone cares to take a look. (NOTE- in that spec file, I currently have > the problem areas commented out so it would build.) > -=-=-=-=-=-=-=-=-=-=-=-=- > Michael A. Peters > Abriasoft Senior Developer > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
You do it just like you would do a select: $query = "insert into blah(field1, field2) values($value1, '$value2')"; odbc_exec($connection,$query) or die(odbc_error()); There's nothing special about any particular kind of query you send to the database. Disclaimer: I don't know that I got the function names right, or even that odbc_error exists... ----- Original Message ----- From: Diego Pérez Rández <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Saturday, January 13, 2001 4:23 AM Subject: [PHP] Put data in a odbc connect > > Hi to all: > > I want to put data in a database that i access by a odbc connect. I > can obtain data of the odbc connect, but i can't put data in it. > > How i can do it?. > > Thanks. > > Best Regards, > > Diego > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I'v run into a wall when trying to build php_gd.dll. I have built gd.lib (gd-1.8.3) with PNG support (libpng-1.0.8): % nmake gd.lib /f makefile.nt and except two warnings, all seemed well: gd_io.c(145) : warning C4028: formal parameter 2 different from declaration gdkanji.c(385) : warning C4033: 'do_convert' must return a value now I entered MSDEV, loaded php_modules.dsw, added the gd directory to lib and include paths, and built php_gd.dll. This resulted in two errors: (...)\ext\gd\gd.c(729) : error C2065: 'gdImageCreateFromPng' : undeclared identifier (...)\ext\gd\gd.c(875) : error C2065: 'gdImagePng' : undeclared identifier I'm stuck. ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. [EMAIL PROTECTED]
I need to create files and reports for importation into QuickBooks, but they need to be in the IIF file format that QuickBooks supports.... where can I find information for creating these files?
I need to know how to be able to eliminate the querysting portion of the URL that is displayed on the users browser. I don't want it possible to click refresh and reenter in the same querystring that was used previously (eg. php runs a mysql query of INSERT based on the querystring which only should be run once no matter how many times they click refresh).