📄 _store_csp.c
字号:
/* NOTE: DO NOT EDIT THIS FILE,
* this file is create by tool (csp2bin version: 00.07.00) automaticly,
* build at: Tue Mar 14 16:43:25 2006
*/
/* NOTE: YOU SHOULDN'T ADD THIS FILE TO YOUR PROJECT DIRECTLY,
* When you add `../xx_maplist.c' to your project,
* this file will be added into your project.
*
*/
#include <stdio.h>
#include <string.h>
#include <eblib.h>
#include "_store_csp.h"
static int _store_csp___mime_header();
int _store_csp__ (int calldepth, void * ebfp)
{
int __ret=OK;
char * __page_name="store.csp";
char * __page_path="/";
char * __page_fullname="/store.csp";
if (calldepth==MAX_CALL_DEPTH)
__ret=_store_csp___mime_header(ebfp);
goto_ERROR;
__ret=(int)ebBufStringAdd(ebfp,
"<html>\n"
"<head>\n"
" <meta http-equiv=\"refresh\" content=\"1; url="
);
goto_ERROR;
__ret = (int)ebEvaluate(ebfp, "%s", cgiPrefix(NULL));
goto_ERROR;
__ret=(int)ebBufStringAdd(ebfp,
"/review.csp\">\n"
"<title>正在跳转...</title>\n"
"</head>\n"
"<body>\n"
);
goto_ERROR;
{
RECORD record;
void * fp;
time_t t;
memset(&record, 0, sizeof(record));
if ( '\0' == (strncpy(record.name, getParameter("name"), sizeof(record.name)-1))[0] ||
'\0' == (strncpy(record.sex, getParameter("sex"), sizeof(record.sex)-1))[0] ||
'\0' == (strncpy(record.mail, getParameter("email"), sizeof(record.mail)-1))[0] ||
'\0' == (strncpy(record.msg, getParameter("content"), sizeof(record.msg)-1))[0] )
{
ebprintf(ebfp, "'名称/性别/Email/内容' 均不能包为空");
}
else
{
/* get time */
t = time(NULL);
strftime(record.now, sizeof(record.now)-1,
"%Y-%m-%d %H:%M:%S", localtime(&t));
/* convert sex */
if (!strcmp("0", record.sex))
strcpy(record.sex, "女");
else
strcpy(record.sex, "男");
fp = open_db("ab+");
db_insert(fp, &record);
close_db(fp);
ebprintf(ebfp, "留言成功,正在跳转...");
}
}
__ret=(int)ebBufStringAdd(ebfp,
"\n"
"</body>\n"
"</html>\n"
);
goto_ERROR;
if (ERROR == ebBufFlush(ebfp)) return ERROR;
return __ret;
} /* _store_csp__ */
static int _store_csp___mime_header(void * ebfp)
{
return ebprintf(ebfp, "Content-type: text/html\n\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -