php - Replace Value of Variable in Query -
currently have page1.php
being entered url bar variable status , string in url http://example.com/page1.php?status=red
. when user clicks enter, redirects page2.php
, generates more variables , adds &status=
@ end of url http://example.com/page2.php?status=red&varone=1&vartwo=2&status=green
instead of having 2 status variables in url, remove 1st 1 left &status=green
@ end.
here code have header redirect:
$query = $_server["query_string"]; header("location: page2.php" . $query . "&status=" . $currentstatus);
i rather remove first ?status=
if possible, since want &status=
@ end of url
if want remove first occurrence of status query string better remove previous url.
Comments
Post a Comment