D - post method wtih cgi
- manfred toppoint.de (38/38) Sep 17 2003 Hello,
- Julio César Carrascal Urquijo (3/4) Sep 17 2003 Should be:
- Manfred Hansen (3/11) Sep 18 2003 Hello,
- Mårten Ask (3/41) Sep 18 2003 stdin.toString() returns all the POST-data. No need to use CONTENT_LENGT...
- Charles Sanders (5/43) Sep 18 2003 Someone wrote a cgi module, anyone rememeber where it is ?
- Brad Anderson (2/4) Sep 18 2003 Mårten Ask - posted on 7/27/03 - cgi.d was attached.
Hello, i try to read out the value from the post method, but i get always an "Internal Server Error" -:( import c.stdlib; import c.stdio; import stream; int main(char[][] args) { char[] string; char *cl; uint size; printf("Content-type: text/html\n\n"); printf("<html><body>Hallo Manfred !!! </body></html>\r\n"); printf("<br>"); //query = getenv("QUERY_STRING"); cl = getenv("CONTENT_LENGTH"); printf("cl = %s <br>",cl); if (cl != null) { size = atoll(cl); printf("<br> size %li",size); } string = stream.stdin.readString(size); // <-- here is the problem return 0; } <html> <head> <title>Eine einfache Auswertung</title> </head> <body> <h1><center> <b><u>POST-Formular</u></b></center></h1><br><br> <form action=http://localhost/cgi-bin/post_methode.cgi method=post> <center><b>Bitte geben Sie ihren Namen ein :</b><br> <input name="Textfeld" siue="20"> </input> <input type=submit value="abschicken"></center> </form> </body> </html> Manfred
Sep 17 2003
This line:printf("Content-type: text/html\n\n");Should be: printf("Content-type: text/html\r\n\r\n");
Sep 17 2003
Hello, i have change this, but i get still the error message -:( On Wed, 17 Sep 2003 12:10:07 -0500, Julio César Carrascal Urquijo wrote:This line:printf("Content-type: text/html\n\n");Should be: printf("Content-type: text/html\r\n\r\n");
Sep 18 2003
stdin.toString() returns all the POST-data. No need to use CONTENT_LENGTH. <manfred toppoint.de> skrev i meddelandet news:bk9mqj$239g$1 digitaldaemon.com...Hello, i try to read out the value from the post method, but i get always an "Internal Server Error" -:( import c.stdlib; import c.stdio; import stream; int main(char[][] args) { char[] string; char *cl; uint size; printf("Content-type: text/html\n\n"); printf("<html><body>Hallo Manfred !!! </body></html>\r\n"); printf("<br>"); //query = getenv("QUERY_STRING"); cl = getenv("CONTENT_LENGTH"); printf("cl = %s <br>",cl); if (cl != null) { size = atoll(cl); printf("<br> size %li",size); } string = stream.stdin.readString(size); // <-- here is the problem return 0; } <html> <head> <title>Eine einfache Auswertung</title> </head> <body> <h1><center> <b><u>POST-Formular</u></b></center></h1><br><br> <form action=http://localhost/cgi-bin/post_methode.cgi method=post> <center><b>Bitte geben Sie ihren Namen ein :</b><br> <input name="Textfeld" siue="20"> </input> <input type=submit value="abschicken"></center> </form> </body> </html> Manfred
Sep 18 2003
Someone wrote a cgi module, anyone rememeber where it is ? Benji hurry up with that site its desperatly needed! :) Charles <manfred toppoint.de> wrote in message news:bk9mqj$239g$1 digitaldaemon.com...Hello, i try to read out the value from the post method, but i get always an "Internal Server Error" -:( import c.stdlib; import c.stdio; import stream; int main(char[][] args) { char[] string; char *cl; uint size; printf("Content-type: text/html\n\n"); printf("<html><body>Hallo Manfred !!! </body></html>\r\n"); printf("<br>"); //query = getenv("QUERY_STRING"); cl = getenv("CONTENT_LENGTH"); printf("cl = %s <br>",cl); if (cl != null) { size = atoll(cl); printf("<br> size %li",size); } string = stream.stdin.readString(size); // <-- here is the problem return 0; } <html> <head> <title>Eine einfache Auswertung</title> </head> <body> <h1><center> <b><u>POST-Formular</u></b></center></h1><br><br> <form action=http://localhost/cgi-bin/post_methode.cgi method=post> <center><b>Bitte geben Sie ihren Namen ein :</b><br> <input name="Textfeld" siue="20"> </input> <input type=submit value="abschicken"></center> </form> </body> </html> Manfred
Sep 18 2003
Charles Sanders wrote:Someone wrote a cgi module, anyone rememeber where it is ?Mårten Ask - posted on 7/27/03 - cgi.d was attached.
Sep 18 2003