in reply to exe on local machine

Probably one of the reasons that few know a solution to your problem is that you're not describing it too well.

How does your program on the website send data to the CGI script? Does it do a form submit itself? Why does it matter that the program is on the website? Where does the HTML page go when it's generated? Back to the program that submitted the form data? Why? How did you convert the perl script to the exe? What happened to the other program (the one that was doing form submits)? Which "that exe" are you referring to -- the first one that sends data to the CGI or the Perl script that was rewritten in C++? How did you try to submit form data to the C++ exe? Is it accessible to a web server somewhere? If not, how did you submit it?

Anyway, it's all very confusing.

If you mean, "how do I make a web-based application work on an arbitrary machine", you probably need to get a web server.

If you just want to run some CGIs and serve some static pages on someone's desktop machine, get a little web server to run there. Since you have Perl, let me suggest HTTPi which is a nice small web server that's easy to set up and is in portable Perl.

Replies are listed 'Best First'.
Re: Re: exe on local machine
by Kevin Ar18 (Initiate) on Jul 05, 2001 at 09:53 UTC
    Ok, first off I can't set up a web server on every person's machine so that's not gonna work. And the reason I need to get this cgi script off of my host because it's simply comsuming to much bandwidth and besides it takes a long time to load because of all the data it must transfer.

    Basically you have a html page with a form on it. FORM name=generatemap action=../cgi-bin/mapeditor/upload.cgi method=post target=map encType=multipart/form-data and a few fields in the form INPUT type=radio value=open name=ac etc... etc... exactly what type of input fields doesn't matter
    the user clicks on the submit button
    then, the data is submitted to the cgi (upload.cgi) like I mentioned before.
    upload cgi then generates an html page that the viewer sees in their browser (of course)

    Now I have converted the perl script into a c++ exe.... The problem is if I put the html page and the exe on my local machine instead, then when I click the submit button it asks to download the exe instead of running it.

    And so that's what I need a solution to.
    As for what I used to convert the perl to an exe, well that don't matter much. I can just as easily recode the program in c++. However, I did try this program: http://www.indigostar.com/perl2exe.htm
      Why can't you set up a local web server? It doesn't have to accept connections from other machines. Many products do it... we're only talking about a single Perl program, not something like Apache. You may want to use a port other than port 80, but you can do this with an 8K program and provide an entire web environment, into which you can add other CGI and/or static pages.
      If you want a stand alone application - write a stand alone application, Tk would provide an adequate UI. Get ready to waste lots of time installing it and keeping it upgraded, however. A better route would be a networked application, where a central server does the majority of the computing and the clients provide the UI.

      If you want a networked application, you will have to do the socket connections yourself (be sure and take a gander at CPAN first - lots of wheels ready to roll). You will need to write a server program that runs on a central box in your network, and you will need to write the client program to talk to the server on a designated port. Then you install the clients as needed on the other boxes in your network (of course, now you are back to having to maintain upgrades).

      But why do that when it has already been written. It's called HTTPD!

      So, what i am getting at is that you are trying to solve the problem with a purple banana - wrong solution! What you need is to beef up the server - either with hardware or by switching from plain-jane CGI to mod_perl.

      The former is easier, but the later is cheaper (free!) and worth the trouble in the long run.

      Jeff

      R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
      L-L--L-L--L-L--L-L--L-L--L-L--L-L--