Problem with XAMPP, CGI and C ++. How to enable cgi?

0

I'm trying to make a small CGI with C ++ (all for practice) in which I try to take the data from a form in HTML and then print it on a new screen. The fact is that following the tutorial, at the time of executing the .exe, what it does is download it and not execute it.

These are the codes:

<body>
    <form action="prueba.exe" method="get">
        <input type="text" name="nombre" value="Nombre:" class="input">
        <input type="text" name="apellido" value="Apellido:" class="input">
        <input type="submit" name="submit" value="Aceptar" class="button">
    </form>
</body>

And the C ++ is:

#include <iostream>
#include <cstdlib>

using namespace std;

int main(int argc, char *argv[]){
    cout << "content-type: text/html" << endl;

    string data = getenv("QUERY_STRING");
    cout << data << endl;

    return 0;
}
    
asked by Jogofus 23.10.2017 в 06:07
source

0 answers