Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Question about this simple CGI

by poj (Prior)
on Jul 17, 2013 at 20:22 UTC ( #1044888=note: print w/replies, xml ) Need Help??

in reply to Re^2: Question about this simple CGI
in thread Question about this simple CGI

it's telling me that $day and $number are both unitialized, any clue why?

They are not being sent from your html page probably. You can assign defaults like this;

my $name = $q->param('name') || 'noname'; my $day = $q->param('day') || 'noday'; my $number = $q->param('number') || 'nonumber';

The elements after the print line should be comma separated and you shouldn't be printing after the end_html

print $q->header, $q->start_html( -title => "Add user", -bgcolor => "#ffffff"), $q->p("Data submitted"), $q->tt("$name<br/>$day<br/>$number"), $q->end_html;

And you may wish to add this while developing to see any errors in the browser.

use CGI::Carp 'fatalsToBrowser';

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044888]
[Discipulus]: i'm stuck at 54 ;=( but for me is good enough
[Discipulus]: and even if i lead in primality check, i have 2 chars more than you in iEmirp nums..

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2017-10-20 09:26 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (260 votes). Check out past polls.