Posted by Scott on 11/19/77 11:47
On Fri, 2006-05-12 at 10:21 -0700, bob.herbst@gmail.com wrote:
> 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?
>
> Thanks
>
Instead of using header(), why not have the form post to itself?
<?php
if (isset($_POST['guest'])) {
include('formProcessingCode.php');
}
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post"> ...
Navigation:
[Reply to this message]
|