Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Performing "whois" from a cgi script in C

I'm REALLY new to c programming and would like to take a user's domain name request from a form, pass it to the cgi program written in C, and then output a page confirming that domain's availability.

I think I understand how to take the value and pass it to the program. What I need to know (with sample code, please) is how to perform the whois lookup from within the program and then parse that information to determine availability.

Please help.

Thanks,

Tim

Comments

  • vasuarvasuar Member Posts: 3
    : I'm REALLY new to c programming and would like to take a user's domain name request from a form, pass it to the cgi program written in C, and then output a page confirming that domain's availability.
    :
    : I think I understand how to take the value and pass it to the program. What I need to know (with sample code, please) is how to perform the whois lookup from within the program and then parse that information to determine availability.
    :
    : Please help.
    :
    : Thanks,
    :
    : Tim
    :

    Tim,

    I think that the easist way for you to get the functionality of "whois" is to invoke this command from inside your C program.
    This involves the use of a pipe, and use system(). To get the info about these two things use the good old man pages. Also, before you try and get into programs like this one, try and get familiar with what you can do with C in Linux/Unix. A really good book to start with is "Sams Teach yourself Linux Progarmming in 24 hours". It is an excellent book, with really nice examples which should put you on the right path.

    good luck.

    av.
Sign In or Register to comment.