|
|
Joined: Jul 2001
Posts: 37
Member
|
Member
Joined: Jul 2001
Posts: 37 |
Say I have this code, test.cgi: #!/usr/bin/perl print "Content-type:text/htmlnn"; undef ($test); if ($test eq 'test') { print 'Did It Work'; } If I were to type http://www.myserver.com/cgi-bin/test.cgi?test=test Shouldn't it print "Did It Work" on my screen? For me all it does is print a blank screen. What am I doing wrong?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
no it shouldn't.
1) you didn't do anything to get the query string 2) you undef right before checking the value, which would negate anything you stored in $test from the query string if you HAD parsed the query string
#!/usr/bin/perl
use strict; use CGI qw/:standard/;
my $test = param('test');
print 'Did it work?' if $test eq 'test';
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|