Click here to Skip to main content
15,895,709 members
Home / Discussions / Web Development
   

Web Development

 
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 
Generali need javascript of my.msn.com Plz help me Pin
TariqMahmood13-Feb-05 22:31
TariqMahmood13-Feb-05 22:31 
GeneralRe: i need javascript of my.msn.com Plz help me Pin
srieen14-Feb-05 18:27
srieen14-Feb-05 18:27 
GeneralNeed Javascript Help with Netscape Navigator Compatibility Pin
Chris LaQuerre12-Feb-05 10:17
Chris LaQuerre12-Feb-05 10:17 
GeneralRe: Need Javascript Help with Netscape Navigator Compatibility Pin
JKroschel14-Feb-05 6:26
JKroschel14-Feb-05 6:26 
GeneralGet Top 10 from a search engine Pin
Mohsen Saad12-Feb-05 7:32
Mohsen Saad12-Feb-05 7:32 
GeneralImage ID Pin
Anonymous11-Feb-05 9:58
Anonymous11-Feb-05 9:58 
GeneralRe: Image ID Pin
alex.barylski11-Feb-05 10:47
alex.barylski11-Feb-05 10:47 
GeneralRe: Image ID Pin
JKroschel14-Feb-05 6:32
JKroschel14-Feb-05 6:32 
Generalfunction popping a text box onclick from a value in drop-down Pin
Member 157626911-Feb-05 7:02
Member 157626911-Feb-05 7:02 
GeneralRe: function popping a text box onclick from a value in drop-down Pin
alex.barylski11-Feb-05 10:50
alex.barylski11-Feb-05 10:50 
GeneralWebsite Monitoring - Saving Specific pages Pin
aubndez11-Feb-05 3:15
aubndez11-Feb-05 3:15 
GeneralPassing Variable to a JS function Pin
cberam11-Feb-05 1:16
cberam11-Feb-05 1:16 
GeneralRe: Passing Variable to a JS function Pin
alex.barylski11-Feb-05 10:52
alex.barylski11-Feb-05 10:52 
GeneralRe: Passing Variable to a JS function Pin
Anonymous17-Feb-05 23:12
Anonymous17-Feb-05 23:12 
QuestionDefaulting somebodies font color? Pin
The Chrisp10-Feb-05 7:08
sussThe Chrisp10-Feb-05 7:08 
Generalbug tracking system Pin
kundan_ocp9-Feb-05 20:07
kundan_ocp9-Feb-05 20:07 

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.