duanpu2272 2014-03-17 10:31
浏览 85
已采纳

如何将数据从秒表javascript存储到MySQL

I have a java stopwatch script and I really don't remember where I get it.

This script works fine, but what I need is when the stop button is pressed or the start button is pressed to store the data in the MySQL.

The Javascript is here: http://landingpage.al/script.js

The purpose of this is that I will have some user that will do different things on a work space and on each state of the work their work time will be calculated and stored.

So if anyone have a better idea will be helpful.

The actual php timer is here: http://landingpage.al/articolo100.php

  • 写回答

1条回答 默认 最新

  • douzhuo1858 2014-03-17 12:59
    关注

    Form:

    <div id="main">
    <form name="input" id="myform" action="here.php" method="post">
    <button type="button" id="1" name="fillo" onclick="ss();start()">Start</button>
    <button type="button" id="2" name="mbaro" onclick="ss();start()" onfocus="this.blur()">Stop</button>
    <input type="text" id="disp" name="koha"> <br>
    </form>
    

    Script:

    <script>
    function start(){
    document.getElementById("myform").submit();
    }
    </script>
    

    PHP for here.php:

    <?php
    echo $_POST['koha']; //Use the update command instead of echo
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探