Jump to content

Keeping URL Elements after form submission


Go to solution Solved by requinix,

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.