$sent_id = (int) $_POST['favorite_page'];
if ($sent_id > 100000 or $sent_id == 0) return;
$id = $modx->resource->get('id'); //current id<form ... > <input type="text" name="favorite_page" ... > </form>
$modx->log(modX::LOG_LEVEL_ERROR, print_r($_POST, true));