[Dev-C++] getdata from homepage by c++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <Tod...@De...> - 2003-10-09 18:12:27
|
hi everyone,
I need help on transfering the data(name & password) from my home page to my
geturl.c.
the problem is... my geturl.c is runninb but it is waiting for me to key in
something.
I am using Dev-C++ 4.8. I will be very happy with any help. thanks
Todd c.
-----------------------------------------------------------
my geturl.c file:
-----------------------
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()
{
FILE *ifile;
char buf[256], instr[64], *p='\0';
int i;
fgets(instr, 64, stdin);
instr[63]='\0';
p=instr;
printf("==> p: %s \n",instr);
while (*p){
if (*p=='%'){
strncpy(buf,p+1,2);
buf[2]='\0';
*p=strtol(buf,NULL,16);
strcpy(p+1,p+3);
} // if
p++;
} // while
if (p = strchr(instr, '='))
strcpy(instr,&p[1]);
if (p = strchr(instr, '\r'))
*p='\0';
if (p = strchr(instr, '\n'))
strcpy(instr,&p[1]);
printf("==>after p: %s \n",p);
fflush(stdout);
return 0;
}
---------------------------------
part of my homepage file which is on my c: drive.
<TR>
<FORM action=file://LocalHost/C:/Dev-C++/geturl.exe>
<TD vAlign=bottom>
<DIV class=tinyblack><B>User Name <BR>
</B></DIV><INPUT name=username><BR></TD>
<DIV class=tinyblack><B>Password</B></DIV><INPUT
type=password
name=password><BR></TD>
<input type="submit">
</TD></FORM></TR>
------------------------------------
todd c.
|