#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Warsaw
    Posts
    46
    Rep Power
    30

    Rough-and-ready way to send forms


    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	"http://www.w3.org/TR/html4/loose.dtd">
    <head>
        <title>Complete an form</title>
    
    
        <style type="text/css">
            #Text1 {
                width: 144px;
            }
        </style>
    
    </head>
    <body>
    
    
    
    <form action="getting_command_outside.exe" method="get">  
    <input id="Text1" type="text" />
    </form>
    
    
    </body>
    </html>

    getting_command_outside.exe source code (.cpp)

    Code:
    #include "stdafx.h"
    #include <fstream>
    
    using namespace std;
    
    int main(int argc, char *args[])
    {
    	ofstream ofile;
    
    	ofile.open("database.txt");
    
    	for(int i=0; i<argc; i++)
    	ofile<<args[i];
    
    	ofile.close();
    
    
        return 0;
    }
    Is it possible to put it into effect in such way? (if yes... I know that 'action=' has an invalid parameter )Well-welcomed other simple ways of sending forms.
  2. #2
  3. Standing 3 feet to the left.
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2006
    Location
    USA
    Posts
    1,435
    Rep Power
    186
    What, exactly, are you attempting to do?
    I'd rather teach you to fish than give you a fish. I reserve the right to also slap you with the fish.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Warsaw
    Posts
    46
    Rep Power
    30
    I would like to convey form's input into a .txt file using C++ program . I don't have an knowlegde about PHP, asp and servers . That is the reason why I used such unspophisticated algorithm .

    But now it's starts downloading my .exe file
  6. #4
  7. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,204
    Rep Power
    1992
    If you're being prompted to download the program, then the file permissions on the server are not allowing the program to be executed. First thing to do is check the file permissions for your .exe program and double-check that it can be executed in that directory by unknown users.

    If that doesn't work, then I'd almost suggest trying something else. If your server can use PHP then I'd point you to PHPMailer. It's probably the best email script out there now, and you don't need to know any PHP to use it. Just read the configuration and setup guides for it and it should be easy enough.

IMN logo majestic logo threadwatch logo seochat tools logo