Generation

generate functionMon, 06 Feb 2023

Write a php function that only show its content from an ajax request by local site

<?php if ($_SERVER['HTTP_ORIGIN'] == "http://localhost/") { header("Access-Control-Allow-Origin: http://localhost/"); } if( !empty($_POST['name']) ) { echo "Hello ". $_POST['name']; } ?>

Questions about programming?Chat with your personal AI assistant