Hello, i am trying to create a php script that offers the following functions...
wardrobe.php?friend=FRIENDNAME
wardrobe.php?hash=HASHTAG
but i dont want you to be able to use both at the same time, please could you help improve my code to become more stable, add error checking and also offer this feature mentioned above, thanks
<?
header("Content-Type: image/png");
$friend = strtolower($_GET['friend']);
$hash = strtolower($_GET['hash']);
if (empty($hash) {
$filepath = "wardrobe/md5($friend)";
$errorpath = "wardrobe/cb5e100e5a9a3e7f6d1fd97512215282";
if (is_readable($filepath)) {
readfile($filepath);
} else {
readfile($errorpath);
}
} elseif (empty($friend) {
$filepath = "wardrobe/$hash";
$errorpath = "wardrobe/cb5e100e5a9a3e7f6d1fd97512215282";
if (is_readable($filepath)) {
readfile($filepath);
} else {
readfile($errorpath);
}
}
?>
Kind Regards,
Nathaniel Blackburn