获取的mysql_query脚本访问PHP站点后执行30秒 [英] Get a mysql_query script to execute 30 seconds after visiting the php site

查看:95
本文介绍了获取的mysql_query脚本访问PHP站点后执行30秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
   PHP的MySQL后做任务30秒

有没有办法获得的mysql_query脚本访问PHP站点后执行30秒。

is there a way to get a mysql_query script to execute 30 seconds after visiting the php site.

这将是一个移动设备专门在Android设备上。我的用户后,点击提交我想请求mysql_query脚本30秒后运行已经过去了。

This would be on a mobile device specifically the android device. After my user clicks submit i would like the mysql_query script to run after 30 seconds has passed.

推荐答案

您可以使用JavaScript,例如使用jQuery这可能看起来是这样的:

You could use javascript, for example with jQuery this might look something like:

$('#form').submit(function(e) {
    e.preventDefault(); // stop form from submitting when submit is clicked
        setTimeout(function() { // set a 30 second timer to make an ajax request to your php script
        $.ajax('mysqlscript.php');
    }, 30000);
});

这篇关于获取的mysql_query脚本访问PHP站点后执行30秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆