Posts

Showing posts from January, 2019

curd operations api

<?php // header("Access-Control-Allow-Methods: GET, OPTIONS"); // header("Access-Control-Allow-Headers: Content-Type, Content-Length, Accept-Encoding"); // defined('BASEPATH') OR exit('No direct script access allowed'); class Welcome extends CI_Controller { public function __construct($config = 'rest')     {         parent::__construct($config);         header('Access-Control-Allow-Origin: *');         header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Authorization");         header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");         $method = $_SERVER['REQUEST_METHOD'];         if ($method == "OPTIONS") {             die();         }     } // public function __construct($confi...