代码如下.目前只能是手工备份.我想增加个选择.然后设定时间.让到指定的时间时.自动执行那个按钮来备份.可以吗?
<table width="99%" height="127" border="1" align="center" cellpadding="2" cellspacing="1" bordercolor="f1f1f1" class="t17">
      <tr class="t11">
        <td height="22" bordercolor="cccccc" bgcolor="#FDF4CA">按日期备份数据</td>
        </tr>
      <tr>
        <td bordercolor="cccccc"><p>开启自动备份:
          <input type="radio" name="radio" id="radio" value="radio" accesskey="3" tabindex="4">
        </p>
          <p>自动备份时间:
            <input type="text" name="textfield" id="textfield">
          </p>
          <p>&nbsp;</p>
          <table width="291" height="59" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
            <td align="center" nowrap> <form name="myform" method="post" action="index.php?action=xt_copy&act=yes" >
            <?   if ( !$_SESSION['fsave'] ){?>
               请选择备份日期:
               <select name="date_num" id="date_num">
   
  <?
$result = mysql_query("select * from ka_riqi order by nnnn desc");   
while($image = mysql_fetch_array($result)){
     echo "<OPTION value=".$image['nnnn'];
echo ">".$image['nn']."</OPTION>";
  }
?>
   
   </select>&nbsp;<input type="submit"  class="button_a"  name="fsubmit" value=" 开始备份数据  " onClick="fs()">   
   
<? } else{
echo "\t\t\t  <input type=\"button\"   name=\"fsubmits\" value=\"";
echo "备份成功!";}?>
   
           </form>
   </td>
          </tr>
      </table> 
          </td>
        </tr>
    </table>

解决方案 »

  1.   

    <html>
    <head>
    <script type="text/javascript">
    var t;
      function ready()
    {
      var d=new Date();
      if(d.getSeconds()==22)  
      {
        //clearTimeOut(t);
        alert(d.getSeconds());
        document.write("到时间啦");//这里写入你的消息
       return;
      }
      else
      {
       
       setTimeout("ready()",1000);
      
      }
    }
    </script>
    </head>
    <body onload="ready()">
      
    </body>
    </html>
      

  2.   

    <html>
    <head>
    <script type="text/javascript">
    var t;
    function ready1()
    {
     t=self.setInterval(ready(),1000);
    }
      function ready()
    {
      var d=new Date();
      if(d.getSeconds()>=22)  
      {
       alert(d.getSeconds());
       document.write("到时间啦");//这里写入你的消息
       window.clearInterval(t);
      }
      
    }
    </script>
    </head>
    <body onload="ready1()">
      
    </body>
    </html>
      

  3.   

    是sqlserver 数据库吗?只要开启 sqlserver agent 然后点点鼠标  设置一下  很简单的 网上查下就知道了
      

  4.   

     不是.是mysql 的..
    这个是是想定时备数据里的其中一个表的数据...可以设置时间..来选定什么时候备份.
      

  5.   


    <!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">
    <head>
        <script type="text/javascript">        //strarTime 开始执行时间
            //runInterval 运行间隔 单位秒,如果为0只运行一次
            //fn 触发作业执行函数
            //delay 检测时间频率 单位毫秒
            function TimingJob(startTime, runInterval, fn, delay) {            var self = this;            this.runningTime = new Date(startTime.replace(/\-/g, "/"));            this.runInterval = runInterval;            this.fn = fn;            this.delay = delay;            var jobID;
                this.StartJob = function () {                if (this.delay) this.delay = 1000; //设置默认检测间隔                if (this.runInterval) this.runInterval = 60; //设置作业执行间隔                jobID = setInterval(function () {                    var timeSpan = parseInt((self.runningTime - new Date()) / 1000);                    if (timeSpan < 0) {
                            self.StopJob();
                            alert("设置启动时间无效");
                            return;
                        }                    if (timeSpan == 0) {                        if (self.fn) self.fn();                        else { alert("未指定作业运行方法"); self.StopJob(); }                        if (self.runInterval != 0) {                            self.runningTime = new Date(
                                                self.runningTime.getFullYear(),
                                                self.runningTime.getMonth(),
                                                self.runningTime.getDate(),
                                                self.runningTime.getHours(),
                                                self.runningTime.getMinutes(),
                                                self.runningTime.getSeconds() + self.runInterval);                        } else {
                                self.StopJob();
                            }
                        }
                    }, delay);            }
                this.StopJob = function () {
                    clearInterval(jobID);
                }        }        var tj;        function start() {
                //从 2010-12-19 11:40:44  每隔10秒运行一次 指定方法
                tj = new TimingJob("2010-12-19 11:40:44", 10, function () { alert("开始执行作业!") }, 1000);
                tj.StartJob();        }
            function stop() {
                tj.StopJob();
            }
        </script>
    </head>
    <body>
        <input type="button" value="start" onclick="start()" />
        <input type="button" value="stop" onclick="stop()" />
    </body>
    </html>
      

  6.   

    js 用setInterval  每秒检测一次就可以,当然 获取时间,一个是服务器时间!
    楼主的这个功能,最好再服务器端实现!
      

  7.   

    如果是要服务端做自动作业还是写个Windows服务比较好
      

  8.   

    也可以用java的这两个类来实现TimerTask和Timer来实现。在服务器端。你自己去看看吧。
      

  9.   

    用setTimeout("function()",1000);
    在function()函数里面写你要执行的备份就可以了。