putting code into a Wiki with PHP!

Need to get the inputs for the form from the URL, but without showing warnings when they are not specified:


global $wgOut;

$toDecode = '';
if ( !empty( $_GET )  ) {
  if ( isset($_GET['decode'] ) ) {
    $toDecode = $_GET['decode'];
  }
}

if ( empty($toDecode )  ) {
  $input = '8038'; # default value if none specified
} else {
  $input = $toDecode;
}

# end then the output...

$output .= '<textarea name="formula" cols="10" rows="1" wrap="off"/>';
$output .= $input;
$output .= '</textarea>

Advertisements

~ by nambabwe on 2011/08/11.

 
%d bloggers like this: