如何做一个像按钮脚本?

时间:2016-01-14 01:07:29

标签: php

我正在建立一个社交网站,但是我无法弄清楚我会如何按钮将其提交到数据库中的位置,以获得没有页面刷新或者页面刷新的正确状态表单重置发生总体上只是破坏脚本而且我不能使用外部脚本,因为它不能具有$ row [' id']返回的状态ID;附:我正在使用PHP。但它必须在while()循环中,从数据库中获取状态。提出任何必要的问题来帮助我。

这是代码的编辑版本,使其不那么笨重,但如果你需要完整的东西,请告诉我,我会粘贴它。

while($row = mysqli_fetch_array($get_feed))
{
    echo "<div class='container' style='background-color:blue;' margin:0px; padding:0px;'>";
    echo "<h1 class='header-text' style='font-size:300%;'>@<u>" . $row['username'] . "</u></h1><h1 style='float:right; padding:0px; margin:0px; margin-right:5px;'>" . $row['id'] . "</h1>";
    echo "<br />";
    echo "<center>";
    echo "<h3 style='font-size:250%; padding:0px; margin:0px;'>" . $row['status'] . "</h3>";
    echo "<h3 style='font-size:200% padding:0px; margin:0px;'>" . $row['time'] . "</h3>";
    echo "<br />";
    echo "</center>";
    echo "</div>";  
}

1 个答案:

答案 0 :(得分:0)

使用&#34; onclick&#34;

<script>
    function click01()
      {
          <--What to do -->
      }
</script>

//change input type to button
<input type = "button" onlick = "click01"/>