Hello,
I'm dabbling with a CGI login page for the first time so I can learn a bit about CGI and I am using a simple flat file to write data to for the moment. When I open the file and try to print the users information to the flat text file it doesn't seem to print the information only the variable divider. Can someone tell me what I'm doing wrong?
Thanks

#!c:/perl/bin/Perl.exe use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use Fcntl qw(:flock :seek); use CGI; use CGI::Cookie; use XML::Simple; use strict; my $passfile = "userfile.txt"; print header; print start_html("New User"); my $q = CGI->new; my $self = $q->url; # the path to this script my $username = $q->param('username') ; my $first = $q->param('first') || ''; my $last = $q->param('last') || ''; my $pass1 = $q->param('pass1') || ''; my $pass2 = $q->param('pass2') || ''; #new user signup page print <<End_of_HTML; </head><body bgcolor="#ffffff"> <form action="http://localhost/newuser.cgi?action=newuser?first?last" +method="post"> <h2>New User Form</h2> First name? <input type="text" name="first" value=""> <br />Last name? <input type="text" name="last" value=""> <br />Username (2-12 characters)? <input type="text" name="username" +value=""> <br />Password <input type="password" name="pass1"> <br />Password (verify) <input type="password" name="pass2"> <input type="hidden" name="action" value="validate_newuser"> <br /> <br /> <input type="submit" value="Go!"> </form> <br /> <br /> <i>Thank you for signing up. </i> End_of_HTML open(FILE, ">>$passfile") or die "can't open password file"; print FILE "$first:$last:$username"; close(FILE);

2006-05-02 Retitled by GrandFather, as per Monastery guidelines
Original title: 'Wondering why this doesn't work'


In reply to Trouble getting CGI parameters by gitarwmn

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.