$uri variable in function link() was breaking.

Changed $uri to $url