如何仅在登录时插入transuser表login_time和userId,我不想在刷新页面时添加它
<table border=1>
<tr>
<td>User name</td>
<td>Password</td>
<td>Home Page</td>
</tr>
<tr>
<?
$date=date('Y/m/d H:i',time());
$selUser=mysql_query("SELECT * FROM train_user where user_name='$user' ");
while ($rowUser=mysql_fetch_array($selUser)){
?>
<td><a href=""><?echo $rowUser['user_name'];?></a></td>
<td><?echo $rowUser['user_password'];?></td>
<td><?echo $rowUser['user_homepage'];?></td>
</tr>
</table>
<?}
mysql_query("INSERT INTO train_transuser (transuser_userId,transUser_loginTime) VALUES ('$user','$date')");
?>