redirect($returnPath . $rand); } // the json doesn't really matter, it will either be 0 or 1 echo json_encode((int)$pinned); exit(); } }