Jump to content






Photo - - - - -

Cgi-Bin In C



I don't know why i want to do web development in ANSI 'C' , may be i am that, old types :) , any way i love speed , ya,that' the right ans.

What i have with me for web development in C
1. Fedora 12
2. Appache
3. gcc++

Configure your apache ( apache server configuration in linux )

1.now it's time to go to /var/www/cgi-bin
2. type " vi my.c"

type the following code in it :

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    char *data;
    long m,n;
    printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10);
    printf("<TITLE>My First Code in C </TITLE>\n");
    printf("<H3>Hack The Hacker 21</H3>\n");
    printf("<B> and all your HTML Code Goes Here</>");
   
return 0;

}


3. Now compile
# gcc -Wall -O my.cgi my.c

4. chmod 755 my.cgi

5. Now go to ../html
7. type "vi index.htm"
8.

<form action="http://192.xxx.xxx.xxx/cgi-bin/my.cgi">
<input type="submit" value="Press me!">
</form>

9. and press the button u can see the cgi executing .
Great !

I love that how about you .



February 2012

M T W T F S S
  12345
6789 10 1112
13141516171819
20212223242526
272829    

Recent Entries

Random Album Image

s5.jpg

Tags

    Search My Blog

    Categories

    Latest Visitors

    Twitter

    Digg