Forum Moderators: coopster & phranque

Message Too Old, No Replies

How to see if variable is set?

         

branmh

2:15 pm on Oct 26, 2003 (gmt 0)

10+ Year Member



I would like to see if the $ENV{'DOCUMENT_URI'} is set if not then use $ENV{'SCRIPT_NAME'}

Monus

2:52 pm on Oct 26, 2003 (gmt 0)

10+ Year Member




($ENV{'DOCUMENT_URI'})? ($uri = $ENV{'DOCUMENT_URI'}) : ($uri = $ENV{'SCRIPT_NAME'});

or

$uri = $ENV{'DOCUMENT_URI'} ¦¦ $ENV{'SCRIPT_NAME'};

or
..... there are many ways to do the job.