RE: Reload page after form submit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks a lot,

I tried both suggestions, but it didn't work...

I did it send an Echo with this string:

<META HTTP-EQUIV='refresh' content='0;URL=index.php'>

After processing the form... it worked...

Is there any problem doing this?

Thanks again,
Wagner.



-----Original Message-----
From: Wouter van Vliet / Interpotential
[mailto:wouter@xxxxxxxxxxxxxxxxxx]
Sent: quinta-feira, 30 de agosto de 2007 14:44
To: Per Jessen
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  Reload page after form submit


On 30/08/2007, Per Jessen <per@xxxxxxxxxxxx> wrote:
>
> Wagner Garcia Campagner wrote:
>
> > Hello,
> >
> > I'm building a web page just like a blog...
> >
> > Where the user input some information... (name, website and comment)
> >
> > This information is stored in a file...
> >
> > And then the page displays it...
> >
> > When the user access the page the first time, the information is
> > displayed correct...
> >
> > After the user submit the information, the page become outdated...
> > without this last information the user submitted...
> >
> > Is there a way to tell PHP to reload the page after the user submit
> > the information, so the page is always updated??
>
> After you've processed the POST request, you finish with something like
> this:
>
> header("HTTP/1.0 303 See other");
> header("Location: #");
> exit;


It needs a little bit more than that. The script to which the form has been
submitted knows about the $_POST data, once you Location: to another page
that gets forgotten. Just add a line like $_SESSION['lastFormSubmit'] =
$_POST just before the first header() call and you're fine.






-- 
Interpotential.com
Phone: +31615397471

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux