if( $row[userName]=="" )

echo "你的输入有误,请重新输入";
echo "<script>\n";
echo "setTimeout(\"self.location='index.php'\",1*1000);\n";//1000*1ms
echo "</script>";
exit;
}
....