求教boa服务器!!!!!?????
我在uclinux中用了boa服务器,为什么用post没有反映,文件系统是romfs,在/var下有ext2(ramdisk),帮帮我,怎么改好
我在boa上编写cgi程序,用到了post,如下
title>密码保护</title>
<center>
<H1>美丽宝岛站</H1>
<HR>
<FORM METHOD="OST" "ACTION="/home/web/cgi-bin/password">
会员姓名<input type="text" name="name"><p>
输入密码<input type="password" name="passwd" value="********"><p>
<input type="submit" value="输入">
<input type="reset" value="清除">
</FROM>
</center>
在按输入时没有响应,网页上地址还是192.168.111.100(原来的),怎么回事,boa不支持post吗?
cgi程序
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef struct
{
char *name;
char *val;
}input;
char *ReadStdin(FILE *f,char stop,int *len);
void AddToSpace(char *str);
void Convert(char *url);
char *ReadData(char *line,char stop);
char ConvertToHex(char *change);
main()
{
input inputs[10];
int i,m=0;
int len;
FILE *fp;
char s[255];
printf("Content-type:text/html\n\n";
len=atoi(getenv("CONTENT_LENGTH");
for(i=0;len&&(!feof(stdin));i++)
{
m=i;
inputs[i].val=ReadStdin(stdin,'&',&len);
AddToSpace(inputs[i].val);
Convert(inputs[i].val);
inputs[i].name=ReadData(inputs[i].val,'=');
}
if(strcmp(inputs[0].val,"qq"==0&&strcmp(inputs[1].val,"aa"==0)
{
printf("<title>netword</title>\n";
printf("<H1>welcome %s</H1>\n",inputs[0].val);
fp=fopen("/home/web/html/wecome.html","r";
if(fp==NULL)
exit(1);
while((fgets(s,255,fp))!=NULL)
printf("%s\n",s);
}
else
{
printf("<title>error</title>\n";
printf("<H1>error</H1>\n";
printf("<H1>restart</H1>\n";
}
}
char *ReadStdin(FILE *f,char stop,int *len)
{
int wsize;
char *word;
int x;
wsize=2048;
x=0;
word=(char*)malloc(sizeof(char)*(wsize+1));
while(1)
{
word[x]=(char)fgetc(f);
if(x==wsize)
{
word[x+1]='\0';
wsize+=2048;
word=(char*)realloc(word,sizeof(char)*(wsize+1));
}
--(*len);
if((word[x]==stop)||(feof(f))||(!(*len)))
{
if(word[x]!=stop)
x++;
word[x]='\0';
return word;
}
++x;
}
}
char *ReadData(char *line,char stop)
{
int i=0,j;
char *word;
word=(char*)malloc(sizeof(char)*(strlen(line)+1));
for(i=0;(line[i]&&(line[i]!=stop));i++)
word[i]=line[i];
word[i]='\0';
if(line[i])
i++;
j=0;
while(line[j++]=line[i++]);
return word;
}
char ConvertToHex(char *change)
{
char hexdigit;
hexdigit=(change[0]>='A'?((change[0]&0xdf)-'A')+10change[1]-'0'));
hexdigit*=16;
hexdigit+=(change[1]>='A'?((change[1]&0xdf)-'A')+10change[1]-'0'));
return hexdigit;
}
void Convert(char *data)
{
int i,j;
for(i=0,j=0;data[j];++i,++j)
{
if((data[i]=data[j])=='%')
{
data[i]=ConvertToHex(&data[j+1]);
j+=2;
}
}
data[i]='\0';
}
void AddToSpace(char *str)
{
int i;
for(i=0;str[i];i++)
if(str[i]=='+')
str[i]=' ';
}