Hi there, i suspect that what you need to do is to URLENCODE the link you are trying to visit as all of the parameters you are passing in the url are going to your script and not the URL you want to visit.
So to form your tracking link do this:
<?php
$url = urlencode('http://www.specificsite.com/rd/Clk.jsp?s=wf&k=keyword&lnk2=rhhE%3F..iy29%27wBAyekxpr%27fsCqvrkh%27pDB.osC.fsCqvrkh%27qAA%3EpAsplhrxDigr%29t%3DH8441%29w%3DIPpl5VF6ugxg147aHWwZOBsM%3A1NJVlf2u9ZM%3FBLUzAb1kJ%3A0F97Gy8DYgLUh%3AbDNf0f%3Ah9j1YCNlJJ2fpTUVhXxhmgRyuV8oFd941s7j5LrmZJ9hW872h0jtOJUXjA%3ASHUZZRU8%3FhU2QRWBfgV10KB74z1dW7Asl59BuFV1VFZJZZ%7C2%2729&p=17373&sid=747113&ex=1100835534913');
?>
http://www.mysite/track.php?url=<?php print $url;?>
Then in your counting script you need to decode the url:
<?php
$connection = mysql_connect('localhost', 'username', 'password') or die('Could not connect to server');
mysql_select_db('dbname');
mysql_query('UPDATE '. $_COOKIE['username'].' SET count=count+1 WHERE id = 1');
header('Location: '. urldecode($url));
?>
Hope this helps.
Jamie