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 ...
随机推荐
- window.parent与window.opener的区别与使用
window.parent 是iframe页面调用父页面对象 举例: a.html 如果我们需要在b.html中要对a.html中的username文本框赋值(就如很多上传功能,上传功能页在ifrma ...
- Servlet 的基本架构
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpSer ...
- UVa1584 Circular Sequence
#include <stdio.h>#include <string.h> int less(char* str, size_t len, size_t p, size_t q ...
- app自动化的webView页面测试思路(appium工具)。
1.获取当前activity多有的handles,然后去遍历它,发现webView后切换到webView对应模式,就可以了.进一步操作webView的话用下面的方法(driver.getPageSou ...
- 交换右ctrl和capslock
记得几年前开始使用Emacs,因为使用ctrl键太频繁了,所以上网查了下解决方案,看到这篇文章 .把capslock和左ctrl交换,简直要泪流满面啊!立马照着做,从此在所有使用的电脑上都对此进行了设 ...
- 自定义Chrome 背景色 (FF需要User Styles插件)
Chrome有个自定义背景色的文件 Custom.css 默认里面什么字都没写 html, body {background-color: #e0dcc0!important;} 这个颜色 ...
- $.ajax和vue-resource实现OAuth
Vue.js——使用$.ajax和vue-resource实现OAuth的注册.登录.注销和API调用 概述 上一篇我们介绍了如何使用vue resource处理HTTP请求,结合服务端的REST A ...
- Hibernate JPA中@Transient、@JsonIgnoreProperties、@JsonIgnore、@JsonFormat、@JsonSerialize等注解解释
@jsonignore的作用作用是json序列化时将java bean中的一些属性忽略掉,序列化和反序列化都受影响. http://www.cnblogs.com/toSeeMyDream/p/443 ...
- 导入Excel加行公式和验证
package com.sprucetec.tms.controller.fee.export; import com.sprucetec.tms.controller.base.BaseFeeExp ...
- perl5 第十二章 Perl5中的引用/指针
第十二章 Perl5中的引用/指针 by flamephoenix 一.引用简介二.使用引用三.使用反斜线(\)操作符四.引用和数组五.多维数组六.子程序的引用 子程序模板七.数组与子程序八.文件句 ...