Help for this page

Select Code to Download


  1. or download this
        use strict;
        use warnings;
    
  2. or download this
        use CGI::Carp qw{ fatalsToBrowser };
    
  3. or download this
        use warnings FATAL => "all";
    
  4. or download this
        Use of unitialized value in numeric eq (==) at login.cgi line 50.
    
  5. or download this
        if($ref->{'counted'} == 1){
    
  6. or download this
        my $dbh = connectDB();
        my $sth = $dbh->prepare("SELECT count(id) as counted FROM perl_use
    +rs WHERE `username` = ? AND `password` = ?");
    ...
        $sth->execute($uname, $pass_hash);
    
        my $ref = $sth->fetchrow_hashref();
    
  7. or download this
        sub debug {
            my ($msg) = @_;
    ...
    
            print qq{<pre><b>Debug [line $lnum]</b>: &nbsp; $msg</pre>};
        }
    
  8. or download this
        if($q->request_method eq "POST"){
            debug("Yes, the request method WAS 'POST'");
    
  9. or download this
        my $uname = $q->param('uname');
        my $pass  = $q->param('pass');
        debug("Passed values were: Uname=$uname Pass=$pass");
    
  10. or download this
        #!/usr/bin/perl
    
    ...
        my $id = $s->id;
    
        print "<script>window.location.href = 'profile.pl?token=$id';</scr
    +ipt>";