Search results for 'CGI'. 3 post(s) found.
- 2007/08/28 MFC based World Wide Web HTTP Server Source Code
- 2007/08/27 Simple CGI Programming in C
- 2007/08/27 Simple C# CGI working on Apache
The below attachment is HTTP Server Source code that supports CGI.
Detail Description:
HTTPSVR is an MFC sample that demonstrates the use of MFC and its Windows Sockets (WinSock) classes in implementing a simple World Wide Web HTTP Server. HTTPSVR turns any computer connected to a network into a publishing platform viewable from any of a number of web browsers available on the market today, such as Microsoft's Internet Explorer.
HTTPSVR also minimally supports the Common Gateway Interface (CGI). You can create forms and execute CGI-compatible server-side applications using the standard hypertext markup language (HTML) tags.
To increase performance, HTTPSVR checks a file's last modified date and compares it to the date sent by the browser in the HTTP If-Modified-Since field. Most browsers will send this field if they already have a copy of the file in their cache. If the file has not been modified since the date of the cached copy, it will send the browser a Not Modified status code instead of downloading the entire file again.
Another posts included in "C, C++"
| Double Linked List (0) | 2007/09/08 |
| Binary Search Sample Code (0) | 2007/09/08 |
| How to run shell command by MFC ? (0) | 2007/09/09 |
| Creating and Using a CAsyncSocket Object to use CAsyncSocket (0) | 2007/08/28 |
| UDP Send and Receive Using CAsyncSocket (0) | 2007/08/28 |
| Using the shell to receive notification of removable media being insert... (0) | 2007/08/28 |
| Fast and Good Keyboard/Mouse Test without the message handler (0) | 2007/08/27 |
| Simple CGI Programming in C (0) | 2007/08/27 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 02:18
moneyideas
-
Subject different money making ideas
2010/01/29 11:01
moneyideas
-
Subject different money making ideas
2010/01/31 16:44
moneyideas
Here's the simplest C based CGI Example.
#include <stdlib.h>
int main(void)
{
char *data;
printf("Content-Type:text/html;\xd\xa"); // HTML out start !!
printf("<TITLE>Multiplication results</TITLE>\n");
printf("<H3>Multiplication results</H3>\n");
data = getenv("QUERY_STRING"); // getting parameters
if(data == NULL)
printf("<P>No Query string found");
else
printf("<P>%s", data);
return 0;
}
If you want to run this application on Apache platform, you can test this application by copying to Apache CGI-bin directory.
If it's compiled as test.exe and installed in Apache installed local PC, you can test it by following URL:
Another posts included in "C, C++"
| Fast and Good Keyboard/Mouse Test without the message handler (0) | 2007/08/27 |
| Using the shell to receive notification of removable media being insert... (0) | 2007/08/28 |
| UDP Send and Receive Using CAsyncSocket (0) | 2007/08/28 |
| C++ CGI Example working on Apache (0) | 2007/08/27 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 00:20
moneyideas
-
Subject different money making ideas
2010/01/29 08:47
moneyideas
-
Subject different money making ideas
2010/01/31 16:44
moneyideas
Simple program to demonstarte the power of c# on the Net. This program require web server e.g(java web server ,apache etc).
Hello.cs
{
public static void Main()
{
System.Console.WriteLine("Content-Type:text/html\n");
System.Console.WriteLine("");
System.Console.WriteLine("");
System.Console.WriteLine("Hello to everyone. It's me Kurapa Chunun Kang");
System.Console.WriteLine("");
}
}
Compile the class Hello.cs. This will give u a exe file i.e Hello.exe.Put this file in the server's CGI-bin directory. for e.g if u have java server installed in C drive than the place to put the Hello.exe is c:/javawebserver/CGI-bin/" your file i.e hello.exe".
Copy the file Hello.exe to CGI-bin directory. now open the browser window and put the url http://localhost:8080/CGI-bin/Hello.exe considering your server is running at 8080 port.
Another posts included in "C#"
| Simple Example Of IF/THEN Using C# (0) | 2007/08/28 |
| C Sharp Lists (0) | 2007/08/28 |
| How To Print Text In C# (0) | 2007/08/28 |
| How to send binary data through C# CGI app? (0) | 2007/08/27 |
| Interacting With TinyPic From C# (0) | 2007/08/27 |
| Creating A Watched Folder With Assigned Events (0) | 2007/08/27 |
| Calling Your Main Thread From A Worker Thread In C# (0) | 2007/08/27 |
| HashTable Tutorial In C# (0) | 2007/08/27 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 03:26
moneyideas
-
Subject different money making ideas
2010/01/29 12:23
moneyideas
-
Subject different money making ideas
2010/01/31 16:44
moneyideas

mfc_based_http_server.zip
Prev

Rss Feed