This is my first shot at running an executable program from a web page. The program is going to get a lot bigger, as will the web site. I have xampp installed and I am using that. I have two simple files:
C:\xampp\htdocs\execlink.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>Attempt to run an executable from a web page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a href=file://C:/HelloWorld.exe>Run Hello World Executable</a>
</body>
</html>
and:
C:\HelloWorld.exe
// Filename : HelloWorld.cpp
// Executable Name : HelloWorld.exe
#include <fstream>
using namespace std;
int main (int argc, char* argv[])
{
ofstream outs;
outs.open ("HelloWorld.txt");
outs << "Hello World" << endl;
return 0;
}
The web page is:
http://127.0.0.1/execlink.html
Anyway, I click on the link within execlink.html that is supposed to run HelloWorld.exe and nothing happens. The program doesn't run, which I suppose is probably a good thing from a security standpoint since I still have basically the default configuration. I have heard that I need to rename the executable file with a ".cgi" extension from a ".exe" extension and stick it somewhere besides the root "C" directory and maybe mess with a configuration file or two. Any ideas? Thank you.