How to keep already-set GET parameter values on form submission?

后端 未结 7 859
广开言路
广开言路 2020-12-17 08:10

I have a URL : foo.php?name=adam&lName=scott, and in foo.php I have a form which gives me values of rectangleLength & re

7条回答
  •  借酒劲吻你
    2020-12-17 08:45

    Once, I needed sorting the results in a table keeping the search results coming from GET. I did like that:

    unset($_GET['sort']); // sort param is removed, otherwise there will be created many sort params
    $url = http_build_query($_GET);
    
    echo "Title";
    echo "Author";
    

提交回复
热议问题