Perl -> PHP & form "stickiness"

by David Mintz <mambomintz(at)yahoo.com>

 Date:  Fri, 11 Aug 2000 12:56:44 -0700 (PDT)
 To:  hwg-languages(at)hwg.org
  todo: View Thread, Original
I'm familiar with Perl, and getting started with PHP
(and loving it, BTW).

I'm trying to emulate CGI.pm-style form "stickiness"
and it's... a learning process.

(by stickiness, I mean when the form submission has
missing or invalid data, the script prints an error
message and (re-)presents the user with the form with
all its state intact, instead of saying "hit Back and
try again.")

One thing I've noticed is that my form-printing
functions are not aware of the just-submitted form
variables. Fair enough. So I'm saying things like 

   global $HTTP_POST_VARS;

near the top of such functions. Is that a reasonable
way to do it?

Also, PHP appears to be escaping my quotes for me when
I print back a form with its state intact, as if I had
called addslashes on the field's value! What's up with
that? I feel kinda funny using stripslashes on it when
I didn't addslashes it in the first place.

I welcome any comments from you PHP-heads. I also
welcome recommendations of reading -- other than
php.net (been there) and L. Atkinson, "Core PHP
Programming" (bought that)-- that stress practical
how-to stuff like this.

David Mintz
Spanish Interpreter, US District Court
Southern District of New York
Web Design & Hosting http://www.dmintzweb.com
Personal http://www.panix.com/~dmintz




__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA