|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Wed May 15 2002 - 06:46:19 CDT
php-general Digest 15 May 2002 11:46:19 -0000 Issue 1346
Topics (messages 97633 through 97696):
Re: Sessions Without Cookies or SID Passing...
97633 by: Miguel Cruz
97634 by: Matthew Walker
97635 by: Matthew Walker
97636 by: Rasmus Lerdorf
97638 by: Miguel Cruz
97641 by: Martin Towell
97643 by: Matthew Walker
97644 by: Rasmus Lerdorf
97645 by: Rasmus Lerdorf
97647 by: Mark Charette
97649 by: Vail, Warren
97652 by: Matthew Walker
97653 by: David Freeman
Re: Storing a object in the session??
97637 by: Brad Hubbard
PHP 4.2x changes
97639 by: Weston Houghton
97646 by: Rasmus Lerdorf
97655 by: Matthew Walker
97663 by: Philip Olson
97668 by: Weston Houghton
97669 by: Rasmus Lerdorf
97670 by: Weston Houghton
97672 by: Rasmus Lerdorf
php fgets()
97640 by: arnaud gonzales
inserting PHP code into PHP document
97642 by: PR
97650 by: David Robley
Re: Load data infile
97648 by: Dennis Moore
Accented characters in Emails
97651 by: Jean-Francois Lavoie
Re: Cool PHP Tricks/Features ?
97654 by: SP
97657 by: John Holmes
97661 by: Sqlcoders.com Programming Dept
97676 by: Girish Nath
97685 by: Danny Shepherd
Using PHP on Windows for the first time
97656 by: Bob Strasser
97658 by: John Holmes
97659 by: Justin French
97664 by: Steve Buehler
Uploading JPEG's - Security Issues?
97660 by: Andre Dubuc
97662 by: Rasmus Lerdorf
WTF
97665 by: mail-list
97666 by: Rasmus Lerdorf
php and jpgraph
97667 by: Maciej Przybycien
Collecting data from sockets
97671 by: Demitrious Kelly
Apache does not work with PHP
97673 by: Vivek Kumar Agrawal
97674 by: Rasmus Lerdorf
Strange Delay with Swf file (newbie)
97675 by: simos
PhP 4.2.1 (and various)
97677 by: Olav Bringedal
97679 by: Analysis & Solutions
97687 by: Vincent Oostindie
97690 by: Olav Bringedal
More 4.2.1 (Note to myself:think before pressing send!)
97678 by: Olav Bringedal
php & performance
97680 by: Michal Dvoracek
how to get to POST request from PHP?
97681 by: peter tatischev
Re: Newbie challenge to brainiacs
97682 by: Josh Edwards
Re: array_search in 2-d arrays
97683 by: Tim Ward
Session destroy/close
97684 by: Ake
can't upload files
97686 by: Diana Castillo
97696 by: Jason Wong
counting max word length fails on line brake
97688 by: andy
Newbie - Spot the error
97689 by: Josh Edwards
97691 by: Olav Bringedal
97693 by: Josh Edwards
Re: DOMXML in 4.2.0 problems
97692 by: Danny Shepherd
byte order of integers
97694 by: John Horton
HTTPS spoofing and $_SERVER
97695 by: George Whiffen
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Tue, 14 May 2002, Matthew Walker wrote:
> Many of the people who will be shopping on our sites have cookies
> disabled, which presents a problem when using sessions. Now, I am aware
> of the fact that we could append the SID constant to every URL, but this
> will not work for us. None of our sites are dynamic, and updating them
> is out of the question (We have over 100 sites). As well, someday we
> intend to sell this software, and we don't want to require that people
> make their sites fully dynamic to accommodate it.
I don't entirely understand. If your site is not dynamic, then what do you
need sessions for?
miguel
attached mail follows:
The sites are not dynamic, but the shopping cart /is/. The problem is,
if people don't have cookies on, when they return to the site to order
more products, they loose the SID that has been appended to the links
inside the cart, and thus loose the contents of their shopping cart.
Matthew Walker
Senior Software Engineer
ePliant Marketing
-----Original Message-----
From: Miguel Cruz [mailto:mnc
stoic.net]
Sent: Tuesday, May 14, 2002 5:48 PM
To: php-general
lists.php.net
Subject: Re: [PHP] Sessions Without Cookies or SID Passing...
On Tue, 14 May 2002, Matthew Walker wrote:
> Many of the people who will be shopping on our sites have cookies
> disabled, which presents a problem when using sessions. Now, I am
aware
> of the fact that we could append the SID constant to every URL, but
this
> will not work for us. None of our sites are dynamic, and updating them
> is out of the question (We have over 100 sites). As well, someday we
> intend to sell this software, and we don't want to require that people
> make their sites fully dynamic to accommodate it.
I don't entirely understand. If your site is not dynamic, then what do
you
need sessions for?
miguel
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
attached mail follows:
You're not understanding the problem. This is not an authentication situation. We are using sessions to track information about what a customer's OrderID is, and other related information.
Matthew Walker Senior Software Engineer ePliant Marketing
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus
php.net]
Sent: Tuesday, May 14, 2002 5:42 PM
To: Matthew Walker
Cc: php-general
lists.php.net
Subject: Re: [PHP] Sessions Without Cookies or SID Passing...
Use standard HTTP authentication over SSL - that's the only other way.
On Tue, 14 May 2002, Matthew Walker wrote:
> We have a shopping cart product we're developing in PHP, and I've > recently come across I dilemma that I need to find a reliable solution > to. > > Many of the people who will be shopping on our sites have cookies > disabled, which presents a problem when using sessions. Now, I am aware > of the fact that we could append the SID constant to every URL, but this > will not work for us. None of our sites are dynamic, and updating them > is out of the question (We have over 100 sites). As well, someday we > intend to sell this software, and we don't want to require that people > make their sites fully dynamic to accommodate it. > > So, is there any reliable way to emulate sessions without requiring a > cookie, or a variable passed in every URL? > > Matthew Walker > Senior Software Engineer > ePliant Marketing > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
attached mail follows:
I am understanding the problem perfectly. HTTP is stateless. You want to maintain state accross requests. This is done in 3 different ways.
1. Cookies 2. URL Mangling 3. HTTP Authentication
You said you did not want to do 1 or 2. That only leaves you with HTTP Authentication. HTTP Authentication is really just like a cookie that can't be disabled when it comes down to it.
-Rasmus
On Tue, 14 May 2002, Matthew Walker wrote:
> You're not understanding the problem. This is not an authentication
> situation. We are using sessions to track information about what a
> customer's OrderID is, and other related information.
>
> Matthew Walker
> Senior Software Engineer
> ePliant Marketing
>
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: Tuesday, May 14, 2002 5:42 PM
> To: Matthew Walker
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] Sessions Without Cookies or SID Passing...
>
> Use standard HTTP authentication over SSL - that's the only other way.
>
> On Tue, 14 May 2002, Matthew Walker wrote:
>
> > We have a shopping cart product we're developing in PHP, and I've
> > recently come across I dilemma that I need to find a reliable solution
> > to.
> >
> > Many of the people who will be shopping on our sites have cookies
> > disabled, which presents a problem when using sessions. Now, I am
> aware
> > of the fact that we could append the SID constant to every URL, but
> this
> > will not work for us. None of our sites are dynamic, and updating them
> > is out of the question (We have over 100 sites). As well, someday we
> > intend to sell this software, and we don't want to require that people
> > make their sites fully dynamic to accommodate it.
> >
> > So, is there any reliable way to emulate sessions without requiring a
> > cookie, or a variable passed in every URL?
> >
> > Matthew Walker
> > Senior Software Engineer
> > ePliant Marketing
> >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>
>
attached mail follows:
On Tue, 14 May 2002, Matthew Walker wrote: > The sites are not dynamic, but the shopping cart /is/. The problem is, > if people don't have cookies on, when they return to the site to order > more products, they loose the SID that has been appended to the links > inside the cart, and thus loose the contents of their shopping cart.
I think you are running into facts of life here. You can only keep track of people using a limited set of mechanisms (which Rasmus has listed).
Perhaps with cunning design you could use frames and JavaScript to handle this but it's outside the scope of PHP.
miguel
attached mail follows:
You're missing one method - using the user's IP address It's not a guaranteed fool-proof method, but if you don't want to use cookies or the URL, then this sorta works.
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus
php.net]
Sent: Wednesday, May 15, 2002 10:04 AM
To: Matthew Walker
Cc: php-general
lists.php.net
Subject: RE: [PHP] Sessions Without Cookies or SID Passing...
I am understanding the problem perfectly. HTTP is stateless. You want to maintain state accross requests. This is done in 3 different ways.
1. Cookies 2. URL Mangling 3. HTTP Authentication
You said you did not want to do 1 or 2. That only leaves you with HTTP Authentication. HTTP Authentication is really just like a cookie that can't be disabled when it comes down to it.
-Rasmus
On Tue, 14 May 2002, Matthew Walker wrote:
> You're not understanding the problem. This is not an authentication
> situation. We are using sessions to track information about what a
> customer's OrderID is, and other related information.
>
> Matthew Walker
> Senior Software Engineer
> ePliant Marketing
>
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: Tuesday, May 14, 2002 5:42 PM
> To: Matthew Walker
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] Sessions Without Cookies or SID Passing...
>
> Use standard HTTP authentication over SSL - that's the only other way.
>
> On Tue, 14 May 2002, Matthew Walker wrote:
>
> > We have a shopping cart product we're developing in PHP, and I've
> > recently come across I dilemma that I need to find a reliable solution
> > to.
> >
> > Many of the people who will be shopping on our sites have cookies
> > disabled, which presents a problem when using sessions. Now, I am
> aware
> > of the fact that we could append the SID constant to every URL, but
> this
> > will not work for us. None of our sites are dynamic, and updating them
> > is out of the question (We have over 100 sites). As well, someday we
> > intend to sell this software, and we don't want to require that people
> > make their sites fully dynamic to accommodate it.
> >
> > So, is there any reliable way to emulate sessions without requiring a
> > cookie, or a variable passed in every URL?
> >
> > Matthew Walker
> > Senior Software Engineer
> > ePliant Marketing
> >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Could you explain how this could be accomplished, because I'm not understanding how to do it.
As I understand HTTP Authentication (correct me if I'm wrong), the user's computer still has to send a 'username/password' pair to perform the authentication. I can't see how this could be used to maintain session data.
But maybe my mind is just trapped in a rut. Please enlighten me.
Matthew Walker Senior Software Engineer ePliant Marketing
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus
php.net]
Sent: Tuesday, May 14, 2002 6:04 PM
To: Matthew Walker
Cc: php-general
lists.php.net
Subject: RE: [PHP] Sessions Without Cookies or SID Passing...
I am understanding the problem perfectly. HTTP is stateless. You want to maintain state accross requests. This is done in 3 different ways.
1. Cookies 2. URL Mangling 3. HTTP Authentication
You said you did not want to do 1 or 2. That only leaves you with HTTP Authentication. HTTP Authentication is really just like a cookie that can't be disabled when it comes down to it.
-Rasmus
On Tue, 14 May 2002, Matthew Walker wrote:
> You're not understanding the problem. This is not an authentication
> situation. We are using sessions to track information about what a
> customer's OrderID is, and other related information.
>
> Matthew Walker
> Senior Software Engineer
> ePliant Marketing
>
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: Tuesday, May 14, 2002 5:42 PM
> To: Matthew Walker
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] Sessions Without Cookies or SID Passing...
>
> Use standard HTTP authentication over SSL - that's the only other way.
>
> On Tue, 14 May 2002, Matthew Walker wrote:
>
> > We have a shopping cart product we're developing in PHP, and I've
> > recently come across I dilemma that I need to find a reliable
solution
> > to.
> >
> > Many of the people who will be shopping on our sites have cookies
> > disabled, which presents a problem when using sessions. Now, I am
> aware
> > of the fact that we could append the SID constant to every URL, but
> this
> > will not work for us. None of our sites are dynamic, and updating
them
> > is out of the question (We have over 100 sites). As well, someday we
> > intend to sell this software, and we don't want to require that
people
> > make their sites fully dynamic to accommodate it.
> >
> > So, is there any reliable way to emulate sessions without requiring
a
> > cookie, or a variable passed in every URL?
> >
> > Matthew Walker
> > Senior Software Engineer
> > ePliant Marketing
> >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>
>
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
attached mail follows:
No, it doesn't work at all. All sorts of people are behind proxies. Every AOL user, for example. All these people end up showing up as the same, or at least one of a pool of a few dozen ips. If you use this methods millions of users will end up sharing the same shopping cart. That's probably not a good idea.
-Rasmus
On Wed, 15 May 2002, Martin Towell wrote:
> You're missing one method - using the user's IP address
> It's not a guaranteed fool-proof method, but if you don't want to use
> cookies or the URL, then this sorta works.
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: Wednesday, May 15, 2002 10:04 AM
> To: Matthew Walker
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] Sessions Without Cookies or SID Passing...
>
>
> I am understanding the problem perfectly. HTTP is stateless. You want to
> maintain state accross requests. This is done in 3 different ways.
>
> 1. Cookies
> 2. URL Mangling
> 3. HTTP Authentication
>
> You said you did not want to do 1 or 2. That only leaves you with HTTP
> Authentication. HTTP Authentication is really just like a cookie that
> can't be disabled when it comes down to it.
>
> -Rasmus
>
> On Tue, 14 May 2002, Matthew Walker wrote:
>
> > You're not understanding the problem. This is not an authentication
> > situation. We are using sessions to track information about what a
> > customer's OrderID is, and other related information.
> >
> > Matthew Walker
> > Senior Software Engineer
> > ePliant Marketing
> >
> >
> > -----Original Message-----
> > From: Rasmus Lerdorf [mailto:rasmus
php.net]
> > Sent: Tuesday, May 14, 2002 5:42 PM
> > To: Matthew Walker
> > Cc: php-general
lists.php.net
> > Subject: Re: [PHP] Sessions Without Cookies or SID Passing...
> >
> > Use standard HTTP authentication over SSL - that's the only other way.
> >
> > On Tue, 14 May 2002, Matthew Walker wrote:
> >
> > > We have a shopping cart product we're developing in PHP, and I've
> > > recently come across I dilemma that I need to find a reliable solution
> > > to.
> > >
> > > Many of the people who will be shopping on our sites have cookies
> > > disabled, which presents a problem when using sessions. Now, I am
> > aware
> > > of the fact that we could append the SID constant to every URL, but
> > this
> > > will not work for us. None of our sites are dynamic, and updating them
> > > is out of the question (We have over 100 sites). As well, someday we
> > > intend to sell this software, and we don't want to require that people
> > > make their sites fully dynamic to accommodate it.
> > >
> > > So, is there any reliable way to emulate sessions without requiring a
> > > cookie, or a variable passed in every URL?
> > >
> > > Matthew Walker
> > > Senior Software Engineer
> > > ePliant Marketing
> > >
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
> Could you explain how this could be accomplished, because I'm not > understanding how to do it. > > As I understand HTTP Authentication (correct me if I'm wrong), the > user's computer still has to send a 'username/password' pair to perform > the authentication. I can't see how this could be used to maintain > session data. > > But maybe my mind is just trapped in a rut. Please enlighten me.
The problem here is not where to store the session data. That's obvious. You store the session data on your server. The real problem is linking the session data (ie. the contents of a shopping cart) to a specific user so when that same user is surfing through your site, on every request you know which cart is his. And if he goes away and comes back later, you again can go find his cart and you know what is in it.
Ergo, therefore, if you are able to uniquely identify the user you have solved your session problem. HTTP Authentication does this brilliantly. The only difference between cookies and http auth is that with a cookie you send the remote user a unique identifier that is then sent back to you whenever that specific user visits your site. Because this happens automatically and people don't like that, some people turn this off. With HTTP authentication, instead of doing this automatically you have the user create a profile on your site where part of this will include a unique identifier and a password. Each time the user visits your site this information will be sent exactly like a cookie. Depending on how users configure their browsers they may have to log in at the beginning of a session although these days most browsers have these password managers that make this login procedure trivial.
-Rasmus
attached mail follows:
If it ain't foolproof then only a fool would use it ...
IP addresses are just about the worst way to identify anyone.
-----Original Message-----
From: Martin Towell [mailto:martin.towell
world.net]
Sent: Tuesday, May 14, 2002 8:17 PM
To: 'Rasmus Lerdorf'; Matthew Walker
Cc: php-general
lists.php.net
Subject: RE: [PHP] Sessions Without Cookies or SID Passing...
You're missing one method - using the user's IP address It's not a guaranteed fool-proof method, but if you don't want to use cookies or the URL, then this sorta works.
attached mail follows:
Especially if they come through a gateway, or use internet connection sharing, you can't tell them apart using IP Addresses.
Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658
-----Original Message-----
From: Mark Charette [mailto:charette
woodwind.org]
Sent: Tuesday, May 14, 2002 5:30 PM
Cc: php-general
lists.php.net
Subject: RE: [PHP] Sessions Without Cookies or SID Passing...
If it ain't foolproof then only a fool would use it ...
IP addresses are just about the worst way to identify anyone.
-----Original Message-----
From: Martin Towell [mailto:martin.towell
world.net]
Sent: Tuesday, May 14, 2002 8:17 PM
To: 'Rasmus Lerdorf'; Matthew Walker
Cc: php-general
lists.php.net
Subject: RE: [PHP] Sessions Without Cookies or SID Passing...
You're missing one method - using the user's IP address It's not a guaranteed fool-proof method, but if you don't want to use cookies or the URL, then this sorta works.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Blah. That's a really ugly choice, but I suppose we may end up having to do that.
I'd give my kingdom for always-on cookies. Ah well. I'll look into this some more once my current project is finished. Thanks for your advice. (And thanks to everyone else too)
Matthew Walker Senior Software Engineer ePliant Marketing
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus
php.net]
Sent: Tuesday, May 14, 2002 6:26 PM
To: Matthew Walker
Cc: php-general
lists.php.net
Subject: RE: [PHP] Sessions Without Cookies or SID Passing...
> Could you explain how this could be accomplished, because I'm not > understanding how to do it. > > As I understand HTTP Authentication (correct me if I'm wrong), the > user's computer still has to send a 'username/password' pair to perform > the authentication. I can't see how this could be used to maintain > session data. > > But maybe my mind is just trapped in a rut. Please enlighten me.
The problem here is not where to store the session data. That's obvious. You store the session data on your server. The real problem is linking the session data (ie. the contents of a shopping cart) to a specific user so when that same user is surfing through your site, on every request you know which cart is his. And if he goes away and comes back later, you again can go find his cart and you know what is in it.
Ergo, therefore, if you are able to uniquely identify the user you have solved your session problem. HTTP Authentication does this brilliantly. The only difference between cookies and http auth is that with a cookie you send the remote user a unique identifier that is then sent back to you whenever that specific user visits your site. Because this happens automatically and people don't like that, some people turn this off. With HTTP authentication, instead of doing this automatically you have the user create a profile on your site where part of this will include a unique identifier and a password. Each time the user visits your site this information will be sent exactly like a cookie. Depending on how users configure their browsers they may have to log in at the beginning of a session although these days most browsers have these password managers that make this login procedure trivial.
-Rasmus
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
attached mail follows:
> You're missing one method - using the user's IP address > It's not a guaranteed fool-proof method, but if you don't > want to use cookies or the URL, then this sorta works.
Unless there's a firewall using NAT or a proxy cache involved. I know for a fact that our internal network only ever reports the address of our firewall. We run an Internet kiosk of sorts so if two or three people hit your site from inside our firewall they will all look like the same person.
We're not alone in doing this sort of thing.
CYA, Dave
attached mail follows:
On Wed, 15 May 2002 04:02, Peter Atkins did align ASCII characters thusly: > All, > > I really need help on this one... I have a class called "Profile" and I > want to store the properties of this class in the session after I give them > values shown below: > > Step 1: > > // set properties of class > $objProfile = new Profile('1', 'John', 'Doe') ; > // store object in session > $_SESSION["ProfileObj"] = $objProfile;
What's wrong with;
session_register( "objProfile" ); $objProfile = new Profile('1', 'John', 'Doe');
> This is what my session file looks like: > !SESSION|ProfileObj|O:7:"profile":5:s:7:"staffId";s:1:"1";s:9:"firstName";s >: 5:"John";s:8:"lastName";s:6:"Doe";}
Out of interest, does anyone know what the SESSION variable is and why it's not set?
> > Is there a way to store this in the session successfully and if so how can > I do access it later?
Yes, include the class declaration on every page where you wish to use the object i.e. require "profile.class.php" (and use session_start() on every page of course).
Cheers, Brad
attached mail follows:
All,
I've recently upgraded from 4.1.2 to 4.2.0. And of course my script has stopped working. I know a lot with the globals has changed, but to be honest, I am not sure how or why. Can anyone give me an initial lead as to what I should look for first?
I know I use the following elements:
$_SERVER["PATH_TRANSLATED"] $PHP_SELF
I can't believe it is $PHP_SELF. What should I be wary of when using PHP Environment vars like: $_SERVER["PATH_TRANSLATED"]
Thanks! Wes
attached mail follows:
Turn on register_globals in your php.ini file and things should start working again.
On Tue, 14 May 2002, Weston Houghton wrote:
> > All, > > I've recently upgraded from 4.1.2 to 4.2.0. And of course my script has > stopped working. I know a lot with the globals has changed, but to be > honest, I am not sure how or why. Can anyone give me an initial lead as to > what I should look for first? > > I know I use the following elements: > > $_SERVER["PATH_TRANSLATED"] > $PHP_SELF > > I can't believe it is $PHP_SELF. What should I be wary of when using PHP > Environment vars like: $_SERVER["PATH_TRANSLATED"] > > Thanks! > Wes > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Actually, it is $PHP_SELF. Try $_SERVER['PHP_SELF']
Matthew Walker Senior Software Engineer ePliant Marketing
-----Original Message-----
From: Weston Houghton [mailto:weslists
anapraxis.com]
Sent: Tuesday, May 14, 2002 6:14 PM
To: php-general
lists.php.net
Subject: [PHP] PHP 4.2x changes
All,
I've recently upgraded from 4.1.2 to 4.2.0. And of course my script has stopped working. I know a lot with the globals has changed, but to be honest, I am not sure how or why. Can anyone give me an initial lead as to what I should look for first?
I know I use the following elements:
$_SERVER["PATH_TRANSLATED"] $PHP_SELF
I can't believe it is $PHP_SELF. What should I be wary of when using PHP Environment vars like: $_SERVER["PATH_TRANSLATED"]
Thanks! Wes
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
attached mail follows:
On Tue, 14 May 2002, Rasmus Lerdorf wrote: > Turn on register_globals in your php.ini file and things should start > working again.
That reply was way too short and easy ;)
> On Tue, 14 May 2002, Weston Houghton wrote: > > > > > All, > > > > I've recently upgraded from 4.1.2 to 4.2.0. And of course my script has > > stopped working. I know a lot with the globals has changed, but to be > > honest, I am not sure how or why. Can anyone give me an initial lead as to > > what I should look for first? > > > > I know I use the following elements: > > > > $_SERVER["PATH_TRANSLATED"] > > $PHP_SELF > > > > I can't believe it is $PHP_SELF. What should I be wary of when using PHP > > Environment vars like: $_SERVER["PATH_TRANSLATED"] > > > > Thanks! > > Wes > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Ok, makes sense based on previous threads I have gleaned over. Can you point me to any reading material that fills in the details on all of this though? Would like to know more about why I am doing this, and if I should change my coding based on how PHP is progressing.
Thanks! Wes
> Turn on register_globals in your php.ini file and things should start > working again. > > On Tue, 14 May 2002, Weston Houghton wrote: > >> >> All, >> >> I've recently upgraded from 4.1.2 to 4.2.0. And of course my script has >> stopped working. I know a lot with the globals has changed, but to be >> honest, I am not sure how or why. Can anyone give me an initial lead as to >> what I should look for first? >> >> I know I use the following elements: >> >> $_SERVER["PATH_TRANSLATED"] >> $PHP_SELF >> >> I can't believe it is $PHP_SELF. What should I be wary of when using PHP >> Environment vars like: $_SERVER["PATH_TRANSLATED"] >>
attached mail follows:
http://www.php.net/manual/en/security.registerglobals.php
On Wed, 15 May 2002, Weston Houghton wrote:
> > Ok, makes sense based on previous threads I have gleaned over. Can you point > me to any reading material that fills in the details on all of this though? > Would like to know more about why I am doing this, and if I should change my > coding based on how PHP is progressing. > > Thanks! > Wes > > > > Turn on register_globals in your php.ini file and things should start > > working again. > > > > On Tue, 14 May 2002, Weston Houghton wrote: > > > >> > >> All, > >> > >> I've recently upgraded from 4.1.2 to 4.2.0. And of course my script has > >> stopped working. I know a lot with the globals has changed, but to be > >> honest, I am not sure how or why. Can anyone give me an initial lead as to > >> what I should look for first? > >> > >> I know I use the following elements: > >> > >> $_SERVER["PATH_TRANSLATED"] > >> $PHP_SELF > >> > >> I can't believe it is $PHP_SELF. What should I be wary of when using PHP > >> Environment vars like: $_SERVER["PATH_TRANSLATED"] > >> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Thanks for the link. Everything there makes sense, and I'm not sure if I need to turn register_globals on to make this work. Is there a way to get either:
$_SERVER["PATH_TRANSLATED"] Or $HTTP_SERVER_VARS["SCRIPT_FILENAME"] (perhaps??)
Without turning register_globals on? Oh, and I am doing this from within a class. I'm guessing I could do it outside of the class and pass it into the constructor, but I'd prefer to just get it inside the constructor if possible... Essentially I am just trying to find out from whereon the filesystem the script is being called initially.
Thanks for the patience and help. Wes
> http://www.php.net/manual/en/security.registerglobals.php > > On Wed, 15 May 2002, Weston Houghton wrote: > >> >> Ok, makes sense based on previous threads I have gleaned over. Can you point >> me to any reading material that fills in the details on all of this though? >> Would like to know more about why I am doing this, and if I should change my >> coding based on how PHP is progressing. >> >> Thanks! >> Wes >> >> >>> Turn on register_globals in your php.ini file and things should start >>> working again. >>> >>> On Tue, 14 May 2002, Weston Houghton wrote: >>> >>>> >>>> All, >>>> >>>> I've recently upgraded from 4.1.2 to 4.2.0. And of course my script has >>>> stopped working. I know a lot with the globals has changed, but to be >>>> honest, I am not sure how or why. Can anyone give me an initial lead as to >>>> what I should look for first? >>>> >>>> I know I use the following elements: >>>> >>>> $_SERVER["PATH_TRANSLATED"] >>>> $PHP_SELF >>>> >>>> I can't believe it is $PHP_SELF. What should I be wary of when using PHP >>>> Environment vars like: $_SERVER["PATH_TRANSLATED"] >>>>
attached mail follows:
Try it. $_SERVER[...] will work fine inside your class.
-Rasmus
On Wed, 15 May 2002, Weston Houghton wrote:
> > Thanks for the link. Everything there makes sense, and I'm not sure if I > need to turn register_globals on to make this work. Is there a way to get > either: > > $_SERVER["PATH_TRANSLATED"] > Or > $HTTP_SERVER_VARS["SCRIPT_FILENAME"] (perhaps??) > > Without turning register_globals on? Oh, and I am doing this from within a > class. I'm guessing I could do it outside of the class and pass it into the > constructor, but I'd prefer to just get it inside the constructor if > possible... Essentially I am just trying to find out from whereon the > filesystem the script is being called initially. > > Thanks for the patience and help. > Wes > > > > > http://www.php.net/manual/en/security.registerglobals.php > > > > On Wed, 15 May 2002, Weston Houghton wrote: > > > >> > >> Ok, makes sense based on previous threads I have gleaned over. Can you point > >> me to any reading material that fills in the details on all of this though? > >> Would like to know more about why I am doing this, and if I should change my > >> coding based on how PHP is progressing. > >> > >> Thanks! > >> Wes > >> > >> > >>> Turn on register_globals in your php.ini file and things should start > >>> working again. > >>> > >>> On Tue, 14 May 2002, Weston Houghton wrote: > >>> > >>>> > >>>> All, > >>>> > >>>> I've recently upgraded from 4.1.2 to 4.2.0. And of course my script has > >>>> stopped working. I know a lot with the globals has changed, but to be > >>>> honest, I am not sure how or why. Can anyone give me an initial lead as to > >>>> what I should look for first? > >>>> > >>>> I know I use the following elements: > >>>> > >>>> $_SERVER["PATH_TRANSLATED"] > >>>> $PHP_SELF > >>>> > >>>> I can't believe it is $PHP_SELF. What should I be wary of when using PHP > >>>> Environment vars like: $_SERVER["PATH_TRANSLATED"] > >>>> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi, I'm newbie in php and i would like to clearly understand how can i use: LENGTH in string fgets ( int fp [, int length])
"Returns a string of up to length - 1 bytes read from the file pointed to by fp. Reading ends when length - 1 bytes have been read, on a newline (which is included in the return value), or on EOF (whichever comes first). If no length is specified, the length defaults to 1k, or 1024 bytes."
-Can i have an example of the differents way for reading file with fgets according to the differentes values of "length "? -why '4096' is used as length for reading a file line by line ?
$fd = fopen ("/tmp/inputfile.txt", "r"); while (!feof ($fd)) { $buffer = fgets($fd, 4096); echo $buffer; } fclose ($fd);
Is this any max for one line??
TIA.
arnaud G.
attached mail follows:
Hi All:
Many of my pages has similar lines of code that I would like to group and have it inserted when required:
if ($HTTP_SESSION_VARS[first_name]){ $header='...'; .... } else { $header='...'; };
I placed the code in separate file and tried implode but I think I am doing something wrong.
How can I make it in some type of module and insert it in php code when required?
Thanks Paul
attached mail follows:
In article <000c01c1fba6$12a4aed0$01000001
pawel>, pax
cfl.rr.com says...
> Hi All:
>
> Many of my pages has similar lines of code that I would like to group
> and have it inserted when required:
>
> if ($HTTP_SESSION_VARS[first_name]){
> $header='...';
> ....
> } else {
> $header='...';
> };
>
> I placed the code in separate file and tried implode but I think I am
> doing something wrong.
>
> How can I make it in some type of module and insert it in php code when
> required?
>
> Thanks
> Paul
You should look at include() or require()
-- David Robley Temporary Kiwi!Quod subigo farinam
attached mail follows:
You may want to check permissions within your database. The web server user may not have permissions to perform this action.
/dkm
----- Original Message -----
From: <php
icecoldgold.com>
To: "Philip Hallstrom" <philip
adhesivemedia.com>
Cc: "Peter J. Schoenster" <peter
schoenster.com>;
<php-general
lists.php.net>
Sent: Tuesday, May 14, 2002 6:53 PM
Subject: [PHP] Load data infile
> Hello, > > Is it possible to do the load data info mysql command via PHP > > > I get an access denied error from mysql when i try to do that. > > > > Thanks > > > Randy > >
----------------------------------------------------------------------------
----> -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I retrieve text with accented characters from a textarea and prepare the message headers using some user-defined functions and send it using the php mail() function. The accented characters are kept nicely Here's the importants headers i'm receiving from this message Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit
Question #1: how come using 7bit as encoding my accented characters aren't altered ? shouldn't I be using quoted-printable or 8bit?)
The real problem is below tough:
I'm assigning a text message with accented characters to a variable, again preparing the message headers with functions and sending it with mail(). The ONLY difference with the previous explanation is the text is directly inserted in a variable (not coming from a textarea). receiving same headers: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit
BUT this time the accented characters are loss... they're replaced with others ascii code...
Question #2: What's wrong ? Both emails are following the same network path from the dest->smtp's->mailbox ...
I tried switching the transfer-encoding to quoted-printable but it didn't appear in the message headers- as if my headers were wrong and lost during the route to my mailbox....
(note: I'm using iso-8859-1 as the charset for the webpage of the textarea)
attached mail follows:
Well if his normal page is 100k and he can cut the size down to 50k with gzip then instead of having a monthly transfer of 100 GB for example, he would only be paying for 50 GB. Seems like it's useful for extremely large sites.
-----Original Message-----
From: John Holmes
[mailto:holmes072000
charter.net]
Sent: May 14, 2002 6:43 PM
To: 'Girish Nath'; php-general
lists.php.net
Subject: RE: [PHP] Cool PHP Tricks/Features ?
Why do you think this is useful to you? I remember reading an article on this and its conclusion was that zipping the output was only beneficial for large data between fast computers over a slow pipe. You have to look at who your clients are and if it's beneficial to have their machine use up extra time (processing power) unzipping things or not. Also, you're using more processing time on your computer having to do the zipping for every request, too.
---John Holmes...
> -----Original Message-----
> From: Girish Nath
[mailto:girishn
btinternet.com]
> Sent: Tuesday, May 14, 2002 9:28 AM
> To: php-general
lists.php.net
> Subject: [PHP] Cool PHP Tricks/Features ?
>
> Hi
>
> I've been using PHP for about 2 years now but
only just discovered
> ob_gzhandler and gzip/compressing http output.
> It's something i wish i'd found out about
earlier because even though
it's
> a
> simple concept the result blew me away :)
>
> Anyway, i just wanted to know of any other cool
tricks/features that
you
> guys are using that others could have
overlooked.
>
> Thanks
>
>
> Girish
> --
> www.girishnath.co.uk
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit:
http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02
attached mail follows:
Yes, it can be useful. I don't dispute that. All I'm saying is that it's not the "save-all" or whatever. Look at how much traffic it's going to save you, look at how much extra processing power you're taking from your CPU, look at the connections and computers of your clients, etc. Maybe it's not that big of a deal, but I just don't want some newbie seeing this and thinking that it's going to be the answer to all of their problems. I may even look into it for a couple large pages that I have. You can control it on a page-by-page basis, right?
---John Holmes...
> -----Original Message-----
> From: SP [mailto:internetracer
yifan.net]
> Sent: Tuesday, May 14, 2002 9:29 PM
> To: holmes072000
charter.net; 'Girish Nath'; php-general
lists.php.net
> Subject: RE: [PHP] Cool PHP Tricks/Features ?
>
> Well if his normal page is 100k and he can cut the
> size down to 50k with gzip then instead of having
> a monthly transfer of 100 GB for example, he would
> only be paying for 50 GB. Seems like it's useful
> for extremely large sites.
>
>
>
> -----Original Message-----
> From: John Holmes
> [mailto:holmes072000
charter.net]
> Sent: May 14, 2002 6:43 PM
> To: 'Girish Nath'; php-general
lists.php.net
> Subject: RE: [PHP] Cool PHP Tricks/Features ?
>
>
> Why do you think this is useful to you? I remember
> reading an article on
> this and its conclusion was that zipping the
> output was only beneficial
> for large data between fast computers over a slow
> pipe. You have to look
> at who your clients are and if it's beneficial to
> have their machine use
> up extra time (processing power) unzipping things
> or not. Also, you're
> using more processing time on your computer having
> to do the zipping for
> every request, too.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Girish Nath
> [mailto:girishn
btinternet.com]
> > Sent: Tuesday, May 14, 2002 9:28 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Cool PHP Tricks/Features ?
> >
> > Hi
> >
> > I've been using PHP for about 2 years now but
> only just discovered
> > ob_gzhandler and gzip/compressing http output.
> > It's something i wish i'd found out about
> earlier because even though
> it's
> > a
> > simple concept the result blew me away :)
> >
> > Anyway, i just wanted to know of any other cool
> tricks/features that
> you
> > guys are using that others could have
> overlooked.
> >
> > Thanks
> >
> >
> > Girish
> > --
> > www.girishnath.co.uk
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.361 / Virus Database: 199 - Release
> Date: 07/05/02
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.361 / Virus Database: 199 - Release
> Date: 07/05/02
attached mail follows:
I've seen real-life examples of 100k pages going down to around 30k, considering that decrease in size, when you remember that CPU time is relatively cheap compared to bandwidth, it's worth the processing overhead in my opinion.
Small (<20k) pages probably aren't worth it, for anything larger then as it's been mentioned, even if visitors have no idea the pages are smaller, if they load in 1/3 of the time it's useful, wanted, and definitely cool.
Just remember that not every browser understands gzip compression, but also remember that a probably larger percentage of visitors have ECMAScript (JavaScript) switched off. You takes your chances, you makes your choice...
William.
----- Original Message -----
From: "SP" <internetracer
yifan.net>
To: <holmes072000
charter.net>; "'Girish Nath'" <girishn
btinternet.com>;
<php-general
lists.php.net>
Sent: May 14 2002 06:29 PM
Subject: RE: [PHP] Cool PHP Tricks/Features ?
> Well if his normal page is 100k and he can cut the
> size down to 50k with gzip then instead of having
> a monthly transfer of 100 GB for example, he would
> only be paying for 50 GB. Seems like it's useful
> for extremely large sites.
>
>
>
> -----Original Message-----
> From: John Holmes
> [mailto:holmes072000
charter.net]
> Sent: May 14, 2002 6:43 PM
> To: 'Girish Nath'; php-general
lists.php.net
> Subject: RE: [PHP] Cool PHP Tricks/Features ?
>
>
> Why do you think this is useful to you? I remember
> reading an article on
> this and its conclusion was that zipping the
> output was only beneficial
> for large data between fast computers over a slow
> pipe. You have to look
> at who your clients are and if it's beneficial to
> have their machine use
> up extra time (processing power) unzipping things
> or not. Also, you're
> using more processing time on your computer having
> to do the zipping for
> every request, too.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Girish Nath
> [mailto:girishn
btinternet.com]
> > Sent: Tuesday, May 14, 2002 9:28 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Cool PHP Tricks/Features ?
> >
> > Hi
> >
> > I've been using PHP for about 2 years now but
> only just discovered
> > ob_gzhandler and gzip/compressing http output.
> > It's something i wish i'd found out about
> earlier because even though
> it's
> > a
> > simple concept the result blew me away :)
> >
> > Anyway, i just wanted to know of any other cool
> tricks/features that
> you
> > guys are using that others could have
> overlooked.
> >
> > Thanks
> >
> >
> > Girish
> > --
> > www.girishnath.co.uk
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.361 / Virus Database: 199 - Release
> Date: 07/05/02
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.361 / Virus Database: 199 - Release
> Date: 07/05/02
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi John
You *can* control on a a page-by-page basis as i'm doing now. I have some pages admin pages that are getting a lot of hits and i'm using the compression to reduce them from 52K to 7K and 153K to 17K!
The majority of the users are accessing via 56K modem/ISDN so i'm willing to trade a tiny bit of cpu usage on a lightly loaded machine and save a lot of bandwidth in the process.
Your customers may have access to T1 lines so won't see the difference, however my 56K customers noticed the difference without me even telling them about it.
Regards
Girish
----- Original Message -----
From: "John Holmes" <holmes072000
charter.net>
To: "'SP'" <internetracer
yifan.net>; "'Girish Nath'"
<girishn
btinternet.com>; <php-general
lists.php.net>
Sent: Wednesday, May 15, 2002 3:18 AM
Subject: RE: [PHP] Cool PHP Tricks/Features ?
Yes, it can be useful. I don't dispute that. All I'm saying is that it's not the "save-all" or whatever. Look at how much traffic it's going to save you, look at how much extra processing power you're taking from your CPU, look at the connections and computers of your clients, etc. Maybe it's not that big of a deal, but I just don't want some newbie seeing this and thinking that it's going to be the answer to all of their problems. I may even look into it for a couple large pages that I have. You can control it on a page-by-page basis, right?
---John Holmes...
> -----Original Message-----
> From: SP [mailto:internetracer
yifan.net]
> Sent: Tuesday, May 14, 2002 9:29 PM
> To: holmes072000
charter.net; 'Girish Nath'; php-general
lists.php.net
> Subject: RE: [PHP] Cool PHP Tricks/Features ?
>
> Well if his normal page is 100k and he can cut the
> size down to 50k with gzip then instead of having
> a monthly transfer of 100 GB for example, he would
> only be paying for 50 GB. Seems like it's useful
> for extremely large sites.
>
>
>
> -----Original Message-----
> From: John Holmes
> [mailto:holmes072000
charter.net]
> Sent: May 14, 2002 6:43 PM
> To: 'Girish Nath'; php-general
lists.php.net
> Subject: RE: [PHP] Cool PHP Tricks/Features ?
>
>
> Why do you think this is useful to you? I remember
> reading an article on
> this and its conclusion was that zipping the
> output was only beneficial
> for large data between fast computers over a slow
> pipe. You have to look
> at who your clients are and if it's beneficial to
> have their machine use
> up extra time (processing power) unzipping things
> or not. Also, you're
> using more processing time on your computer having
> to do the zipping for
> every request, too.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Girish Nath
> [mailto:girishn
btinternet.com]
> > Sent: Tuesday, May 14, 2002 9:28 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Cool PHP Tricks/Features ?
> >
> > Hi
> >
> > I've been using PHP for about 2 years now but
> only just discovered
> > ob_gzhandler and gzip/compressing http output.
> > It's something i wish i'd found out about
> earlier because even though
> it's
> > a
> > simple concept the result blew me away :)
> >
> > Anyway, i just wanted to know of any other cool
> tricks/features that
> you
> > guys are using that others could have
> overlooked.
> >
> > Thanks
> >
> >
> > Girish
> > --
> > www.girishnath.co.uk
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.361 / Virus Database: 199 - Release
> Date: 07/05/02
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.361 / Virus Database: 199 - Release
> Date: 07/05/02
attached mail follows:
No, that's not a problem either!
<snip from manual> Before ob_gzhandler() actually sends compressed data, it determines what type of content encoding the browser will accept ("gzip", "deflate" or none at all) and will return it's output accordingly. All browsers are supported since it's up to the browser to send the correct header saying that it accepts compressed web pages. </snip from manual>
HTH
Danny.
----- Original Message -----
From: "Sqlcoders.com Programming Dept" <coders
sqlcoders.com>
To: <php-general
lists.php.net>
Sent: Wednesday, May 15, 2002 1:25 PM
Subject: Re: [PHP] Cool PHP Tricks/Features ?
> Just remember that not every browser understands gzip compression, but also > remember that a probably larger percentage of visitors have ECMAScript > (JavaScript) switched off. > You takes your chances, you makes your choice... >
attached mail follows:
Anyone know a simple explanation of how to use forms using the post method on PHP for Windows. I use PHP on Linux and I don't have any problems. I do the same thing on Windows and I get an unregistered variable message on Windows. I assume I've missed something. Global variables is on. Why isn't the info tranferring?
attached mail follows:
Your error_reporting is probably set to different levels.
www.php.net/error_reporting
---John Holmes...
> -----Original Message-----
> From: Bob Strasser [mailto:bstrasser
telus.net]
> Sent: Tuesday, May 14, 2002 9:48 AM
> To: php-general
lists.php.net
> Subject: [PHP] Using PHP on Windows for the first time
>
> Anyone know a simple explanation of how to use forms using the post
method
> on PHP for Windows. I use PHP on Linux and I don't have any problems.
I
> do the same thing on Windows and I get an unregistered variable
message on
> Windows. I assume I've missed something. Global variables is on.
Why
> isn't the info tranferring?
attached mail follows:
unregistered variable message means that you're doing something like:
if($address == "foo") { // something }
if $address isn't set, then it's an unregistered var.
this *might* solve it:
if(isset($address)) { if($address == "foo") { // do something } }
the difference between the two OS's isn't the OS, it's prolly the config file, and how heavy the error reporting is, so, one option would be to modify the PC's config file so that error reporting is toned down... another would be to look at the error_reporting() function, which can customise the error level on a per-script basis.
http://www.php.net/manual/en/function.error-reporting.php
however, it does sound like your POST vars aren't getting through...
you could try $_POST['varname'] on one of the vars, to see if you still get "unregistered var" errors for that var
Justin
on 14/05/02 11:48 PM, Bob Strasser (bstrasser
telus.net) wrote:
> Anyone know a simple explanation of how to use forms using the post method on > PHP for Windows. I use PHP on Linux and I don't have any problems. I do the > same thing on Windows and I get an unregistered variable message on Windows. > I assume I've missed something. Global variables is on. Why isn't the info > tranferring? >
attached mail follows:
Either put the following line at the top of your php script: error_reporting(E_ALL & ~(E_NOTICE | E_USER_NOTICE | E_WARNING | E_COMPILE_WARNING | E_CORE_WARNING | E_USER_WARNING) );
Or change the error reporting in your php.ini file.
Steve
At 08:48 AM 5/14/2002, Bob Strasser wrote: >Anyone know a simple explanation of how to use forms using the post method >on PHP for Windows. I use PHP on Linux and I don't have any problems. I >do the same thing on Windows and I get an unregistered variable message on >Windows. I assume I've missed something. Global variables is on. Why >isn't the info tranferring?
attached mail follows:
My question will probably expose my woeful lack understanding of security breaches, but perhaps someone can enlighten me.
On my site, registered members will be allowed to upload jpg/jpeg pictures. I'm concerned about possible security problems. First, is there a way to ensure that a picture (and not some other malicious stuff) has been uploaded?
Aside from checking the mime type info associated with the file, is there any way of verifying what's in the file that has been uploaded? (I'm using Linux LM8.2) Would it be possible to fake info to fool this check? Would verification checks for html/scripts/commands be of any use?
Secondly, since the file in question is already uploaded and saved to disk in /tmp or wherever, wouldn't any verification scheme be sort of, 'after-the-fact'?
I would appreciate any input, suggestions, or ideas on what to do here. Am I being overly-paranoid about this, or do I have legitimate security concern.
Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2
Tia, Andre
-- Please pray the Holy Rosary to end the holocaust of abortion. Remember in your prayers the Holy Souls in Purgatory.
May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/
attached mail follows:
Have a look at the getimagesize() function. This function looks at the actual file data, not the mime type nor the file's extension but the data itself and tells you what sort of image file it is.
And no, it wouldn't really be after the fact because because stores the file with a temporary random filename in /tmp ensuring not to overwrite anything that is already there. It is then your job to perform the check and copy the file to some appropriate directory on your server. If you don't do anything with the file, PHP will automatically delete it at the end of the request.
-Rasmus
On Tue, 14 May 2002, Andre Dubuc wrote:
> My question will probably expose my woeful lack understanding of security > breaches, but perhaps someone can enlighten me. > > On my site, registered members will be allowed to upload jpg/jpeg > pictures. I'm concerned about possible security problems. First, is there a > way to ensure that a picture (and not some other malicious stuff) has been > uploaded? > > Aside from checking the mime type info associated with the file, is there any > way of verifying what's in the file that has been uploaded? (I'm using Linux > LM8.2) Would it be possible to fake info to fool this check? Would > verification checks for html/scripts/commands be of any use? > > Secondly, since the file in question is already uploaded and saved to disk in > /tmp or wherever, wouldn't any verification scheme be sort of, > 'after-the-fact'? > > I would appreciate any input, suggestions, or ideas on what to do here. Am I > being overly-paranoid about this, or do I have legitimate security concern. > > Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2 > > Tia, > Andre > > > -- > Please pray the Holy Rosary to end the holocaust of abortion. > Remember in your prayers the Holy Souls in Purgatory. > > May God bless you abundantly in His love! > For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
This is bothering the hell out of me. The first file is a simple form, passing the information to the second file (send_request.php). For some reason the variables are not passing through to the second page. I have tried this on my desktop (Win2k, php4.latest, apache, etc.) and it will work correctly, but when I attempt to run this on my server (RedHat 7.2, php4.latest, apache, etc.) it will not work. I cant even echo any of the variables. Does anyone have any ideas?
index.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>KolbSoft Technologies - Welcome</title> <meta name="Description" content="KolbSoft Technologies is a technology solutions firm providing services to small and medium companies worldwide. We develop, implement, and manage a variety of internet based solutions allowing your company to efficiently interact with the global internet community."> <meta name="Keywords" content="linux, open source, asp, isp, network, web, development, internet, application, design, e-commerce, redhat, engineering, database, support, solutions, mysql, email, domain, php, mailbox, integration, services, technology"> <meta name="Revisit-After" content="7 days"> <style type="text/css"> BODY { background : #FFFFFF; font : 12PX Tahoma, Verdana, Arial; color : #999999; } TABLE { width : 80%; } TABLE.solutions { background : #F9F9F9; border : 1px solid; } TD { font : 13px; text-align : left; vertical-align : top; } STRONG { color : #000000; } STRONG.light { color : Gray; } LI { list-style : circle; } A, A:VISITED { color : #6194C7; text-decoration : none; } A:HOVER { color : #000080; } </style> </head> <body> <table align="center" class="solutions"> <tr> <td><a href="/"><IMG alt="" src="images/logo.gif" border=0></a></td> </tr> </table> <BR> <table align="center" class="solutions"> <tr> <td colspan="2"><STRONG>About Us:<BR></STRONG>KolbSoft Technologies is a technology solutions firm providing services to small and medium sized companies and organizations worldwide. We develop, implement, and manage a variety of internet based solutions allowing your company to efficiently interact with the global internet community.</td> </tr> <tr> <td colspan="2"><strong>Solutions:</strong></td> </tr> <tr> <td><STRONG>Web Development:</STRONG><BR> <li>New Site Design</li> <li>Internet Application Development</li> <li>WebSite re-design</li> </td> <td><STRONG>Web Hosting:</STRONG><BR> <li>Shared</li> <li>Dedicated</li> <li>Internet Application</li> </td> </tr> <tr> <td><STRONG>Email Services:</STRONG><br> <li>POP/IMAP Mailboxes</li> <li>Discussion Lists</li> <li>eMail Announcements</li> </td> <td><STRONG>Database Services:</STRONG><br> <li>Hosting</li> <li>Integration</li> <li>Architecture</li> </td> </tr> </table> <BR> <table align="center" class="solutions"> <tr><td><STRONG>Contact Us:</STRONG><br>Want to find out more? Fill out the following form and we will contact you shortly.</td></tr> <tr><td> <table> <form action="send_request.php" method="post"> <tr><td>Company name:</td><td><input type="text" name="company" size="45"><BR></td></tr> <tr><td>First Name: </td><td><input type="text" name="firstname" maxlength="40"> </td></tr> <tr><td>Last Name: </td><td><input type="text" name="lastname" size="30"> </td></tr> <tr><td>e-mail: </td><td><input type="text" name="email" maxlength="40"> </td></tr> <tr><td>Address:</td><td><input type="text" name="address" size="35"><BR></td></tr> <tr><td>City: </td><td><input type="text" name="city"> </td></tr> <tr><td>State:</td><td><input type="text" name="state"> </td></tr> <tr><td>Zip: </td><td><input type="text" name="zip" size="10"> </td></tr> <tr><td>Country:</td><td><input type="text" name="country"> </td></tr> <tr><td>Phone: </td><td><input type="text" name="phone"> </td></tr> <tr><td>Fax:</td><td><input type="text" name="fax"> </td></tr> <tr><td colSpan=2><BR></td></tr> <tr><td colSpan=2>Please leave us your comments:<BR><textarea cols="50" rows="4" name="Comments"></textarea></td></tr> <tr><td colspan=2><input type="hidden" name="sent" value="1"><input type="submit" value="Submit Info"> <input type="reset" value="Clear Form"></td></tr> </form> </table> </td></tr> </table> </body> </html>
send_request.php
<?php
$send_to = "ekolb
kolbsoft.com";
$message = "Company Name: ".$company."\n"."First Name:
".$firstname."\n"."Last Name: ".$lastname."\n"."Email:
".$email."\n"."Address: ".$address."\n"."City: ".$city."\n"."State:
".$state."\n"."Zip: ".$zip."\n"."Country: ".$country."\n"."Phone:
".$phone."\n"."Fax: ".$fax."\n"."Comments: ".$Comments;
echo $message;
#mail($send_to, "KolbSoft Contact Form", $message, "From: $email\r\n");
?>WTF
attached mail follows:
Turn on register_globals in your php.ini file.
On Tue, 14 May 2002, mail-list wrote:
> This is bothering the hell out of me. The first file is a simple form,
> passing the information to the second file (send_request.php). For some
> reason the variables are not passing through to the second page. I have
> tried this on my desktop (Win2k, php4.latest, apache, etc.) and it will work
> correctly, but when I attempt to run this on my server (RedHat 7.2,
> php4.latest, apache, etc.) it will not work. I cant even echo any of the
> variables. Does anyone have any ideas?
>
> index.php
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>KolbSoft Technologies - Welcome</title>
> <meta name="Description" content="KolbSoft Technologies is a technology
> solutions firm providing services to small and medium companies worldwide.
> We develop, implement, and manage a variety of internet based solutions
> allowing your company to efficiently interact with the global internet
> community.">
> <meta name="Keywords" content="linux, open source, asp, isp, network, web,
> development, internet, application, design, e-commerce, redhat, engineering,
> database, support, solutions, mysql, email, domain, php, mailbox,
> integration, services, technology">
> <meta name="Revisit-After" content="7 days">
> <style type="text/css">
> BODY { background : #FFFFFF; font : 12PX Tahoma, Verdana, Arial; color :
> #999999; }
> TABLE { width : 80%; }
> TABLE.solutions { background : #F9F9F9; border : 1px solid; }
> TD { font : 13px; text-align : left; vertical-align : top; }
> STRONG { color : #000000; }
> STRONG.light { color : Gray; }
> LI { list-style : circle; }
> A, A:VISITED { color : #6194C7; text-decoration : none; }
> A:HOVER { color : #000080; }
> </style>
> </head>
> <body>
> <table align="center" class="solutions">
> <tr>
> <td><a href="/"><IMG alt="" src="images/logo.gif" border=0></a></td>
> </tr>
> </table>
> <BR>
> <table align="center" class="solutions">
> <tr>
> <td colspan="2"><STRONG>About Us:<BR></STRONG>KolbSoft Technologies is a
> technology solutions firm providing services to small and medium sized
> companies and organizations worldwide. We develop, implement, and manage a
> variety of internet based solutions allowing your company to efficiently
> interact with the global internet community.</td>
> </tr>
> <tr>
> <td colspan="2"><strong>Solutions:</strong></td>
> </tr>
> <tr>
> <td><STRONG>Web Development:</STRONG><BR>
> <li>New Site Design</li>
> <li>Internet Application Development</li>
> <li>WebSite re-design</li>
> </td>
> <td><STRONG>Web Hosting:</STRONG><BR>
> <li>Shared</li>
> <li>Dedicated</li>
> <li>Internet Application</li>
> </td>
> </tr>
> <tr>
> <td><STRONG>Email Services:</STRONG><br>
> <li>POP/IMAP Mailboxes</li>
> <li>Discussion Lists</li>
> <li>eMail Announcements</li>
> </td>
> <td><STRONG>Database Services:</STRONG><br>
> <li>Hosting</li>
> <li>Integration</li>
> <li>Architecture</li>
> </td>
> </tr>
> </table>
> <BR>
> <table align="center" class="solutions">
> <tr><td><STRONG>Contact Us:</STRONG><br>Want to find out more? Fill out the
> following form and we will contact you shortly.</td></tr>
> <tr><td>
> <table>
> <form action="send_request.php" method="post">
> <tr><td>Company name:</td><td><input type="text" name="company"
> size="45"><BR></td></tr>
> <tr><td>First Name: </td><td><input type="text" name="firstname"
> maxlength="40"> </td></tr>
> <tr><td>Last Name: </td><td><input type="text" name="lastname" size="30">
> </td></tr>
> <tr><td>e-mail: </td><td><input type="text" name="email" maxlength="40">
> </td></tr>
> <tr><td>Address:</td><td><input type="text" name="address"
> size="35"><BR></td></tr>
> <tr><td>City: </td><td><input type="text" name="city"> </td></tr>
> <tr><td>State:</td><td><input type="text" name="state"> </td></tr>
> <tr><td>Zip: </td><td><input type="text" name="zip" size="10"> </td></tr>
> <tr><td>Country:</td><td><input type="text" name="country"> </td></tr>
> <tr><td>Phone: </td><td><input type="text" name="phone"> </td></tr>
> <tr><td>Fax:</td><td><input type="text" name="fax"> </td></tr>
> <tr><td colSpan=2><BR></td></tr>
> <tr><td colSpan=2>Please leave us your comments:<BR><textarea cols="50"
> rows="4" name="Comments"></textarea></td></tr>
> <tr><td colspan=2><input type="hidden" name="sent" value="1"><input
> type="submit" value="Submit Info"> <input type="reset" value="Clear
> Form"></td></tr>
> </form>
> </table>
> </td></tr>
> </table>
> </body>
> </html>
>
>
> send_request.php
>
> <?php
> $send_to = "ekolb
kolbsoft.com";
> $message = "Company Name: ".$company."\n"."First Name:
> ".$firstname."\n"."Last Name: ".$lastname."\n"."Email:
> ".$email."\n"."Address: ".$address."\n"."City: ".$city."\n"."State:
> ".$state."\n"."Zip: ".$zip."\n"."Country: ".$country."\n"."Phone:
> ".$phone."\n"."Fax: ".$fax."\n"."Comments: ".$Comments;
> echo $message;
> #mail($send_to, "KolbSoft Contact Form", $message, "From: $email\r\n");
> ?>WTF
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hi, I am using php-4.1.2 and jpgraph-1.6.1 and I would like to generate in my program one filenam.php that would contain several not superimposed histograms(eg. jpgraph LinePlot). I would like to draw on one page eg. 20 different histograms. Can it be done? Thank you, Maciek
attached mail follows:
Firstly I would like to say that this is NOT a request for help, but rather the answer I found to the question I had asked more then a week ago, but got no response. From the lack of response I would assume that a) nobody cared that I had a problem, or b) that nobody knew the answer... I hope there were many less a)'s then b)'s but I thank everyone who did take the time to at least read my request for help. I'm posting what i found for the people who do their best to help, but don't always know all of the answers (hey, who does?!)
My problem was with accessing the information awaiting me in sockets
heres the quick and dirty (the rest is after the code)
<?php // NOTE: THIS IS A WORKING SCRIPT YOU CAN TEST
function display($data) { // used to echo our results... echo '<hr><pre>'; if ( is_array($data) ) { // make sure the data is real ;) foreach ( $data as $idx => $val ) { echo ':'.$idx.': '.$val; } } echo '</pre><hr>'; }
function return_buffer($fp) { // get all the data from the socket buffer while ( $data = fgets($fp, 9999) ) { $return[]=$data; } return($return); }
// lets START establishing a connection to an FTP site...
$host='ftp.cdrom.com';;
$port=21;
$user='anonymous';
$pass='anonymous
e-mail.com';
// actually initiate the connection $fp=fsockopen($host, $port, $est, $eno); socket_set_blocking($fp, 1); // make fgets() wait for data socket_set_timeout($fp, 1, 0); // set fgets() timeout delay
$banner=return_buffer($fp);
// send username fputs($fp, 'user '.$user.chr(10)); // get response $user_resp=return_buffer($fp);
// send password fputs($fp, 'pass '.$pass.chr(10)); // get response $pass_resp=return_buffer($fp);
// log off fputs($fp, 'quit'.chr(10).'bye'.chr(10)); // get response (usually nothing) $quit_resp=return_buffer($fp);
// close the socket (if it's still open) fclose($fp);
// echo our data display($banner); display($user_resp); display($pass_resp); display($quit_resp);
?>
The above code DOES work, to some extent... ONLY the banner will be received and echoed.... after much research, and brute force testing i found that php keeps the timeout status on the socket. which causes all subsequent fgets() functions to do nothing at all (basically php considerer's the socket to be at its EOF) you can remedy this by placing another "socket_set_timeout($fp, 1, 0);" in the script, but just after the while loop in the return_buffer function... this will reset the timeout status on the socket each time it's read from... the resulting function (coded below) will allow the script to do precisely as it was intended to do... log in, get all the data associated with logging in, and then logging out...
function return_buffer($fp) { // get all the data from the socket buffer while ( $data = fgets($fp, 9999) ) { $return[]=$data; } socket_set_timeout($fp, 1, 0); return($return); }
Thanks again, and Cheers! Replies, comments, concerns welcome
attached mail follows:
Dear Folks,
I am trying to set up Suse Linux Server with sybase and PHP. While configuring my computer with these software I am getting some problem.
Actually, I have done following steps:
- first of all I Installed the SuSE 7.0 Linux (then apache is installed by default) - then Sybase-ase-11.0.3.3-2 is installed with sybase-CT - then I stopped the apache server and installed PHP from its tar PHP-4.0.4pl1 using following command tar -xvf php-4.0.4pl1.tar
and then configured by using this command ./configure --with-apxs=/usr/sbin/apxs --with-sybase-ct=/opt/sybase
till this point apache works but after using Make and Make Install Command, apache does not work I am not getting where I am wrong
Please guide me friends.
Regards, Vivek
attached mail follows:
First of all, PHP 4.0.4 is over 2 years old now. Upgrade! Then let us know if you have any problems.
-Rasmus
On Wed, 15 May 2002, Vivek Kumar Agrawal wrote:
> Dear Folks, > > I am trying to set up Suse Linux Server with sybase and PHP. > While configuring my computer with these software I am getting some problem. > > Actually, I have done following steps: > > - first of all I Installed the SuSE 7.0 Linux (then apache is installed by default) > - then Sybase-ase-11.0.3.3-2 is installed with sybase-CT > - then I stopped the apache server and installed PHP from its tar PHP-4.0.4pl1 using following command > tar -xvf php-4.0.4pl1.tar > > and then configured by using this command > ./configure --with-apxs=/usr/sbin/apxs --with-sybase-ct=/opt/sybase > > till this point apache works but after using Make and Make Install Command, apache does not work > I am not getting where I am wrong > > Please guide me friends. > > > Regards, > Vivek > >
attached mail follows:
Hi All
I have the following problem .. A web page which has a flash swf file 100K with .html extenstion need less than 1 sec to refresh if its cashed ''. The same web page with .php extention makes a delay 5-7'' ?? Why ???
Thanks in advance for your help simos
attached mail follows:
Hi!
I've recently upgraded to 4.2.1, but i have gotten a lot of problems with it.
First of all my pbpBB 2.0 forums stopped working (http://utge.dyndns.org/phpbb2/index.php). When you try to log in i get an error, malfomed header request? (im not on the actual machine now :)).
I also have problems with logins to my site (jaggu.org).
After messing a lot to get sessions working again, I
have tracked down the consisten problem to the Header
() function. A comment in the manual says "
" should
be put in front of all function calls before header().
I tried that, to no use.
So my question is, why has that changed, and what do
we do now to authenticate users and redirect them to
anothe page? And what the hell is this "
" thingy, i
cant see to find anything on it in the manual, and
search doesnt work for chars like that.
I hope you guys can clarify this for me.
Sincerely
Olav Bringedal jaggu.org
__________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
attached mail follows:
On Wed, May 15, 2002 at 07:34:13AM +0100, Olav Bringedal wrote: > > First of all my pbpBB 2.0 forums stopped working
Do they use variables straight up, rather than via the new superglobals such as $_POST? Simple solution, change your php.ini to have register_globals = on.
> (http://utge.dyndns.org/phpbb2/index.php). When you > try to log in i get an error, malfomed header request?
I guess somewhere, some text is being sent out to the browser before the header() functions are being called. Perhaps due to a different level of error reporting in your new php.ini setup?
> So my question is, why has that changed, and what do
> we do now to authenticate users and redirect them to
> anothe page? And what the hell is this "
" thingy, i
> cant see to find anything on it in the manual, and
> search doesnt work for chars like that.
The
represses error messages. For example:
mail('', 'subject', 'body');
will produce an error message, that the to address is bad, while
mail('', 'subject', 'body');
will silently fail.
Rather than doing that, it's better to write your code so that there won't be error messages in the first place.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
On Wed, 15 May 2002 08:52:49 +0200, Analysis & Solutions wrote:
>> So my question is, why has that changed, and what do we do now to
>> authenticate users and redirect them to anothe page? And what the hell
>> is this "
" thingy, i cant see to find anything on it in the manual,
>> and search doesnt work for chars like that.
>
> The
represses error messages. For example:
> mail('', 'subject', 'body');
> will produce an error message, that the to address is bad, while
>
mail('', 'subject', 'body');
> will silently fail.
>
> Rather than doing that, it's better to write your code so that there
> won't be error messages in the first place.
Not only that: if you are running a production server, you will probably
want to log your error messages to a file (or syslog, or whatever),
instead of printing them. So 'display_errors' should be off. If that is
the case, you don't need to use
anymore, because there will be no HTML
output even in case of problems. The advantage of this is that you can
use the exact same code on a development server (with display_errors =
on) and a production server.
Vincent
attached mail follows:
--- Vincent Oostindie <news
sunlight.tmfweb.nl>
wrote:
> Not only that: if you are running a production
> server, you will probably
> want to log your error messages to a file (or
> syslog, or whatever),
> instead of printing them. So 'display_errors' should
> be off. If that is
> the case, you don't need to use
anymore, because
> there will be no HTML
> output even in case of problems. The advantage of
> this is that you can
> use the exact same code on a development server
> (with display_errors =
> on) and a production server.
>
> Vincent
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
That is all well, but if php 4.2.1 interprets any output (as errors not only screen errors) as something that is sent before a header in a redirect, there is no other way (that i'm aware of) around it.
Like this:
$user=$Session["user"];
if(!$Authorized)
{
header ("Location: http://jaggu.org");
}
this will not work, you have to write:
$user=
$Session["user"];
if(
!$Authorized)
{
header ("Location: http://jaggu.org");
}
To actually get the redirect.
On http://jaggu.org/info.php, you can see that display_errors = off
In any case, I think you are onto something. I will try to narrow down logging, to see if that might be the problem.
Thanks for helping!
Olav Bringedal jaggu.org
__________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
attached mail follows:
Sorry about this, but i forgot one thing in my last post.
With 4.2.1 (as opposed to 4.2.0), gd2 stopped working. When i run the server I get "could not find freetype.dll(? Still not on the actual machine)" and then "gd2.dll(?) module could not be found".
phpinfo at http://jaggu.org/info.php
I tried to search both my config files and via google for freetype.dll, but could not find anything of slightest enlightenment.
Thanks in advance!
Olav Bringedal Jaggu.org
===== Raistlin M041999031
__________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
attached mail follows:
Hello,
what is better syntax (for perfomance option, not code-style) e.g. html code out of php tags
<table> <?php while (...) { ?> <tr> <td><?php echo $something; ?></td> <td>text</td> </tr> <?php } ?> </table>
or
<?php $table = '<table>'; while (...) $table .= '<tr><td>'.$something.'</td><td>text</td></tr>'; $table .= '</table>'; ?>
Thank you.
Regards,
Michal Dvoracek michal.dvoracek
capitol.cz
attached mail follows:
Help :-) I am sending a POST request from PHP to another PHP script through a socket, something like --------------------------------------------- $request = "Content-type: text/xml\n"; $request .= "blah...blah...blah"; $request .= "\n\n--asdlfkjiurwghasf"; // Build the header $header = "POST /post/bot/xml/test.php HTTP 1.1 \r\n"; $header .= "Accept: text/*\r\n"; $header .= "Accept-Charset: iso-8859-1;\r\n"; $header .= "Accept-Encoding: identity\r\n"; $header .= "Accept-Language: \r\n"; $header .= "User-Agent: Browser/1.1\r\n"; $header .= "Connection: keepalive\r\n"; $header .= "Host: 127.0.0.1:80\r\n"; $header .= "Content-type: text/xml; boundary=asdlfkjiurwghasf; type=\"text/xml\"\r\n\r\n"; ... $fp = fsockopen("127.0.0.1", 80, $err1, $err2, 30); fputs($fp, $header . $request); ----------------------------------------------- How can I access the request data in /post/bot/xml/test.php? Is it possible at all? RAW_POST doesnt't help in this case... Any suggestions?
==================================== Peter Tatischev Senior Mobile Applications Developer Sonic Duo http://www.sonicduo.com Mobile: +7-926-200-1248 Direct: +7-926-200-2248 peter.tatischevatsonicduodotcom
attached mail follows:
The challenge is to do it without SQL. Which blog do you recommend?
"David Jackson" <david.jay.jackson
wcox.com> wrote in message
news:3CE1523D.83490E06
wcox.com...
> Jay Blanchard wrote:
> >
> The burning issue that begs to be answered is, why reinvent the wheel?
> There is a least a dozen blogs on freshmeat for PHP along...
> Unless your doing it just for kicks, which is OK.
>
> David
>
>
> > [snip]
> > > I want to try to find the hour that has the most hits
> > > The day of the week that has the most hits
> > > and the max and ave no of hits of these.
> >
> > I haven't given it a whole lot of thought but I'd be tempted to dump the
> > whole thing into an appropriately structured sql database and then use
> > SELECT's to extract the information you want. It'll likely end up
> > faster and less processor intensive than doing it in php by itself I
> > suspect.
> > [/snip]
> >
> > +1
> >
> > Not only that, but then you will have the ability to create queries for
> > other important factors in the logs without having to recode, or create
> > code.
> >
> > Jay
attached mail follows:
First this is not a 2d array it is a single d array each element of which is another array. If you search the array for a value you won't find it as each element is an array. $layerDes[1][0] is not an element of $layerDes it is an element of the array $layerDes[1].
As far as I know there is no built in way to search down this tree. I think you'll need To walk the array and check the first element of each e.g.
Foreach($layerDes as $count=>$array) { if ($array[0] == $searchstring) { $key = $count; break; } }
Tim Ward www.chessish.com <http://www.chessish.com>
----------
From: Pushkar Pradhan [SMTP:pushkar
ERC.MsState.Edu]
Sent: 14 May 2002 19:51
To: php-general
lists.php.net
Subject: array_search in 2-d arrays
I've a 2 D array and would like to search for vals. in the first dimension only i.e. myArray[0][0] myArray[1][0] myArray[2][0] myArray[3][0] . . . and not in the elements myArray[0][1]....
CODE: for($l = 0; $l < count($layer); $l++) { $key = array_search($layer[$l], $layerDes); // $layerDes is 2-D $layer[$l] = $layerNames[$key]; } My $key is undefined after execution, is it because the elements are in $layerDes[i][0]? Using $key === also didn't help? Any ideas, thanks.
-Pushkar S. Pradhan
attached mail follows:
I'm trying to close a session without the logged in surfer clicking "log out" (through a onunLoad javascript function which loads i different php document with the otherwise working php code for destryoing a session). I have a working "Log out" link which destroys the session and the variables in it but if the surfer doesn't click on it the session variables are still there and they can go back through their browser history and continue their session as logged in!
So, how to destroy a session wihtout beeing able to control where the surfer clicks? I´ve gone through the documents and FAQ's without understanding any solution so I'd be most grateful for any help!
Regards,
Ake Svensson, aspiring database designer (MySQL/PHP/Linux)
attached mail follows:
I am using this script: to upload a picture file and I get the error below: "Unable to create 'hgh6.gif': Permission denied in /home/vhtdocs/archipro/do_upload.php on line 13 Couldn't copy the file!" - What am I doing wrong
<form enctype="multipart/form-data" method="post" action="do_upload.php">
<p><strong>File to Upload:</strong><br> <input type="file" name="img1" size="30"></p>
<P><input type="submit" name="submit" value="Upload File"></p>
</form> upload file: <?
// if $img_name isn't empty, try to copy the file if ($img1_name != "") {
copy("$img1", "/images/$img1_name") or die("Couldn't copy the file!");
} else {
// if $img_name was empty, die and let us know why die("No input file specified");
}
?>
Warning: Unable to create 'hgh6.gif': Permission denied in /home/vhtdocs/archipro/do_upload.php on line 13 Couldn't copy the file!
attached mail follows:
On Wednesday 15 May 2002 18:33, Diana Castillo wrote: > I am using this script: to upload a picture file and I get the error below: > "Unable to create 'hgh6.gif': Permission denied in > /home/vhtdocs/archipro/do_upload.php on line 13 > Couldn't copy the file!" - What am I doing wrong > <form enctype="multipart/form-data" method="post" action="do_upload.php"> > > <p><strong>File to Upload:</strong><br> > <input type="file" name="img1" size="30"></p> > > <P><input type="submit" name="submit" value="Upload File"></p> > > </form> > upload file: > <? > > // if $img_name isn't empty, try to copy the file > if ($img1_name != "") { > > copy("$img1", "/images/$img1_name")
You're trying to copy something into the directory "/images". Does the webserver have permissions to do so?
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Don't believe everything you hear or anything you say. */
attached mail follows:
Hi there,
I would like to check user input for to long words. Therefore I did code a function returning a string seperated by dash if it is more than $maxlength. If it is 2 times maxlength it returns false.
Works good execept on line brakes. So if the input is:
test ölakjdfölakjdöfkjaödlfkjöaksdjföl
it asumes thtat the word is: test ölakjdfölakjdöfkjaödlfkjöaksdjföl
Does anybody know why this happens?
Thanx for any help,
andy
function max_word_length($string, $maxlength){ $word = explode(" ",$string); for($x=0;$x<count($word);$x++){ if (strlen($word[$x]) > 2 * $maxlength) return false;
if (strlen($word[$x]) > $maxlength){ echo strlen($word[$x]).' '.$word[$x].'<br>'; $word[$x] = substr($word[$x],0, $maxlength).'-'.substr($word[$x], $maxlength); echo strlen($word[$x]).' '.$word[$x].'<br>'; } } return implode(" ", $word); }
attached mail follows:
if I have $time = 21 then
$timespread =array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); if ($time = = "21") $timespread[22]=($timespread[22]+1); echo $timespread[22] ;
I get 0
attached mail follows:
--- Josh Edwards <josho
tpg.com.au> wrote: > if I
have $time = 21 then
>
> $timespread
>
=array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
> if ($time = = "21")
> $timespread[22]=($timespread[22]+1);
> echo $timespread[22] ;
>
> I get 0
>
It might be "= =" which should be "==". If not, try:
$timespread =array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); if ($time == "21") { echo "before:".$timespread[22]."<b>" ; $timespread[22]=($timespread[22]+1); echo "after:".$timespread[22]."<b>" ; } else { echo "time is not 21" ; }
Then you can at least establish where things go wrong.
===== Olav Bringedal jaggu.org
__________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
attached mail follows:
If I // $time=="21" the count goes up by 1 so it's not recognizing the 21.
Any ideas
"Olav bringedal" <raist100
yahoo.com> wrote in message
news:20020515110018.72619.qmail
web10507.mail.yahoo.com...
> --- Josh Edwards <josho
tpg.com.au> wrote: > if I
> have $time = 21 then
> >
> > $timespread
> >
> =array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
> > if ($time = = "21")
> > $timespread[22]=($timespread[22]+1);
> > echo $timespread[22] ;
> >
> > I get 0
> >
>
> It might be "= =" which should be "==". If not, try:
>
> $timespread =array
> (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
> if ($time == "21")
> {
> echo "before:".$timespread[22]."<b>" ;
> $timespread[22]=($timespread[22]+1);
> echo "after:".$timespread[22]."<b>" ;
> }
> else
> {
> echo "time is not 21" ;
> }
>
> Then you can at least establish where things go wrong.
>
>
>
>
> =====
> Olav Bringedal
> jaggu.org
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
attached mail follows:
Well it works just fine for me :)
PHP 4.2.0 / Apache 2.0.36 / FreeBSD 4.5
DOM/XML enabled libxml Version 2.4.21 HTML Support enabled XPath Support enabled XPointer Support enabled
As you can see, I'm using a later version of libxml than you are - maybe that's the problem. I am also forced to use the old functions - maybe the new names only apply in PHP 4.3.0+?
If you need any more info:
http://phpinfo.kyboshed.dyndns.org http://tests.kyboshed.dyndns.org/domtest.php http://tests.kyboshed.dyndns.org/domtest-source.php
HTH
Danny.
----- Original Message -----
From: "Thalis A. Kalfigopoulos" <thalis
cs.pitt.edu>
To: <php-general
lists.php.net>
Sent: Friday, May 10, 2002 1:05 AM
Subject: [PHP] DOMXML in 4.2.0 problems
> I'm trying to get DOMXML to work with PHP4.2.0. I've compiled with --with-dom and phpinfo() says it's there: > DOM/XML enabled > libxml Version 2.4.18 > HTML Support enabled > XPath Support enabled > XPointer Support enabled > > The following program though doesn't seem to work: > > $xmlstring='a valid xml document here'; > $domdoc=xmldoc($xmlstring); > $root=$doc->document_element(); <--- throw error > > I get an error regarding the call to DomDocument->document_element(). Also I'm forced to use xmldoc() instead of the newer domxml_open_mem() because it is also not recognized. What am I missing? > > thanks in advance, > Thalis > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi! Is there any way of decomposing an integer into it's constituent bytes so that a new byte order can be created? tia JohnH
John Horton
Software Engineer
BITbyBIT International Limited
john.horton
bitbybit.co.uk
Tel: + 44 (0) 1865 865400 Fax: + 44 (0) 1865 865450 www.bitbybit.co.uk
Disclaimer: Internet communications are not secure and BitbyBit does not accept any legal responsibility for the content of this message. Any views or opinions presented are solely those of the author and do not necessarily represent those of BitbyBit International Limited. If you have received this email in error, please reply to the sender or call +44(0)1865 865400 and delete all copies of this mail.
attached mail follows:
Hi,
I want to know if the user is connected on a secure socket and have two problems:
1. My Apache (Stronghold), variables are not turning up in $_SERVER or $HTTP_SERVER_VARS although they are in $GLOBALS e.g. I have $GLOBALS[SERVER_PORT] but not $_SERVER[SERVER_PORT]. This is with track vars and register globals both on. It seems I have to rely on the $GLOBALS value and be careful with variables_order.
2. As well as $SERVER_PORT, I also get $HTTPS, but only if there it is an HTTPS connect i.e. on a secure connect, $HTTPS == 'on', but on an insecure connect it is not set. This makes it easy to spoof even with variables_order set to ECGPS. I could just use $SERVER_PORT, which is always set and thus not so easily spoofed but then I have to worry if the secure port changes.
Any suggestions?
George
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]