Created
November 6, 2019 16:09
-
-
Save pchatterjee/ce756b1cbd5fd37d3fc7f31f025e0448 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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