Click here to Skip to main content
15,921,028 members
Home / Discussions / Web Development
   

Web Development

 
Questionwhat means proxy-connection:? Pin
ThinkingPrometheus18-Feb-05 9:06
ThinkingPrometheus18-Feb-05 9:06 
GeneralHiding HTML controls using Javascript Pin
hitu_kapadia18-Feb-05 3:08
hitu_kapadia18-Feb-05 3:08 
GeneralRe: Hiding HTML controls using Javascript Pin
Qaiser.Muhammad18-Feb-05 14:24
Qaiser.Muhammad18-Feb-05 14:24 
GeneralRe: Hiding HTML controls using Javascript Pin
hitu_kapadia21-Feb-05 2:54
hitu_kapadia21-Feb-05 2:54 
Generalplug-in in IE Pin
Pauwl18-Feb-05 2:48
Pauwl18-Feb-05 2:48 
Questionhow to set tomcat4.1 to run the java class with larger heap size Pin
kinkei17-Feb-05 20:41
kinkei17-Feb-05 20:41 
Questionhow to invoke a java class with 6 parameters within jsp which need 800M heap size Pin
kinkei17-Feb-05 20:07
kinkei17-Feb-05 20:07 
QuestionWhat programming language should I use Pin
17-Feb-05 19:56
suss17-Feb-05 19:56 
AnswerRe: What programming language should I use Pin
SimonS18-Feb-05 6:52
SimonS18-Feb-05 6:52 
GeneralMousedown event on DIV - help urgent Pin
Venkat Eswaran17-Feb-05 17:12
Venkat Eswaran17-Feb-05 17:12 
GeneralRe: Mousedown event on DIV - help urgent Pin
Mike Ellison17-Feb-05 18:12
Mike Ellison17-Feb-05 18:12 
GeneralClient side file capture Pin
MichaelJFC17-Feb-05 6:22
MichaelJFC17-Feb-05 6:22 
Generali need code to design Pin
MFB8017-Feb-05 1:58
MFB8017-Feb-05 1:58 
GeneralRe: i need code to design Pin
Luis Alonso Ramos19-Feb-05 12:17
Luis Alonso Ramos19-Feb-05 12:17 
GeneralTemplate in FP2003 and Dreamweaver MX Pin
nguyennp16-Feb-05 22:51
nguyennp16-Feb-05 22:51 
Generalback button Pin
keepsmile16-Feb-05 21:20
keepsmile16-Feb-05 21:20 
GeneralRe: back button Pin
Colin Angus Mackay17-Feb-05 2:12
Colin Angus Mackay17-Feb-05 2:12 
GeneralRe: back button Pin
keepsmile18-Feb-05 20:42
keepsmile18-Feb-05 20:42 
GeneralRe: back button Pin
Colin Angus Mackay19-Feb-05 0:59
Colin Angus Mackay19-Feb-05 0:59 
GeneralJavascript password protection and session management Pin
matt724516-Feb-05 14:19
matt724516-Feb-05 14:19 
Generalcode for downloading pdf file in asp 3.0 Pin
ashu_sharma2116-Feb-05 0:47
ashu_sharma2116-Feb-05 0:47 
GeneralRe: code for downloading pdf file in asp 3.0 Pin
Luis Alonso Ramos19-Feb-05 12:28
Luis Alonso Ramos19-Feb-05 12:28 
Generalsetting timer for folders Pin
trupgmtuf15-Feb-05 12:05
susstrupgmtuf15-Feb-05 12:05 
GeneralHELP PLZ...Download page to file Pin
A.Sal15-Feb-05 9:22
A.Sal15-Feb-05 9:22 
Hello everyone... Im new here, and kindda need some help please. Im trying to make a program in C code to download web page and store contents to a file. I have the socket creation and rule definition partfor Client done, but im not sure how to insert the get function, and about the syntax of the function.
#include <sys/types.h><br />
<br />
#include <sys/socket.h><br />
#include <netinet/in.h><br />
#include <arpa/inet.h><br />
#include <string.h><br />
#include <unistd.h><br />
#include <stdlib.h><br />
#include <stdio.h><br />
#include <netdb.h><br />
<br />
int main (int argc, char *argv[] )<br />
{<br />
  int s, n;<br />
  struct sockaddr_in sin; struct hostent *hptr;<br />
  char msg[80] = "Hello World!";<br />
  if ( argc < 3 ) {<br />
    printf ("%s host port\n", argv[0] );   /* input error: need host & port */<br />
    return -1;<br />
  }<br />
  if ( (s = socket(PF_INET, SOCK_STREAM, 0 ) ) < 0) { /* create socket*/<br />
    perror("socket");  /* socket error */<br />
    return -1;<br />
  }<br />
  sin.sin_family = PF_INET;              /*set protocol family to Internet */<br />
  sin.sin_port = htons(atoi(argv[2]));  /* set port no. */<br />
  if ( (hptr =  gethostbyname(argv[1]) ) == NULL){<br />
    fprintf(stderr, "gethostname error: %s", argv[1]);<br />
    return -1;<br />
   }<br />
  memcpy( &sin.sin_addr, hptr->h_addr, hptr->h_length);<br />
  if (connect (s, (struct sockaddr *)&sin, sizeof(sin) ) < 0 ){<br />
    perror("connect"); return -1;   /* connect error */<br />
  }<br />
  if ( write(s, msg, strlen(msg) +1) < 0 ) {  /* send message to server */<br />
    perror("write");    return -1; /*  write error */<br />
  }<br />
  if ( ( n = read(s, msg, sizeof(msg) ) ) <0) {  /* read message from server */<br />
    perror("read"); return -1; /*  read error */<br />
  }<br />
  printf (" %d bytes: %s\n", n, msg);  /* print message to screen */<br />
  /* close connection, clean up socket */<br />
  if (close(s) < 0) { <br />
    perror("close");   /* close error */<br />
    return -1;<br />
  }<br />
  return 0;<br />
}<br />


I need the code for the request from the Client, and the response from the Server.
Please, help me ASAP... thanks to you in advance.
Please feel free to point out any errore in my code.
Generalembed several MediaPlayer Pin
Marc Soleda14-Feb-05 5:31
Marc Soleda14-Feb-05 5:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.