C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
http programming with C Posted by b0ng01 on 4 Apr 2006 at 4:01 AM
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.
Report
Re: http programming with C Posted by tsagld on 4 Apr 2006 at 7:34 AM
: 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

Report
Re: http programming with C Posted by Griz803 on 4 Apr 2006 at 11:25 AM
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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.