Here is the actual script:
#!/usr/bin/perl ############################ # Get data from GET & POST # ############################ &parse_form; ################ # VARS defined # ################ $theDate = localtime; ################################## # Random numbers to be generated # ################################## my $range = 200; my $minimum = 1000000000; my $jobNum = int(rand($range)) + $minimum; #NEED CODE HERE TO DO SOME CHECKING AGAINST aj.db (Active Jobs) ################################## # Print out the page for editing # ################################## print "Content-type: text/html\n\n"; print " <html> <head><title>PC Job Tracker - Add Job [$input{'database'}]</title> </head> <body bgcolor='#b39f75'> <form action='editjob.cgi' method='GET'> <input type='hidden' name='action' value='add'> <input type='hidden' name='database' value='$input{'database'}'> <font face='verdana' color='#m3t789' size='2'> <h1><u>PC Job Tracker | Add PC Job</u></h1> <table> <tr><td><font size='4'>Job #:</font></td><td><input type='text' name=' +njob' value='$jobNum'></td> </tr> </table> <br> <h2><u>Client Data</u></h2> <table> <tr><td><font size='4'>First Name:</font></td><td><input type='text' n +ame='fname'></td><td>&nbsp;&nbsp;&nbsp;</td><td><font size='4'>Last N +ame:</td></font><td><input type='text' name='lname'></td><td>&nbsp;&n +bsp;&nbsp;</td><td><font size='4'>Phone Number:</font></td><td><input + type='text' name='nphone'></td> </tr> </table> <br> <font face='verdana' size='3' color='#m3t789'> <h2><u>Computer Info</u></h2> <table> <tr><td><font size='4' color='black'>Machine:</font></td> <td> <select name='nmachine'> <option value='none'>------------------------- <option value='homebrew'>Home Built <option value='acer'>Acer <option value='apple'>Apple <option value='compaq'>Compaq <option value='dell'>Dell <option value='emachine'>eMachine <option value='gateway'>Gateway <option value='hp'>HP <option value='ibm'>IBM <option value='lenovo'>Lenovo <option value='pb'>Packard Bell <option value='toshiba'>Toshiba </select> </td> <td>&nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;&nbsp;</td> <td><font face='verdana' size='4'>Date of Arrival: <input type='text' +name='ndoa' value='$theDate'></td> </table> <br> <font face='verdana' size='5'><u><b>Comments</b></u></font> <br> <textarea name='nnotes' wrap='physical' rows='6' cols='50'> </textarea> <table> <tr> <td> <input type='submit' value='Submit'> </form> </td> <td>&nbsp;&nbsp;&nbsp;</td> <td> <form action='main_view.cgi' method='GET'> <input type='submit' value='Cancel'> </form> </td> </tr> </table> </font> </body> </html> "; ######################################## # Code to get the data from GET & POST # ######################################## sub parse_form { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if (length($buffer) < 5) { $buffer = $ENV{QUERY_STRING}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $input{$name} = $value; } }

In reply to Re^2: Testing numeric strings by jlwoodruff
in thread Testing numeric strings by jlwoodruff

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.