can someone tell me why I am unable to set the $name = to the appropriate value. If I set $user = to a valid user everything works fine but as soon as I set it to remote_user $name is never populated. It has worked in the past and I never changed the line other then to comment it out.
#Volunteer.pl - Insert Volunteers into database use strict; use DBI; use CGI qw(:standard); my $query = CGI::new(); my ($dbh, $sth, $sql); my @volunteer_date = $query->param("Volunteer"); my $parent = $query->param("Parent"); my $user = $query->remote_user(); #my $user = "<valid user>"; #my $name = undef; my $name = (); my $date = (); my $sub_parent = (); #my $parent = "Father"; #my @volunteer_date = ("2002-01-18"); print $query->header(), $query->start_html (-title=>'Volunteer List Form', -link=>'#FFFFFF', -vlink=>'99FF99', -alink=>'black', -style=>{'-src'=>'/CSS/stylesheet.css'} # store subparent for each parent my %parent_hash = ( 'Father' => 'Mother', 'Mother' => 'Father' ); if ( @volunteer_date ){ if (exists $parent_hash{$parent}) { my $sub_parent = $parent_hash{$parent}; for my $col ( $parent, $sub_parent ) { my $sql = "select $col from Roster where User=?"; my $sth = $dbh->selectcol_arrayref( $sql, undef, $user ); if ( @$sth && $sth->[0] ) { # any rows returned? $name = $sth->[0]; # take first one last; } } } print $query->h1({-align=>'center'},"THANK YOU FOR SIGNING UP $name"); foreach $date ( @volunteer_date ) { $sql = "select distinct Volunteer from Volunteer where Volunte +er =? and Date =?"; my $sth = $dbh->selectcol_arrayref( $sql, undef, $name, $date +); #Verify the parent is not signed up. if( @$sth ) {

In reply to remote_user not identifing user by mnlight

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.