------------------------------------
newstype.php<?php
$db=mysql_connect("localhost","root");$query="SELECT * FROM newstype order by id asc";$result=mysql_db_query("tcbuudb",$query);
$num=1;while($r=mysql_fetch_array($result))
{
$str=$r["typename"];
echo '<input type="radio" value="'.$num.'" name="R1" ';

if($num==$_COOKIE['userselect'])
echo "checked";
echo ' OnClick=refresh('.$num.$T1.$D1.$S1.$T2.$T3.$T4.')>' .$str. "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
$num+=1;}
mysql_close($db);
?>---------------------------------
newsclass.php
<?php
$db=MySQL_connect("localhost","root");
MySQL_select_db("tcbuudb",$db);
$result=MySQL_query("SELECT * FROM newsclass order by id asc",$db);
$nnn=0;
while($myclass=MySQL_fetch_array($result))
{
$str=$myclass["classname"];
if($_COOKIE['userclass']==$nnn)
echo "<option selected> $str";
else
echo "<option> $str";
$nnn+=1;
}mysql_close($db);
?>