Re: [PHP] Re: mail() is duplicating

2009-03-17 Thread Ashley Sheridan
On Fri, 2009-03-13 at 22:54 -0300, Manuel Lemos wrote:
 Hello,
 
 on 03/13/2009 05:37 PM Rick Pasotto said the following:
  I have several forms on my site that use the same sequence of events:
  The first script displays and validates the form data, the second
  reformats and asks for confirmation or editing, and the third script
  sends the data in an email to the relevent people.
  
  Two of these forms work exactly as they're supposed to but the third
  sends duplicate emails to everyone.
  
  I have looked and looked and I've run diff and I can see no reason why
  this should be happening.
  
  Could someone suggest what I might have wrong?
 
 Usually this happens when you have a To: header in the headers parameters.
 
 -- 
 
 Regards,
 Manuel Lemos
 
 Find and post PHP jobs
 http://www.phpclasses.org/jobs/
 
 PHP Classes - Free ready to use OOP components written in PHP
 http://www.phpclasses.org/
 
Another possibility is that the mail sending is triggered from a page
that is called from a get request rather than post. Some browsers
actually make more than one call when the page is get, thereby
triggering the duplicate mail creation. I had a similar thing with a
database update once before, it's a bugger to be rid of without
switching to post.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Re: mail() is duplicating

2009-03-17 Thread Manuel Lemos
Hello,

on 03/17/2009 05:34 PM Ashley Sheridan said the following:
 I have several forms on my site that use the same sequence of events:
 The first script displays and validates the form data, the second
 reformats and asks for confirmation or editing, and the third script
 sends the data in an email to the relevent people.

 Two of these forms work exactly as they're supposed to but the third
 sends duplicate emails to everyone.

 I have looked and looked and I've run diff and I can see no reason why
 this should be happening.

 Could someone suggest what I might have wrong?
 Usually this happens when you have a To: header in the headers parameters.

 Another possibility is that the mail sending is triggered from a page
 that is called from a get request rather than post. Some browsers
 actually make more than one call when the page is get, thereby
 triggering the duplicate mail creation. I had a similar thing with a
 database update once before, it's a bugger to be rid of without
 switching to post.

I suspect that may happen with nervous users that double click form
submit buttons.

Usually I use this forms class that has a built-in feature to show a
form resubmit confirmation message when the use uses the submit function
more than once:

http://www.phpclasses.org/formsgeneration

That feature can be seen in this page:

http://www.meta-language.net/forms-examples.html?example=test_form

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/


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



[PHP] Re: mail() is duplicating

2009-03-13 Thread Manuel Lemos
Hello,

on 03/13/2009 05:37 PM Rick Pasotto said the following:
 I have several forms on my site that use the same sequence of events:
 The first script displays and validates the form data, the second
 reformats and asks for confirmation or editing, and the third script
 sends the data in an email to the relevent people.
 
 Two of these forms work exactly as they're supposed to but the third
 sends duplicate emails to everyone.
 
 I have looked and looked and I've run diff and I can see no reason why
 this should be happening.
 
 Could someone suggest what I might have wrong?

Usually this happens when you have a To: header in the headers parameters.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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