分类 技术经验 下的文章

html部分

您的姓名:

您的微信:

您的公司:

您的电话:

您的职位:

php部分

<?php
session_start();
$allow_sep = "3000000";
if (isset($_SESSION["post_sep"]))
{
if (time() - $_SESSION["post_sep"] < $allow_sep)
{

    exit("请不要刷新!刷新后礼品逃跑了。。。"); 

}
else
{

 $_SESSION["post_sep"] = time(); 

}
}
else
{
$_SESSION["post_sep"] = time();
}
?>

<?php
$name = $_POST['name'];
$wechat = $_POST['wechat'];
$company = $_POST['company'];
$tel = $_POST['tel'];
$zhiwei = $_POST['zhiwei'];
$content = "姓名: ".$name ."微信: ".$wechat."公司: ".$company."联系电话: ".$tel."职位: ".$zhiwei."\n";
$f = fopen("/xxx/list.txt", 'a+');//指定文件路径Windows下用/,在文件的结尾插入,所以用了fopen和a+,
fwrite($f, $content);
fclose($f);
?>
嗨~你好! <?php echo htmlspecialchars($_POST['name']); ?>


微信<?php echo htmlspecialchars($_POST['wechat']); ?>


联系电话<?php echo (int)$_POST['tel']; ?>


公司<?php echo htmlspecialchars($_POST['company']); ?>


职位<?php echo htmlspecialchars($_POST['zhiwei']); ?>


请将该页面展示给工作人员后领取小礼品请勿刷新改页面

用 supervisor
先安装 supervisor
sudo apt install supervisor
创建 supervisor frps 配置文件
在 /etc/supervisor/conf.d
创建撇脂文件 frp.conf

[program:frp]
command = /root/frp/frps -c /root/frp/frps.ini
autostart = true

重启supervisor服务
systemctl restart supervisor
查看supervisor运行状态
supervisorctl status

JSON example using Sonoff Basic Smart Switch & ESPEasy.

ThomasB, Apr-10-2019

Connect to ESPEasy on local IP (change as needed to match the device) and load the jason into a array called "espez"

import json, requests
url = requests.get('http://192.168.1.81/json')
espez = json.loads(url.text)

Show an example of printing the current value of the built-in push button switch.

Device configuration as follows: Task= 1, Device= Switch input-Switch, Name= PBSW

print("Device Name: ", espez'Sensors'['TaskName'])

wendu = int(espez'Sensors''TaskValues'['Value'])

print("Temp is : ", wendu)

if wendu >=27: #判断并且显示温度高低

print('Hot Temp is:',wendu,'°C')

else:

print('Cool Temp is:',wendu,'°C')


参考链接:
https://www.letscontrolit.com/forum/viewtopic.php?f=6&t=6612&p=36311

这个算是一键命令
不用敲命令的创建方式:
GitHub上的项目
https://github.com/oblique/create_ap
git clone https://github.com/oblique/create_ap.git
cd create_ap
sudo make install
安装完成
安装下依赖库
sudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq
接下来运行命令开启AP
启动AP服务systemctl start create_ap
添加到开机启动systemctl enable create_ap
/etc/create_ap.conf这里是配置文件,可以直接改里面的信息,然后运行上面的命令也可以生成自定义的
CHANNEL=default
GATEWAY=10.0.0.1
WPA_VERSION=2
ETC_HOSTS=0
DHCP_DNS=gateway
NO_DNS=0
NO_DNSMASQ=0
HIDDEN=0
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
HT_CAPAB=[HT40+]
VHT_CAPAB=
DRIVER=nl80211
NO_VIRT=0
COUNTRY=
FREQ_BAND=2.4
NEW_MACADDR=
DAEMONIZE=0
NO_HAVEGED=0
WIFI_IFACE=wlan0
INTERNET_IFACE=eth0
SSID=MyAccessPoint
PASSPHRASE=12345678
USE_PSK=0