<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的更多相关文章

  1. Memcached source code analysis (threading model)--reference

    Look under the start memcahced threading process memcached multi-threaded mainly by instantiating mu ...

  2. Learning from the CakePHP source code - Part I

    最近开始痛定思痛,研究cakephp的源码. 成长的路上从来没有捷径,没有小聪明. 只有傻傻的努力,你才能听到到成长的声音. 下面这篇文章虽然过时了,但是还是可以看到作者的精神,仿佛与作者隔着时空的交 ...

  3. Source Code Review

    1.berfore we talking abnout the Source Code review,here's what we want to know about the most popula ...

  4. HashMap source code view(1)

    前言 HashMap source code view 类注释 Hash table based implementation of the Map interface. This implement ...

  5. 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 ...

  6. CRC32 Source Code

    /* The Quest Operating System * Copyright (C) 2005-2010 Richard West, Boston University * * This pro ...

  7. attack source code

    不废话,直接上代码, 先看截图use pictures;

  8. Tree - AdaBoost with sklearn source code

    In the previous post we addressed some issue of decision tree, including instability, lack of smooth ...

  9. Tree - Decision Tree with sklearn source code

    After talking about Information theory, now let's come to one of its application - Decision Tree! No ...

随机推荐

  1. Problem A: 走迷宫问题

    Problem A: 走迷宫问题Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 9 Solved: 3[Submit][Status][Web Board] ...

  2. php多图合并

    function mergerImg($imgs) { list($max_width, $max_height) = getimagesize($imgs['dst']); $dests = ima ...

  3. A Byte of Python 笔记(5)函数:定义、形参、局部变量、默认参数、关键参数

    第7章  函数 函数是重要的程序段.它们允许你给一块语句一个名称,然后你可以在程序的任何地方使用这个名称任意多次地运行这个语句块.这被称为 调用 函数. 定义函数 函数通过 def 关键字定义.def ...

  4. Codecademy学习打卡1

    ————————————————————————— 想学习编程,并且打算“闭门造车”式的开启我的自学生涯. 前段时间买了一门厚重的“Java从入门到精通”.或许是对代码,电脑编程环境的陌生,再加上纯小 ...

  5. Java Web 入门(一)使用 Intellij IDEA 14.1.5 创建 Maven Web项目

    1.基础配置 1.1 安装 JDK1.7,配置系统变量:JAVA_HOME 和 Path 1.2 安装 Tomcat 7.0 1.3 安装  Intellij IDEA 14.1.5 1.4 Mave ...

  6. 转: Transact-sql游标使用详解~~很详细

    /*原理:游标就是把数据按照指定要求提取出相应的数据集,然后逐条进行数据处理.1.1游标的概念 游标(Cursor)它使用户可逐行访问由SQL Server返回的结果集. 使用游标(cursor)的一 ...

  7. 取代奶瓶Minidwep-gtk 破 WPA 全攻略

     目录 1. CDlinux 下使用 minidwepgtk 获取握手包并使用自带的字典破解 2. 自带的字典破解不出密码时使用 U 盘外挂字典继续暴力破解密码 3. 将握手包拷贝到 Windows ...

  8. Why is celsius = 5 * (fahr - 32) / 9 ?

    Go to my personal blog There is a program to print Fahrenheit-Celsius table as below. #include <s ...

  9. 前端性能监控系统ShowSlow

    作者:zhanhailiang 日期:2014-11-14 1. 简单介绍 ShowSlow是开源的前端性能监控系统,提供了下面功能: 前端性能指标数据收集功能:ShowSlow原生提供了数据收集工具 ...

  10. 深入了解Nginx之Nginx与Python(1)

    6 Python和Nginx 6.1 简介FastCGI FastCGI(Fast Common Gateway Interface)是基于CGI上的改进,是CGI的一种演变产物.虽然目的是保持同样的 ...