HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/nclive/backend/state_other_link_data.php
<?php
header("Access-Control-Allow-Origin: *");
header('Content-Type: application/json');
include "config.php";

$slug=$_REQUEST['state'];

$getLinksQuery = "select sol.post_name, sol.post_slug, sol.summary from sp_other_links as sol where sol.status='1' and sol.state_slug='$slug'  order by sol.post_name";

$getLinksData = $db->prepare($getLinksQuery);
$getLinksData->execute();

	$data = array();
	
	while($exRes=$getLinksData->fetch()){
		$nestedData = array();
		$nestedData["post_name"] = $exRes['post_name'];
		$nestedData["post_slug"] = $exRes['post_slug'];
		$nestedData["summary"] = strip_tags($exRes['summary']);
		
		$data[] = $nestedData;
	}

		$json_data = array($data);
				
		echo json_encode($json_data);

?>