下面的代码是点击触发的,想改成访问触发。请教怎么改。不使用js,弄成php文件,然后linux定时访问这个php文件触发事件。是不是php要post到下面的url,如何post呢
<input type="button" value="开始检测" id="start">
<script type="text/javascript">
var gather_num = <?php echo $jc_num; ?>;
var xb = 0;
$('#start').click(function(){
$("#schedule").show().find("span").html(xb+'/'+gather_num);
good(xb);
});
function good(key){
var url = <?php echo $urljson; ?>;
$.ajax({
url: "/?mod=ajax&ac=check&op=coupon",
data:{id:url[key].id,'url':url[key].url},
type: 'POST',
dataType: 'json',
<input type="button" value="开始检测" id="start">
<script type="text/javascript">
var gather_num = <?php echo $jc_num; ?>;
var xb = 0;
$('#start').click(function(){
$("#schedule").show().find("span").html(xb+'/'+gather_num);
good(xb);
});
function good(key){
var url = <?php echo $urljson; ?>;
$.ajax({
url: "/?mod=ajax&ac=check&op=coupon",
data:{id:url[key].id,'url':url[key].url},
type: 'POST',
dataType: 'json',
解决方案 »
- 做了一个小偷程序post无法查询结果
- php 新手入门-----请指点指点该看什么资料最快入门。。。
- php 查询显示
- 打开一个php的首页出现 Failed to load the theme frame and / or home file 怎么回事呢。
- php中flush和header同时使用报错问题
- 我有个外包项目,谁有兴趣?(限上海地区)
- 怎么得到这种变量?$r1,$r2,$r3,$r4......(高分相送)
- 一个新手的提问
- 如何打印出 $_FILE
- thinkphp不用ajaxReturn返回数据、前端怎么接收
- php中使用curl,求助,多谢
- 为什么这种socket程序会无限执行sql语句而不被挂起?
http://cn2.php.net/manual/zh/curl.examples.php
$url = "http://localhost/test.php";
$post_data = array ("id" =>1,"url" => "xxxxx");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);