Hi everyone! I just want to ask, how do I use socket programming in C to open/go to web sites? I want to create a program that should look like this: the program asks for an integer input from the user and depending on the input number, the program invokes and tries to connect to a specific website. For example, if the input is 1, the program will try to connect to htttp://www.yahoo.com and if the input is 2, the program will try to connect to http://www.google.com. The websites will be pre-determined, meaning if the input is 1, the program will go to www.yahoo.com only, the program shouldn't try to connect to random websites. I have Linux as my OS. Any concepts/strategies/links to tutorials/sample codes would be great. I'm relatively new to socket programming so I would really appreciate it if I could see some simple codes on how to implement this. Thank you.

Don't you think creating three threads for the same question is a bit much?

Oh, I didn't know my previous posts were posted. I mean, I have a really slow internet connection since last week and it's very difficult for me to post. Most of the time, when I post/create a new thread, "Request Timed Out" or Gateway Error are the ones I see in my browser, so I try to wait for some time and try to create a new thread afterwards (thinking that the post wasn't successful). I didn't know that my previous threads were in fact posted due to the slow connection.

This article has been dead for over six months. Start a new discussion instead.