Skip to content

Instantly share code, notes, and snippets.

@pchatterjee
Created November 6, 2019 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pchatterjee/ce756b1cbd5fd37d3fc7f31f025e0448 to your computer and use it in GitHub Desktop.
Save pchatterjee/ce756b1cbd5fd37d3fc7f31f025e0448 to your computer and use it in GitHub Desktop.
<?php
@date_default_timezone_set("GMT");
define('PARAMS', array('to', 'from', 'amnt', 'format'));
if (!isset($_GET['format']) || empty($_GET['format'])) {
$_GET['format'] = 'xml';
}
# ensure PARAM values match the keys in $GET
if (count(array_intersect(PARAMS, array_keys($_GET))) < 4) {
echo "a 1000: error";
exit();
}
# ensure no extra params
if (count($_GET) > 4) {
echo "a 1100: error";
exit();
}
echo "Valdation passed so far ....";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment