Jump to content

Keeping URL Elements after form submission


Moorcam

Recommended Posts

Howdy all.

 

Not a bad evening here in VIC :D

 

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.