无标题文章

第九页:

左:

登陆<title></p> <p></head></p> <p><body></p> <p><a href="file:///C|/Users/wfzhu/Desktop/201809040308  /content04.jpg">点我数据</a></p> <p><form action = ""></p> <p> <input type="hidden" name="model" value="user" /></p> <p>    <input type="hidden" name="fun" value="login" /></p> <p>  用户名:<input type="text" name="username" placeholder="请输入用户名" /> <br /></p> <p>  密码:  <input type="password" name="pwd" placeholder="请输入密码" /> <br /></p> <p>  <input name="sex" type="radio" value="1"> 男</p> <p>  <input name="sex" type="radio" value="2"> 女 <br /></p> <p>  描述 : <textarea name="desc" cols="50" rows="30"></textarea>  <br /></p> <p>  名族:</p> <p>  <select name="quyu"></p> <p>  <option value="hebei">临沂</option></p> <p>    <option value="beijing">北京</option></p> <p>    <option value="henan">河南</option></p> <p>  </select></p> <p>  <input type="submit" name="login" value="登陆" /> </p> <p></form></p> <p></body></p> <p></html></p> <h2><b><i>右:</i></b></h2> <p>char username[238];</p> <p>char pwd[50];</p> <p>char desc[256];</p> <p>char sex[3];</p> <p>char quyu[156];</p> <p>if(cgiFromSubmitClicked("login") == cgiFormSuccess)</p> <p>{</p> <p> cgiFormString("username",username , sizeof(username));</p> <p> cgiFormString("pwd",pwd , sizeof(pwd));</p> <p> cgiFormString("desc",desc , sizeof(desc));</p> <p> cgiFormString("sex",sex , sizeof(sex));</p> <p> cgiFormString("quyu",quyu , sizeof(quyu));</p> <p> cgiHeaderContentType("text/html;charset=gbk");</p> <p> //printf("username");</p> <p> //printf("pwd");</p> <p> fprintf(cgiOut, "<html><head></head><body>");</p> <p> fprintf(cgiOut, "</body></html>");</p> <p> return 0;</p> <p>}</p> <h1><i>10页:</i></h1> <h2><i>左:</i></h2> <p></p> <p>#include <stdio.h></p> <p>#include <stdlib.h></p> <p>#include <string.h></p> <p>#include "cgic.h"</p> <p>int cgiMain()</p> <p>{</p> <p> char model[30] = { 0 };//哪个模块进来的</p> <p> char fun[32] = { 0 };</p> <p> //project01.cgi?model=user&fun=login</p> <p> //project01.cgi?model=user&fun=register</p> <p> if (cgiFormString("model", model, sizeof(model) != cgiFormSuccess)</p> <p> {</p> <p> cgiHeaderContentType("text/html;charset=gbk");</p> <p> printf("fun参数必传");</p> <p> }</p> <p> return 0;</p> <p>}</p> <h2><i>右:</i></h2> <p></p> <p>if (strcmp(model, "user") == 0)</p> <p> {</p> <p> if (strcmp(fun, "toLogin") == 0)</p> <p> {</p> <p> cgiHeaderLocation("login.html");</p> <p> }</p> <p> else if (strcmp(fun, "toRegister") == 0)</p> <p> {</p> <p> cgiHeaderLocation("regitser.html");</p> <p> }</p> <p> else if (strcmp(fun, "login") == 0)</p> <p> {</p> <p> char username[256];</p> <p> char pwd[250];</p> <p> cgiFormString("username", username, sizeof(username);</p> <p> cgiFormString("pwd", pwd, sizeof(pwd);</p> <p> //查询数据库对比用户名密码的;</p> <p> if (strcmp(username, "zq") == 0 && strcmp(pwd, "123") == 0)</p> <p> {</p> <p> cgiHeaderContentType("text/html;charset=gbk");</p> <p> printf("登陆成功");</p> <p> return 0;</p> <p> }</p> <p> else</p> <p> {</p> <p> cgiHeaderContentType("text/html;charset=gbk");</p> <p> printf("用户名或密码错误");</p> <p> return 0;</p> <p> }</p> <p> }</p> <p> }</p> <h1><i>第11页:</i></h1> <h4><!doctype html> </h4> <h4><html> </h4> <h4><head> </h4> <h4><meta charset="utf-8"> </h4> <h4><title>无标题文档 

  

       您的姓名是 , 您的年龄是岁 

    

     

列表

 


    

             

             
  • 商品名称:;价格:
  •          

         

     


    第12页:

    #include

    #include

    #include

    #include "cgic.h"

    int cgiMain()

    {

    cgiHeaderContentType("text/html;charset=gbk");

    //往前台index.html传数据并转跳

    TMPL_varlist * varlist = 0;

    TMPL_loop *loopGoods = 0;

    varlist = TMPL_add_var(varlist, "realname", "赵琦", "price", "20", 0);

    //循环的列表数据

    loopGoods = TMPL_add_var(loopGoods, TMPL_add_var(0, "goodname", "裤子", "price", "20", 0));

    loopGoods = TMPL_add_var(loopGoods, TMPL_add_var(0, "goodname", "褂子", "price", "10", 0));

    varlist = TMPL_add_loop(varlist, "goods", loopGoods);

    TMPL_write("index.html", 0, 0, varlist, cgiOut, cgiOut);

    TMPL_free_varlist(varlist);

    return 0;

    }

    你可能感兴趣的:(无标题文章)