Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Over my head

by Purdy (Hermit)
on Nov 19, 2001 at 23:38 UTC ( #126354=note: print w/replies, xml ) Need Help??


in reply to Over my head

Well, this is quite a broad question, but I'll take a stab at it.

I would first read & research DBI, as it is pretty much the lingua franca of Perl & Database interactions.

Design-wise, I'm a little out of sync with what's the latest & greatest way to do this, but I would recommend creating a subroutine to render the form and use a parameterized or global hash value to populate the various input fields. IE:

sub render_form { %fields = shift; print <<"_HTML_"; Updated <input type="text" name="updated" value="$fields{updated}"> .... _HTML_ }

May even want to investigate HTML::Template. Then you can create a new form/page where a lab worker can "login" with their previous work order ID (which DBI can generate for you) or click on a link to create a new work order.

If they login with their previous work order, you query the database and populate the hash and pass that to your render_form function.

Otherwise, you just pass them onto your render_form function and the fields will be blank for them to fill out.

Then you need a new script (or handler within the current script) to take the fields (check out CGI) and either update the database (if they logged in) or insert a new record into the database.

HTH,

Jason

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://126354]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2019-11-13 18:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (74 votes). Check out past polls.

    Notices?