Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#288745 - 24/10/2006 20:03 Some PHP and form submission help?
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
I need some help preventing my email form from being rebmitted (generating an email) when the page is reloaded.

Hopefully this can be fixed (and someone can help me do it). Over the past 1.5 weeks I've been working on a shopping cart for my site and a dozen other smaller things so I'm pretty burnt out.

Today I decided to write a small form to email submission page cobbled together from a few bits I found on the net and some of the forms and validation I'd put together for the cart.

The forms is created by the same page it is submitted to. A few conditionals check to see what's going on when the page loads to decide where to go within it (whether it should validate and complain about invalid input or whether to actually do a real submit action and create an email message).

When the thing completes successfully it sends the browser to a brand new page using the "header" function.

Reloading that page says (of course) that post data needs to be resubmitted - and generates a duplicate email.

What's a fairly straight forward way to prevent this? I can send up the source for my PHP page.
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#288746 - 24/10/2006 20:26 Re: Some PHP and form submission help? [Re: hybrid8]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Ok, nevermind.

It works now. I was printing a bit of text AFTER the header command which was apparently what was holding the form. After remving that (it wasn't supposed to be there), all is well.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top