Reputation: 117
I currently have it set up so that to navigate to various pages you click links on index.php, which then load into the content box of index.php.
I currently have a form on one of those pages that once submitted, I would like to redirect to the index.php page. But instead of displaying the default content on index.php, I'd like to specify the page loaded into the content box.
Is there a way to do this using a header? eg. header('Location: index.php#<contentboxpagehere>');
??
Thanks!
Upvotes: 0
Views: 242
Reputation: 36
So if I have understood correctly, you have a form and after a successful submission you want to redirect to the front page and display the right output message with an AJAX call in your defined page container.
You can achieve that in many ways. Keeping it simple and PHP you can do that with either a POST or GET request on the index page passing the container id you want to call in your front page AJAX container.
Using GET, pass URL parameter like: index.php?cbpId=success
Get the $_GET['cbpId'] and load the right content on the front page.
Upvotes: 1