remove GET parameter in URL after processing is finished(not using POST), PHP

后端 未结 4 877
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-15 06:15

I have url like this http://localhost/join/prog/ex.php

When i use GET method the url address like this http://localhost/join/prog/ex.php?name=MEMO

4条回答
  •  旧时难觅i
    2020-12-15 06:52

    i guess after calling the url you want to redirect to the file ex.php , but this time without any parameters. for that try using the following code in ex.php

    ';
    exit;
    }
    else{
     /* here rest of the body i.e the codes to be executed after redirecting or without parameters.*/
    echo "Hi no parameters present!";
    }
    ?>
    

    here what u did id just redirect redirect to the same page without checking if any parameter is there in the query string. the code intelligently checks for the presence of parameters, id any parameters are there it will redirect to ex.php else it will print "Hi no parameters present!" string!

提交回复
热议问题