GET Example

From CodeCodex

Implementation[edit]

Perl[edit]

use CGI 'param';

#
# Assumes proper headers have been sent
#

if ( param('Fname') ) {
	my $first_name = param('Fname');

} else {
	print "Fname was not set in the form\n";
}

PHP[edit]

<highlightsyntax> <?php

if(isset($_GET['Fname'])) {

 $Fname = $_GET['Fname'];

} else {

 echo "Fname was not set in the form\n";

}

?> </pre>