hello all. i wasnt sure if this should go in the php or javascript forum but here we go. i have a php table pulling info from a mysql table. each row contains the name of a user. the users names are links which should take you to a bio page when clicked. i cant seem to get the coding right though. heres my code...
<?php
$mosttracks = mysql_query ("SELECT *, member_id as mem_id, name as n, COUNT(name) as cn, MIN(date_added) FROM tracks GROUP BY name ORDER BY COUNT(name) DESC, date_added asc LIMIT 3");
$number=1;
while($row = mysql_fetch_array($mosttracks))
{
echo "<tr>";
echo "<td align=left><a href=\"generic profile.php\" onclick=\"createcookie()\">" . $number . ". " . $row['n'] . " (" . $row['cn'] . ")" . "</a></td>";
echo "</tr>";
$number++;
$id=($row['mem_id']);
}
?>
<SCRIPT LANGUAGE="JavaScript">
function createcookie()
{
document.cookie = "UMAlink=<?php echo "$id"; ?>;"
}
</script>
...the code is supposed to get the users member id and put it ina cookie to be retrieved and used to populate info on a linked page called generic profile. im thinking the problem is with my javascript but if its a php issue i'll repost this in the php forum. thanks in advance for the help.