<?php
# This function grabs POST variables and cleans them up a bit
# It's not complete yet --- I need to do more research, etc..
#
# Adapted by:
# Joey kelly, joey@joeykelly.net
#
# To-do:
# get rid of bad characters, along with backslashes, after EscapeShellCmd()
# error codes?
#

function getpostvars($postvar, $maxlength) {
  # this function is for form submits, etc.
  $postvar = $_POST[$postvar];
#  $postvar = EscapeShellCmd($postvar);
  $postvar = substr($postvar, 0, $maxlength);
  return($postvar);
}

function getgetvars($getvar, $maxlength) {
  # this function is for hand-coded URLS
  $getvar = $_GET[$getvar];
#  $postvar = EscapeShellCmd($postvar);
  $getvar = substr($getvar, 0, $maxlength);
  return($getvar);
}

?>
