http programming with C - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

http programming with C

b0ng01b0ng01 Posts: 1Member
I have been looking for the last 5 hours through everything I could find on any website about this. I have exausted every resource I can think of other than asking someone.

So here goes...

Let's say I want to write a program to connect to a web server and input a value. How do I go about doing it. I assume I Have to place the value into the variable that the server uses for it. But, honestly I have no idea. Google isn't helping, I can't find it in any book. I can't find it anywhere. Maybe someone here has a better clue where I can look.

Incase I wasn't completely clear.

Assume that I am trying to log into a website from my c program. I can't find any header file or library for this. I have a feeling someone is going to tell me to learn sockets. I know them, maybe not good enough, but in my reading, I find nothing on connecting to a website.

Comments

  • tsagldtsagld Posts: 621Member
    : I have been looking for the last 5 hours through everything I could find on any website about this. I have exausted every resource I can think of other than asking someone.
    :
    : So here goes...
    :
    : Let's say I want to write a program to connect to a web server and input a value. How do I go about doing it. I assume I Have to place the value into the variable that the server uses for it. But, honestly I have no idea. Google isn't helping, I can't find it in any book. I can't find it anywhere. Maybe someone here has a better clue where I can look.
    :
    : Incase I wasn't completely clear.
    :
    : Assume that I am trying to log into a website from my c program. I can't find any header file or library for this. I have a feeling someone is going to tell me to learn sockets. I know them, maybe not good enough, but in my reading, I find nothing on connecting to a website.
    :

    Sockets may be an idea, but if you plan on coding for the internet, C is not the easiest road to travel. You will end up writing Common Gateway Interface (CGI) programs. People did this 10 years ago.
    Nowadays there are much easier tools to create webapplications, like ASP, PHP and, even better and newer, ASP.Net.

    If you want to connect to web servers only, not having user interfaces, then you will want to use the Http api, available trough H_ttpapi.dll (leave out the underscore, without it programmersheaven translates it into a hyperlink).
    That dll exists standard on Windows XP Sp2 and Windows Server 2003.

    If you are not coding on Windows, I can't help you any further.

    Greets,
    Eric Goldstein
    www.gvh-maatwerk.nl

  • Griz803Griz803 Posts: 100Member
    Please excuse my opinionation showing, but I believe that what you want to do is easily, if not quickly, accomplished in C or C++ using CGI interface standards. The downside is that you must redirect after the C application verifies and validates the login and password of each user. That will require sending them to an entirely different sub-URL. Also, a separate CGI program will be needed to perform user sign-ups and update the new logins and passwords into the master file on the server. Sounds like a lot of work, but it can be fairly quickly done and over with, is non-invasive to the user's computer system (no cookie needed) and is about as secure as you'd like to make it. Here are a couple of resources on CGI programming:
    http://www.scit.wlv.ac.uk/~jphb/sst/c/

    http://www.openroad.org/cgihelp/cgi.html

    http://www.pageresource.com/cgirec/cintro.htm

    http://www.jmarshall.com/easy/cgi/

    In this case, the last URL is probably the place to start. If you can't find a reason to write it in C or C++ after that, then you should probably consider some easier and more effective way. I hope this helps you out.
Sign In or Register to comment.