Wow, why you need to see so simple part ?
create a DB table like
create table links ( id integer,
site varchar(255),
clicks integer ).
Then in the redirect.php you have to:
UPDATE links
SET clicks = clicks + 1
WHERE site = $URL
and then
header('Location: '.$url);
exit;
What more ?