The 2 files should be on the same location and php is installed in your server
A.html
...
<a href="https://stackoverflow.com/questions/54946766/B.php?data1=1654&data2=string">Button</a>
...
B.php
<?php
echo $_GET['data1']; // output "1654"
echo $_GET['data2']; // output "string"
solved Pass Variable To Another file [closed]