dongxi1943 2011-06-16 14:19
浏览 46
已采纳

div刷新页面时会降低

I want to make a page for android which is refreshing in every sec . All things are working well but the problem i am facing on this page when you click on the reserve button then entire div come down and leave a small space above but after next refresh it becomes ok . I have tried without div but its not working Here is the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
Header('Refresh:2;url=http://medical.gofreeserve.com/and/checkm.php');
?>
<head>

<style type="text/css">
<!--
.style2 {color: #FFFFFF}
-->
</style>
</head>

<body  bgcolor="#000000">

<?php 

include("../common/connection.php");

?>



<?php   


if(isset($_GET['reserve']))
{
 echo $sql = "UPDATE    newsevents SET booking ='1'  WHERE news_id='$_GET[val]'";
 $query = mysql_query($sql) or die(mysql_error());  
 }







$new_query=mysql_query("select * from newsevents where booking=0") or die(mysql_error());
while($row=mysql_fetch_array($new_query))
{
$id=$row['news_id'];
$date=$row['date'];
$news_text=$row['text'];



?> 



<div style="border-bottom:2px solid #FFFFFF" >
<form name="fm1" action="checkm.php"  method="get">
<table width="95%">



<tr>
<td width="60%" height="50" ><span class="style2"><?php echo $date ?></span></td>
<td width="40%"><span class="style2"><?php echo $news_text ?></span></td>
<td width="40%"><span class="style2"><input type="hidden" name="val" value="<?php echo $id?>" / ></span></td>
<td width="30%"><input type="submit"  name="reserve" id="reserve"  value="reserve"  /></td>

</tr>


</table>

</form>
</div>







<?php }?>



</body>
</html>
  • 写回答

1条回答 默认 最新

  • duankang8114 2011-06-16 14:32
    关注

    You're echoing the SQL statement when running the SQL query, which is pushing down the div. Just use the following instead:

    if(isset($_GET['reserve']))
    {
      $sql = "UPDATE newsevents SET booking ='1'  WHERE news_id='".$_GET['val']."'";
      $query = mysql_query($sql) or die(mysql_error());  
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像