#include
#include
int main()
{
char cmd[1024]="/htdoc/readerchaxun.php?xuehao=20040502215&userpassword=xiang&Submit=ChaXun";
char name[1024],value[1024],temcmd[1024];
int t,i,j,k,len;
int counter=0;
int v;
//输出全部信息
//-------------------------------
len=strlen(cmd);
printf("cmd[%d]\n",len);
for(i=0;i printf("%c",cmd[i]);
}
for(i=0;i if(cmd[i]=='=')
counter++;
}
printf("\n");
printf("counter=%d\n",counter);
printf("-----------------------\n");
//--------------------------
//输出“?”之前的字符串
//-------------------------
for(i=0;i if(cmd[i]=='?'){
t=i;
break;
}
else
temcmd[j++]=cmd[i];
}
printf("t=%d\n",t);
for(k=0;k printf("%c",temcmd[k]);
printf("\n");
printf("--------temcmd----------------\n");
for(v=0;v //这里循环提起出name 和 value
//------------------------
//输出第一个名字
//---------------------
j=0;
k=0;
for(i=t+1;i if(cmd[i]=='='){
t=i;
break;
}
else
name[j++]=cmd[i];
}
printf("t=%d\n",t);
for(k=0;k printf("%c",name[k]);
printf("\n");
printf("--------name----------------\n");
//----------------------
//输出第一个值
//------------------
j=0;
k=0;
for(i=t+1;i if(cmd[i]=='&'){
t=i;
break;
}
else
value[j++]=cmd[i];
}
printf("t=%d\n",t);
for(k=0;k printf("%c",value[k]);
printf("\n");
printf("--------value----------------\n");
}
/*
//------------------------
//输出第二个名字
//---------------------
j=0;
k=0;
for(i=t+1;i if(cmd[i]=='='){
t=i;
break;
}
else
name[j++]=cmd[i];
}
printf("t=%d\n",t);
for(k=0;k printf("%c",name[k]);
printf("\n");
printf("--------name----------------\n");
//----------------------
//输出第二个值
//------------------
j=0;
k=0;
for(i=t+1;i if(cmd[i]=='&'){
t=i;
break;
}
else
value[j++]=cmd[i];
}
printf("t=%d\n",t);
for(k=0;k printf("%c",value[k]);
printf("\n");
printf("--------value----------------\n");
*/
return 0;
}
阅读(600) | 评论(0) | 转发(0) |