<?php if('XMLHttpRequest' == @$_SERVER['HTTP_X_REQUESTED_WITH']) { echo "show in facebox "; } else { echo "show in full page "; } ?>