in reply to Re^13: somethign wrong with the sumbit
in thread somethign wrong with the sumbit
Your test cgi script is syntactically correct and it runs ok form the shell but i dont understand a thing, all i see is raw html data like the following that doesnt make any sense to me, i cant make it work to the browser though and dont understand why, its a mystery because the script is correct:
Because the string before the user hits submit and the string returned after submission is NOT the same, that proves to us that the browser DOES ALTER the submitted data in some way although it shouldn't have done this? Isn't that anticanonical?
<option value="╬ο╬ξ">╬ο╬ξ< +/option> <option value="╬▓╧Β">╬▓╧Β +;</option>
In any case, the form data sent back to your server from the browser is determined by you when you create the form.By that you mean that when i create the form i must explicitly tell perl what character set to be expecting as return form string by the browser? Isn't print header (-charset => 'utf-8') suppose to do this or i need something extra too?
OR perhaps you by that you mean
that, i'm responsible to switch the returned form string to encoding of my liking (utf-8) for example?
In other words, when you send a form to a browser, and the user clicks things on the form and submits it, the values sent back are exactly the parameter values that you provided in the form -- the browser is not supposed to do anything to change those values (not even anything like changing the character encoding); it just provides a way for the user to make selections, and it sends back the information you requested about those selections.If the browser was sending back to my index.pl script exactly the same string the user selected before sumbitting the form(not altering it at any way) then WHY the strings ain't matching when i do this? unless ( grep { $_ eq param('select') } @display_files ) ????
Because the string before the user hits submit and the string returned after submission is NOT the same, that proves to us that the browser DOES ALTER the submitted data in some way although it shouldn't have done this? Isn't that anticanonical?
/because you said i needed a line i also tried to:
So to proper set the return browser string to utf8(i tried it like this so to avoid specifying the source encoding but rather only the ending one but it doesnt work though ) and then re-encode it to greek-iso since that's the encoded needed to open the file later.$article = decode('utf-8', param('select')); Encode::from_to($article, 'utf-8', 'ISO-8859-7') ; open FILE, "<$ENV{'DOCUMENT_ROOT'}/data/text/$article.txt" or die $ +!; local $/; $data = <FILE>; close FILE;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^15: somethign wrong with the sumbit
by graff (Chancellor) on Jan 03, 2008 at 03:32 UTC | |
|
In Section
Seekers of Perl Wisdom