小编use*_*520的帖子

如何使用PHP创建cron作业?

我是新手使用cron工作.我甚至不知道如何写它.我试图从互联网上搜索,但我仍然不太了解它.我想创建一个每分钟执行我的代码的cron作业.我正在使用PHP来创建它.它不起作用.

run.php (将每分钟执行的代码)

<?php

echo "This code will run every minute";

?>
Run Code Online (Sandbox Code Playgroud)

cron.php

<?php

$path = dirname(__FILE__);
$cron = $path . "/run.php";
echo exec("***** php -q ".$cron." &> /dev/null");

?>
Run Code Online (Sandbox Code Playgroud)

假设这两个文件在同一个文件夹中.

代码是我做错了吗?如果错了,请告诉我如何解决它.

php cron

93
推荐指数
5
解决办法
34万
查看次数

如何根据用户选择的单选按钮更改要显示的内容?

我将创建 3 个单选按钮供用户选择。一旦用户单击该按钮,它将向用户显示用户选择的单选按钮的描述。

例如

- if user select first radio button ==> it will show the description under that
                                        radio button

- if user select second radio button ==> it will show the description under that
                                        radio button

- if user select third radio button ==> it will show the description under that
                                        radio button
Run Code Online (Sandbox Code Playgroud)

我的代码

<p><input type='radio' name='content_type' value='1' />&nbsp;This is content A of request</p>
<p><input type='radio' name='content_type' value='2' />&nbsp;This is content B of request</p>
<p><input type='radio' name='content_type' value='3' …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery

5
推荐指数
1
解决办法
9271
查看次数

标签 统计

cron ×1

html ×1

javascript ×1

jquery ×1

php ×1