Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-06

UNCGI issues

8 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hey all,
I've been using UNCGI to develop some cool little CGI apps lately and I have run across only one problem. Namely, the fact that get_value will not return anything longer than 255 chars. I've tried putting it into a pchar and into a ansistring with no luck. Please help with a solution. I will modify the uncgi code if required.. but i need to know what direction to take in doing so.

Thanks,
Matt

Fernando Lozano
to Unknown author

Hi Matt,

Show quoted text 5 lines
I've been using UNCGI to develop some cool little CGI apps lately and I have run across only one problem. Namely, the fact that get_value will not return anything longer than 255 chars. I've tried putting it into a pchar and into a ansistring with no luck. Please help with a solution. I will modify the uncgi code if required.. but i need to know what direction to take in doing so.

I guess this is because (Turbo) Pascal Strings cannot be longer than 255 chars. So you should change the source of uncgi to use pchar or ansistrings for all string manipulations. It is not enough to convert to a pchar or ansistring at the end, because if anywhere you get a standard string the result will be truncated to 255 chars.

[]s, Fernando Lozano

Peter Vreman
to Unknown author: I've been using UNCGI to develop some cool little CGI apps lately and I have run across…
you wrote 7 lines
Hey all, I've been using UNCGI to develop some cool little CGI apps lately and I have run across only one problem. Namely, the fact that get_value will not return anything longer than 255 chars. I've tried putting it into a pchar and into a ansistring with no luck. Please help with a solution. I will modify the uncgi code if required.. but i need to know what direction to take in doing so.

Try adding {$H+} to the uncgi unit. That will switch all strings to ansistrings.

Peter

Marco van de Voort
to Peter Vreman
Show quoted text 11 lines
At 05:43 18-6-01, you wrote: >Hey all, > I've been using UNCGI to develop some cool little CGI apps lately and > I have run across only one problem. Namely, the fact that get_value will > not return anything longer than 255 chars. I've tried putting it into a > pchar and into a ansistring with no luck. Please help with a > solution. I will modify the uncgi code if required.. but i need to know > what direction to take in doing so. Try adding {$H+} to the uncgi unit. That will switch all strings to ansistrings.

Afaik the GET method itself is limited to 255 chars. Use POST methods.

Unknown author

Hello,
Thank you all for the quick responses. The problem is this though:

I am using the post method to get the contents of a <textarea> tag. In the source code it says there is a limitation of the UNCGI unit in that it cannot pass params >255 chars. I tried simply converting everything to ansistrings but then the results came back funny. I think somewhere it relies on the s[0] element (which ansistrings don't support).

Any more ideas?

- Matt

In a message dated Mon, 18 Jun 2001 7:41:10 PM Eastern Daylight Time, Fernando Lozano writes:

<< Hi Matt,

Show quoted text 5 lines
I've been using UNCGI to develop some cool little CGI apps lately and I have run across only one problem. Namely, the fact that get_value will not return anything longer than 255 chars. I've tried putting it into a pchar and into a ansistring with no luck. Please help with a solution. I will modify the uncgi code if required.. but i need to know what direction to take in doing so.

I guess this is because (Turbo) Pascal Strings cannot be longer than 255 chars. So you should change the source of uncgi to use pchar or ansistrings for all string manipulations. It is not enough to convert to a pchar or ansistring at the end, because if anywhere you get a standard string the result will be truncated to 255 chars.

[]s, Fernando Lozano

Peter Vreman
Hello, Thank you all for the quick responses. The problem is this though: I am using the post method to get the contents of a <textarea> tag. In the source

code
it says there is a limitation of the UNCGI unit in that it cannot pass params >255 chars. I tried simply converting everything to ansistrings but then the results came back funny. I think somewhere it relies on the s[0] element (which ansistrings don't support).

Any more ideas?

Did you try the ezcgi unit from the FCL?

Fernando Lozano
to Unknown author: Thank you all for the quick responses. The problem is this though: I am using the post…

Matt,

Thank you all for the quick responses. The problem is this though: I am using the post method to get the contents of a <textarea> tag. In the source code it says there is a limitation of the UNCGI unit in that it cannot pass params >255 chars. I tried simply converting everything to ansistrings but then the results came back funny. I think somewhere it relies on the s[0] element (which ansistrings don't support).

s[0] is the length of the string. You can replace all ocurrences by strlen().

[]s, Fernando Lozano

Jo
to Unknown author: I've been using UNCGI to develop some cool little CGI apps lately and I have run across…

Try my little piece of unit. It has been tested under Apache on Linux and Win32/Dos.

Your sincerely,
IoDream.

Earlier message 20 lines
-----Message d'origine----- De : la part de Envoyé : lundi 18 juin 2001 05:43 À : Objet : [fpc-pascal]UNCGI issues Hey all, I've been using UNCGI to develop some cool little CGI apps lately and I have run across only one problem. Namely, the fact that get_value will not return anything longer than 255 chars. I've tried putting it into a pchar and into a ansistring with no luck. Please help with a solution. I will modify the uncgi code if required.. but i need to know what direction to take in doing so. Thanks, Matt