Abraham Garcia in PHP Scripts   Monday, March 16 2020

Get IP Details Via API with PHP

ipapi.com is a API for getting IP address details. You can use this to redirect users to different websites depending on the country access.

This is a short tutorial on how to get IP Address details with API ipapi.com  <?php echo file_get_contents('https://ipapi.co/8.8.8.8/json'); ?> Sample Response: { "ip": "8.8.8.8", "city": "Mountain View", "region": "California", "region_code":

Continue reading
Abraham Garcia in PHP Scripts   Thursday, September 12 2019

Enable CORS on CodeIgniter Controller PHP

How to Enable CORS on CodeIgniter Controller PHP. Learn with a Simple Constructor Method for your PHP Controller.

This is a Short Snippet for Code Igniter to Enable CORS on Controller.  public function __construct() { header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE"); parent::__construct(); }

Continue reading
Abraham Garcia in PHP Scripts   Thursday, July 11 2019

Invisible Recaptcha V3 PHP Example

Complete HTML, JS and PHP Sample on How to get Started with Google Recaptcha V3. The New and Improved Recaptcha V3.

This is a short Recaptcha V3 Example on PHP.   Add this on Your Header Before closing </head> <script src="https://www.google.com/recaptcha/api.js?render=siteKeyCode"></script> <script> grecaptcha.ready(function() { // do request for recaptcha token // response

Continue reading
Abraham Garcia in PHP Scripts   Thursday, May 23 2019

How to Remove index.php on URL in CodeIgniter

Remove the index.php in the URL for CodeIgniter. Simple and Fast Tutorial for all PHP Developers.

Short instructions on how to remove the CodeIgniter index.php with .htaccess 1. Create .htaccess File RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] 2. Update config.php

Continue reading