Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
September 17, 2003 post method wtih cgi | ||||
---|---|---|---|---|
| ||||
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 |
September 17, 2003 Re: post method wtih cgi | ||||
---|---|---|---|---|
| ||||
Posted in reply to manfred | This line:
> printf("Content-type: text/html\n\n");
Should be:
printf("Content-type: text/html\r\n\r\n");
|
September 18, 2003 Re: post method wtih cgi | ||||
---|---|---|---|---|
| ||||
Posted in reply to Julio César Carrascal Urquijo | 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");
|
September 18, 2003 Re: post method wtih cgi | ||||
---|---|---|---|---|
| ||||
Posted in reply to manfred | 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 > > |
September 18, 2003 Re: post method wtih cgi | ||||
---|---|---|---|---|
| ||||
Posted in reply to manfred | 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 > > |
September 19, 2003 Re: post method wtih cgi | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Sanders | 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.
|
Copyright © 1999-2021 by the D Language Foundation