[Gambas-user] Webpage & Request.Post

Hans Lehmann hans at gambas-buch.de
Sat Jul 2 15:37:08 CEST 2022


Hello,

I am working with the class Webpage. When I want to evaluate a form, I 
get with this source text:

<%
   Dim i As Integer
   Dim aFields As New String[]

   aFields = Request.Post.Fields

   Print "METHODE = " & CGI["REQUEST_METHOD"]

   Print "<br>"
   For i = 0 To aFields.Max
     Print "Field " & i & " = " & aFields[i] & "<br>"
   Next
%>

this output in the browser after I have submitted the form:

METHODE = POST
Field 0 = firstname
Field 1 = lastname
Field 2 = birthday
Field 3 = email
Field 4 = material
Field 5 = version
Field 6 = message
Field 7 = confirmation
Field 8 = sent

However, I am not able to read out the contents of the individual fields!

The following - extended source text:

<%
   Dim i As Integer
   Dim aFields As New String[]
   Dim hRequest As New Request

   aFields = Request.Post.Fields

   Print "METHODE = " & CGI["REQUEST_METHOD"]
   Print "<br>"
   For i = 0 To aFields.Max
    Print "Field " & i & " = " & aFields[i] & " Field_Value = " & 
hRequest.Post[aFields[i]] & "<br>"
   Next
%>

triggers an error. The browser only says:

500 Internal Server Error

Where is my error?
What are the possibilities to determine the content of the individual 
fields?

With kind regards

Hans



More information about the User mailing list