ghenry has asked for the wisdom of the Perl Monks concerning the following question:

Update: This is just an experiment, there is nothing wrong with the PHP version.

Dear Master Monks,
I would like to take a PHP Reg form our company has written and convert it to Perl, maybe starting with a CGI version and use ModPerl::Registry

I have searched on CPAN, and there seems to be a lot of good helper modules out there, but wanted some advice on the best ones to pick that can pull in some PHP functions etc.

The form has Javascript, 4 different include files for functions, with 1 for the DB configuration details and it connects to a PostgreSQL DB.

It also has a lot of HTML in it, so maybe HTML::Template could be used?

Never done this before, so I wanted to minimise the re-write as much as possible.

Thanks.

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!
  • Comment on Converting a PHP Registration Form to Perl

Replies are listed 'Best First'.
Re: Converting a PHP Registration Form to Perl
by PodMaster (Abbot) on Sep 08, 2005 at 10:13 UTC
    I have searched on CPAN, and there seems to be a lot of good helper modules out there, but wanted some advice on the best ones to pick that can pull in some PHP functions etc
    What do you mean?

    Maybe if you gave us an idea (cut'n'paste) of what your php looks like ...
    you might able to use PHP::Include to read the config file.
    You'll need DBI/DBD::Pg to connect to the DB.
    You could use CGI::FormBuilder (which can cooperate with HTML::Template) to generate the html (with javascript) and validate the form ...

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      There's quite a lot of it. You sure?

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!
Re: Converting a PHP Registration Form to Perl
by bradcathey (Prior) on Sep 08, 2005 at 11:51 UTC

    I might be missing just how complicated this form is, but I've never created a form to hard to be handled with HTML::Template and HTML::FillInForm

    I've included a sample of how we use CSS for our structure, and Perl for form validation, untainting, and how we return a form if errors. And if you're interested, I've created a formgenerator that writes all the HTML, SQL, and Perl for each field and type--msg me.


    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot

      Excellent, but I think we have made our form complicated. There's only one sql call, and the rest is in a trigger.

      If you both want to see the code, I can paste all the different elements in.

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!