Embperl Examples - If Metacommands
The following displays an sentence depending on the method (GET, POST, other)
[$ if $ENV{REQUEST_METHOD} eq 'GET' $]
This is a GET request
[$ elsif $ENV{REQUEST_METHOD} eq 'POST' $]
This is a POST request
[$ else $]
This is not GET and not POST
[$ endif $]
The following displays an different sentence depending on the show parameter
[$ if $fdat{show} eq 'yes' $]
The show parameter is 'yes'
[$ elsif $fdat{show} eq 'no' $]
Nothing to show
[$ else $]
Request with if.htm?show=yes
of with if.htm?show=no
[$ endif $]
HTML::Embperl (c) 1997-1998 G.Richter