|
Posted by Gordon Burditt on 11/19/69 11:47
>I am writing a page with sessions. At the start of every page I check
>to make sure that the user actually has a session by checking for some
>SESSION variables. On one of my pages I have a form that is to add
>guests for an event. I have no idea how many guests a particular member
>is giong to bring and the number of guests is not limited. So to save
>myself time I wrote a form that will allow you to add one guest and
>then hit add guest. This will save that guest to the guest table in my
>MySQL database but then I want to reload the page to have them add
>another guest. The only problem I am having is that the only way I know
>how to send the user to the page is using the header() function. This
>is not working because I have already output data. Is there a better
>way to do this so that I can one form and not have to have a form input
>for guests up to 20?
You get to output data *OR* redirect to a new page.
Only one will be displayed. Which do you want displayed?
If it's not going to be seen, don't output it.
You have several options:
- Output "guest added successfully", followed by the form to add another
guest.
- Output a page indicating the guest was added successfully, with a
"add another guest" button on it.
- Write a page which, if form data is provided stores it, then, whether
or not form data is provided, outputs another copy of the form
(which submits to itself).
Gordon L. Burditt
[Back to original message]
|