source code of MES Data
<HTML>
<HEAD>
<TITLE>TELOGS</TITLE>
</HEAD>
<BODY>
<?php
/* command line parameters: wget "http://localhost/query.php?action=query&sn=123" -O get1.html */ $act=$_GET["action"];
/* http://localhost/query.php?action=query&sn=123 */
if ($act == "query"){
$serialnumber=$_GET["sn"]; $con = mysql_connect("localhost","root","123456");
if (!$con){
die('Could not connect: ' . mysql_error());
} mysql_select_db("test", $con);
$sql = "SELECT * FROM testlogs where Serial_number='$serialnumber'";
$result = mysql_query($sql);
if (mysql_num_rows($result) != "0" ){
while($row = mysql_fetch_array($result))
{
echo $row['Serial_number'] . "|" . $row['Mac_addr']."|". $row['OA_KEY']."\n";
}
}else{
echo "No data of this serial number=".$serialnumber;
}
mysql_close($con);
}
?> <?php
/* http://localhost/query.php?action=add&sn=123&mac=eeee&oakey=123 */
if ($act == "add"){ $serialnumber=$_GET["sn"];
$macaddr=$_GET["mac"];
$oakey=$_GET["oakey"]; $con = mysql_connect("localhost","root","123456");
if (!$con){
die('Could not connect: ' . mysql_error());
} mysql_select_db("test", $con);
$sql="INSERT INTO testlogs (Serial_number, Mac_addr, OA_KEY) values ('$serialnumber','$macaddr','$oakey')";
if(mysql_query($sql)){
echo "Add data Passed";
}else{
echo "Add data failed";
}
mysql_close($con);
}
?>
</BODY>
</HTML>
版权声明:本文博主原创文章。博客,未经同意不得转载。
source code of MES Data的更多相关文章
- Memcached source code analysis (threading model)--reference
Look under the start memcahced threading process memcached multi-threaded mainly by instantiating mu ...
- Learning from the CakePHP source code - Part I
最近开始痛定思痛,研究cakephp的源码. 成长的路上从来没有捷径,没有小聪明. 只有傻傻的努力,你才能听到到成长的声音. 下面这篇文章虽然过时了,但是还是可以看到作者的精神,仿佛与作者隔着时空的交 ...
- Source Code Review
1.berfore we talking abnout the Source Code review,here's what we want to know about the most popula ...
- HashMap source code view(1)
前言 HashMap source code view 类注释 Hash table based implementation of the Map interface. This implement ...
- How to compile and install Snort from source code on Ubuntu
http://www.tuicool.com/articles/v6j2Ab Snort is by far the most popular open-source network intrusio ...
- CRC32 Source Code
/* The Quest Operating System * Copyright (C) 2005-2010 Richard West, Boston University * * This pro ...
- attack source code
不废话,直接上代码, 先看截图use pictures;
- Tree - AdaBoost with sklearn source code
In the previous post we addressed some issue of decision tree, including instability, lack of smooth ...
- Tree - Decision Tree with sklearn source code
After talking about Information theory, now let's come to one of its application - Decision Tree! No ...
随机推荐
- [Jobdu] 题目1520:树的子结构
题目描述: 输入两颗二叉树A,B,判断B是不是A的子结构.注:B为空树时不为任何树的子树 typedef struct BTNode{ int key; struct BTNode *rchild; ...
- (转)Windows重启延迟删除,重命名技术原理
所谓重启延迟删除技术,就是在操作系统启动前删除或者替换文件! 说起重启延迟删除,大家可能都很陌生,但是实际上,该功能已经被各种软件所采用:如安装Windows 补丁程序(如:HotFix.Servic ...
- CSS 文章段落样式
#adiv p { text-align: left; text-indent: 2em; line-height:25px; font-family:微软雅黑; font-size:medium; ...
- python的内置函数bin()
bin(x) 中文说明:将整数x转换为二进制字符串,如果x不为Python中int类型,x必须包含方法__index__()并且返回值为integer: 参数x:整数或者包含__index__()方法 ...
- 玩转无线 — GNURADIO 简单运用
大家好, 我是Insight-labs的旺财,这里放出个旺财在Bsides Toronto 2013 会上RF-Ninjia Hacking议题中的一个案例,随着物联网越来越火热,而物联网又离不开无线 ...
- 在VC6中基于dll开发插件用于各种图片显示(BMP/TGA/JPG/GIF/PNG/TIF/ICO/WMF/EMF/...)
一.图片显示 图片显示的方法: 1. 直接写程序 2. 第3方库 3. 调用COM组件的IPicture接口 4. 使用MFC的CPictureHolder类 5. 使用GDI+的CImag ...
- Curling 2.0(dfs回溯)
Curling 2.0 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15567 Accepted: 6434 Desc ...
- iOS开发之第三方登录微信-- 史上最全最新第三方登录微信方式实现
项目地址 : https://github.com/zhonggaorong/weixinLoginDemo 最新版本的微信登录实现步骤实现: 1.在进行微信OAuth2.0授权登录接入之前,在 ...
- shell:监控进程运行状态并自动重启进程
#!/bin/sh MAXRSTCOUNT=; PROCTOGO=/mnt/hgfs/code/test/show #count is the counter of test started time ...
- 解决Sublime Text3莫名的中文乱码问题
有好几回用Sublime Text3写着中英混杂的文字的时候,会突然就弹出警告说什么编码不行,然后点击确定后,原来的中文全都乱码了: 然后即使按ctrl+z撤回也没用,重新打开也没用,用记事本的转换a ...