Reputation: 5961
I'd like to know how to implement 303 redirect for displaying post
data.
Example:
I send the form.
Redirect
Page displays the info I just posted. (Eg: Name, email).
I think it is done with parameters, like /index.php?name=TheName&email=theEmail
but i'm not sure, since I've tried to find some good article explaining it but couldn't.
Thanks a lot.
Upvotes: 7
Views: 17630
Reputation: 46602
You can do it other ways rather then passing the parameters in the url.
Upvotes: 1
Reputation: 3185
In PHP you can perform a 303 redirect using header()
:
header("HTTP/1.1 303 See Other");
header("Location: http://$_SERVER['HTTP_HOST']/new/location/here");
The problem you may face is retaining the form information after the redirect. One solution might be using PHP session variables to store the form data.
You could redirect using parameters to pass the submitted data, but that isn't what I'd consider a 'clean' solution.
Upvotes: 15