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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -