Just a tip, this is redundant:
if(linkback($surl,$ururl)==true)
Should be:
if(linkback($surl,$ururl))
If the linkback() function returns true, it will evaluate the if statement to true, if it returns false, it will evaluate it to false. There's no need to do a comparison in the if statement.