Moorcam Posted July 14, 2017 Share Posted July 14, 2017 Howdy all. Not a bad evening here in VIC Anyways, I want to keep an ID in my URL after submitting a form. However, as we know, once you submit a form the page refreshes or redirects and I lose the elements from the URL as shown below: URL before submission: example.com/index.php?page_id=5 URL after submission: example.com/index.php Is it at all possible to keep the index.php?id=5 in the URL after submission? Thanks in advance. Link to comment Share on other sites More sharing options...
requinix Posted July 14, 2017 Share Posted July 14, 2017 Make the form submit to the URL you want, and/or make the code redirect to the URL you want. Really that simple. Link to comment Share on other sites More sharing options...
Moorcam Posted July 14, 2017 Author Share Posted July 14, 2017 Make the form submit to the URL you want, and/or make the code redirect to the URL you want. Really that simple. Yeah tried header Location but it still loses the elements for some reason. I already have the form submitting to itself, which is what I want it to do but it just loses the ?page_id=5 part and therefore shows a blank page because the data sent to the page from page_id is gone. Link to comment Share on other sites More sharing options...
Moorcam Posted July 14, 2017 Author Share Posted July 14, 2017 PMSL I am so tired. Got it. As simple as you said. action="edit-page.php?page_id=<?php echo $row['page_id']; ?>"> Thank you and apologies for being an ass Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.