main(){int i;long ip;char soc,*b,*d,*n,*s,*p;
s="coldfire.sakura.ne.jp";p="cqpub";
ip=GetHostByName(s);if(!ip)return;soc=CreateSocket(1);
if(Connect(soc,ip,80)<0){CloseSocket(soc);return;}
b=MemoryAlloc(256);d=MemoryAlloc(64);n=MemoryAlloc(10);
GetNetLine(0,0,0,0);InitAd(16);GetDigit(GetAd(4),n);
StrCpy(d,"data=");StrCat(d,n);StrCat(d,"&passwd=");
StrCat(d,p);StrCpy(b,"POST /entry.cgi HTTP/1.1\r\n");
StrCat(b,"Host: ");StrCat(b,s);StrCat(b,"\r\n");
StrCat(b,"Content-Length: ");GetDigit(StrLen(d),n);
StrCat(b,n);StrCat(b,"\r\n\r\n");StrCat(b,d);
Write(soc,b,StrLen(b));WaitWriteComplete(soc);
for(i=0;i<9;i++){if(GetNetLine(soc,b,250,20)<0)break;
if(StrStr(b,"Done"){PrStr("Done\r\n");break;}}
GetNetLine(0,0,0,1);CloseSocket(soc);
MemoryFree(n);MemoryFree(d);MemoryFree(b);}
