<?php header("Access-Control-Allow-Origin: *");
  header("Access-Control-Allow-Headers: *");  

  header('Content-Type: application/json');

  include '../db/connectMe.php';   
  include '../function/function.php';  


  // (A) NO data
  if (!isset($_GET["n"]) ) {

    $error = array('details' => 'something went wrong');
    exit( json_encode($error) ); 

  }

    //view news information

    if (@$_GET['n'] != "" ) {

      @$newsId = mysql_prep($_GET['n']);

      $newsSet = find_news_by_tk($newsId); 

      if(!isset($newsSet)){

        $error = array('details' => 'something went wrong');

        exit(json_encode($error));

      }

      //news details
      $details = array("details" => $newsSet);

      exit(json_encode($details));



    }  




