<?php require_once "../php/main.php"; $id = argreq("id"); $code = argreq("code"); if (check_ticker_passcode($id, $code)) { api_done(array("ticker" => get_ticker($id))); } api_error();
function validate_ticker_passcode($ticker, $code) { if (!check_ticker_passcode($ticker, $code)) { throw new Exception(); } }