php forum
php mysql forum
php mysql smarty
 
Topic Options
#103059 - 07/29/01 06:33 PM Undef, If, and a couple others
Chuck1616 Offline
Member

Registered: 07/16/01
Posts: 38
Loc: USA
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?

Top
#103060 - 07/29/01 07:09 PM Re: Undef, If, and a couple others
Mark Badolato Offline
P.I.T.A. / Programmer

Registered: 09/08/00
Posts: 836
Loc: Land O' Cactus
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

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks