• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ACGI form parsing in OSX?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ACGI form parsing in OSX?


  • Subject: Re: ACGI form parsing in OSX?
  • From: Reinhold Penner <email@hidden>
  • Date: Thu, 31 Jan 2002 21:27:54 -1000

Jeff,

James, I'm glad you're on board for getting ACGIs working in X. The handler
for parsing that you provided is incomplete. We (OK, I) need a way to deal
with the fact that form POST data arrives URL encoded. My experience is that
pure Applescript approaches to this are sloooooow.

With all this talk of the Unix, is there a way to do this with the shell?
Anyone?

I have a partial answer in Perl, which I have running to handle incoming posts, but I don't know how to translate this into a do a shell script. So maybe someone will help us get multi-line perl scripts to run in the shell and return the processed results. This is a simplified version of what my perl script does:

#here we determine whether it's a post or get method
$method=$ENV{REQUEST_METHOD};
if ($method =~/get/i)
{
$input = $ENV{QUERY_STRING};
}
else
{
read (STDIN, $input, $ENV{CONTENT_LENGTH});
}

#now we have the full request in and split it up into name=value pairs
($comm, $value) = split(/=/, $input);

if ($comm eq "keyname")
{
#here is the key for URL decoding
$value =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge;
}

... quite a bit more stuff follows that writes stuff to files, but the essential part for URL decoding is listed above.

So if anyone can tell us how to run this regular expression substitution in the shell, we should have a nice URL decoder.

-Reinhold


  • Prev by Date: Re: Scripting Additions: Embracing the Horror of Unix
  • Next by Date: Re: Problems with "load script" revisited
  • Previous by thread: Re: ACGI form parsing in OSX?
  • Next by thread: Re: OO Theory misconceptions (was Re: can I make a list of
  • Index(es):
    • Date
    • Thread