node提交表单到mysql

Posted web前端yxw

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了node提交表单到mysql相关的知识,希望对你有一定的参考价值。

  var http = require (‘http‘);

  var fs = require (‘fs‘);

  var qs=require(‘querystring‘);

  var hostname=‘127.0.0.1‘;

  var port=8080;

  //创建服务

  var server=http.createServer(function(req,res){

    if(req.url!==‘./favicon.ico‘){
      req.on(‘data‘,function(data){

        console.log(‘服务器接收到的数据:‘+decodeURIComponent(data));

        var param=qs.parse(decodeURIComponent(data));

        console.log(param);

      })

    } 

  })


以上是关于node提交表单到mysql的主要内容,如果未能解决你的问题,请参考以下文章