html - PHP return partial script -
i creating php (let's call pagex.php) file produces html. html has button when press it, send ajax request.
to avoid having multiple files, want send ajax request same file. (pagex.php)
i don't want ajax response return entire php generated response have normal request pagex.php. looking php method stop executing , return has.
i understand can big if statement, don't wrapping bottom part of code braces. looking equivelent of "break" statement php return current php generated html.
is possible?
send ajax request pagex.php?ajax=y
can
<?php if(!empty($_get['ajax'])) { //return ajax data exit; } ?> //your normal html code here
Comments
Post a Comment