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 ...
随机推荐
- HTML静态网页的格式与布局(position:(fixed、absolute、relative)、分层、float(left、right))
一.position:fixed 锁定位置(相对于浏览器的位置),例如有些网站的右下角的弹出窗口. 示例: 二.position:absolute 1.外层没有position:absolute(或r ...
- WINFORM Tootip使用小结
toolTip1.Active = true; //激活工具提示,只有激活才会显示提示 toolTip1.IsBalloon = true; //toolTip以气泡形式出现 toolTip ...
- [NOIP2001提高组]CODEVS1014 Car的旅行路线(最短路)
最短路,这个不难想,但是要为它加边就有点麻烦..还好写完就过了(虽然WA了一次,因为我调试用的输出没删了..),不然实在是觉得挺难调的.. ------------------------------ ...
- codility上的练习(5)
codility出了lesson 5了. (1) 合法括号序列,包括( [ { ) ] }这6种字符的字符串,长度N在[0..200000]范围内,为其是否合法. 要求时间复杂度O(N),空间复杂度O ...
- php多图合并
function mergerImg($imgs) { list($max_width, $max_height) = getimagesize($imgs['dst']); $dests = ima ...
- C# 读书笔记之访问虚方法、重写方法和隐藏方法
C#允许派生类中的方法与基类中方法具有相同的签名:基类中使用关键字virtual定义虚方法:然后派生类中使用关键字override来重写方法,或使用关键字new来覆盖方法(隐藏方法). 重写方法用相同 ...
- ID卡
ID卡全称为身份识别卡(Identification Card),是一种不可写入的感应卡,含固定的编号,主要有台湾SYRIS的EM格式.美国HIDMOTOROLA等各类ID卡.ID卡与磁卡一样,都仅仅 ...
- ALV列、行、单元格颜色设置
)颜色含义 :海蓝:2:浅清:3:黄色:4:浅蓝:5:青色:6:红色:7:橙色. (1)首位为主颜色: (2)次位为辅助颜色: (3)末位为0时,表示首位数字表为表格的底色: 末位为1时,则表示以1为 ...
- 基于Visual C++2013拆解世界五百强面试题--题17-程序结果分析1
分析程序结果,分析过程我们就写在程序注释里面. 写出下列代码的输出内容 #include <stdio.h> int inc(int a) { return (++a); } int mu ...
- codeforces#FF DIV2C题DZY Loves Sequences(DP)
题目地址:http://codeforces.com/contest/447/problem/C C. DZY Loves Sequences time limit per test 1 second ...