I want to pass some PHP variables using the URL.
I tried the following code:
link.php
You're passing link=$a and link=$b in the hrefs for A and B, respectively. They are treated as strings, not variables. The following should fix that for you:
echo 'Link 1';
// and
echo 'Link 2';
The value of $a also isn't included on pass.php. I would suggest making a common variable file and include it on all necessary pages.