Other methods are dirty and there may be some problems. You are best off using javascript:
<script>
function get_data(name){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if(results == null) return "";
else return results[1];
}
var var1 = get_data('var1');
var var2 = get_data('var2');
</script>
But it is not safe yet.
Another way to do this that I was just thinking about is to print the $ _GET array. However, I do not know if this will work. In any case, if so, then here it is:
<script>
var _get = <?php print_r($_GET); ?>
var team1 = _get['team1'];
var team2 = _get['team2'];
</script>
And you want to run array_walk (or something like that) for the function to clear each row.
source
share