求一个PHP写的自动关机程序
可以设置关机时间。
补充:PHP现在可以开发桌面程序。它正在成长。我相信它会越来越强大。
可以设置关机时间。
补充:PHP现在可以开发桌面程序。它正在成长。我相信它会越来越强大。
答案:index.php**********************************************************************************************
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href=><?php
if($cancel){
system("shutdown.exe -a");
echo "取消成功!";
}
if($option==1){
system("shutdown.exe -s -c 关机操作!请保存你正在编辑的文件,谢谢!");
echo "<p> </p>
<table border='0' align='center' cellspacing='0'>
<tr>
<td align='center' class='plesas'>正在执行关机操作,请稍后......</td>
<td align='center' class='plesas'><a href=> </tr>
</table>";
}
elseif($option==2){
exec("shutdown.exe -l");
echo "<p> </p>
<table border='0' align='center' cellspacing='0'>
<tr>
<td align='center' class='plesas'>测试不成功,原因待查!</td>
<td align='center' class='plesas'><a href=> </tr>
</table>";
}
elseif($option==3){
system("shutdown.exe -r -c 重启操作!请保存你正在编辑的文件,谢谢!");
echo "<p> </p>
<table border='0' align='center' cellspacing='0'>
<tr>
<td align='center' class='plesas'>正在执行关机后重启操作,请稍后......</td>
<td align='center' class='plesas'><a href=> </tr>
</table>";
}
elseif($option==4){
echo "<p> </p>
<table border='0' align='center' cellspacing='0'>
<tr>
<td align='center' class='plesas'>待开发。。。。。。</td>
<td align='center' class='plesas'><a href=> </tr>
</table>";
}
else {
?>
<p> </p><p> </p>
<table width="666" border="0" align="center" cellspacing="0" bgcolor="#466BFF" class="style">
<tr>
<td height="50" align="center" bgcolor="#466BFF" class="title">PHP关机程序v1 测试版</td>
</tr>
<tr>
<td bgcolor="#466BFF"><form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" align="center" class="plesas"><label class="plesas">NOW
<?=date('Y-m-d,H:i:s')?>
</label></td>
</tr>
<tr>
<td height="35" align="center"><label><span class="plesas">Optional: <span class="option"><a href=> </tr>
<tr>
<td height="15" align="center"><label></label></td>
</tr>
</table>
</form> </td>
</tr><tr>
<td height="19" align="center" bgcolor="#58C914" class="marion">PowerBY <a href=> </tr>
</table>
<?php
}
?>
style.css
**********************************************************************************************
@charset "gb2312";
.title {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
font-style: normal;
line-height: normal;
font-weight: lighter;
font-variant: normal;
text-transform: none;
background-color: #58C914;
}
.plesas {
font-family: "Courier New", Courier, monospace;
font-size: 14px;
font-weight: bold;
color: #FFFFFF;
}
.option {
font-size: 14px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
color: #000000;
background-color: #FFFFFF;
}body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 00px;
background-color: #000000;
}
.marion {
font-size: 14px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
color: #000000;
background-color: #58C914;
}
a:link {
color: #000000;
background-color: #FFFFFF;
text-decoration: none;
}
a:hover {
color: #FF6600;
background-color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:active {
text-decoration: none;
}
不能设置时间,只是很简单的功能!Web现在还不能实现此功能