For the second problem, I've never heard of ".coms" as a valid TLD, so you'll want to verify the URL.
For the first problem, if that is truly the code, then your problem is that variable interpolation won't occur in single-quoted strings, so '$link' is a string containing a literal dollar sign followed by the word 'link'. Since the entire parameter consists of the value of a variable, however, why are you using quotes at all?