-2

I have a form that filters the products by some characters such as size/price etc.. I would like to change the url variables values according to the filter result for example:

Before submit:

www.exmaple.com/product.php

after submit

www.example.com/product.php?size=1&price=300

How can I do that?

Imri Persiado
  • 1,857
  • 8
  • 29
  • 45

1 Answers1

0

Try something like this

if(isset($submit))
{
//After clicking the button , do some operations here....

//Your code...

//More code...

header("location:product.php?size=1&price=300");
}

EDIT :

This is most common error check this thread. Also, if that doesn't work. Replace your header with

echo "<script>document.location.href=product.php?size=1&price=300</script>";

Community
  • 1
  • 1
Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126