How to change the timezone in CodeIgniter 3.1.6

date_default_timezone_set() function is used to sets the default timezone used by all date or time functions in core PHP, CodeIgniter etc. date_default_timezone_set(); date_default_timezone_set('Asia/Kolkata'); # Option-1: In case of CodeIgniter, we can set the default timezone in the application/config.php file In case of CodeIgniter, we can set the default timezone in the application/config.php file <?php defined('BASEPATH') … Continue reading How to change the timezone in CodeIgniter 3.1.6

PHP Sessions across sub domains

User will  login or set sessions at auth.domain.com and can use that session all the sub domains of that domain. the session will use across all sub domains. auth.domain.com sub1.domain.com sub2.domain.com where if the user visits sub1.domain.com or sub2.domain.com and they are not logged in, they get pushed over to auth.domain.com and can log in. … Continue reading PHP Sessions across sub domains

How to send a cross domain ajax request

  I want to send a cross domain ajax request but I am getting below error. I need to allow others send ajax requests to my script . So external requests may come from other websites and domains. Code which I have tried for request. $(document).ready(function () { $.ajax({ type: 'POST', url: "http://otherdomain.com/mypage.php", data: 'ss=' … Continue reading How to send a cross domain ajax request

How To Check If A Domain is Blacklisted by Google?

Did your search engine traffic suddenly drop rapidly or are you about to purchase a domain name? it is always wise to check if your domain name has been blacklisted or DE-indexed by Google? Be informed, there are several other reasons your website traffic could be dropping rapidly but it doesn’t hurt to check if … Continue reading How To Check If A Domain is Blacklisted by Google?

Download File in php or codeigniter

Want to download file using php. Here is the sample code. By using it you can download the file in php. you can use it in Codeigniter Also. the function are tested in Codeigniter. So it will works file in Codeigniter.  Just Call the function, download_sample(); It will start Downloading the file. public function download_sample(){ … Continue reading Download File in php or codeigniter

Php Code Encoding Benefits or which Encoder do I Need?

Php Code Encoding Benefits or which Encoder do I Need? Encoding Benefits PHP scripts can be easily read, changed and run on any PHP enabled system. Encoding PHP offers important benefits. Product Developers: protect and license your code before distribution. Time restricting is ideal for protecting evaluation copies, and server/domain based locking helps secure revenue from … Continue reading Php Code Encoding Benefits or which Encoder do I Need?

How to protect and hide PHP source code?

How to protect and hide PHP source code? In the time of open-source there are multiple benefits of making your code available to all. However when deploying or selling your PHP code to a client you might want to protect and hide it because of different business reasons or security. There are multiple approaches to … Continue reading How to protect and hide PHP source code?

Download File in php

Download File in php function. Force Download. Here, $filepath = File Full path, where the file exists. $filename = File name of the file , which have to download ,LIKE: file1.txt header('Content-Description: File Transfer'); header('Content-Type: application/force-download'); header("Content-Disposition: attachment; filename=\"" . basename($filename) . "\";"); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($filename)); ob_clean(); … Continue reading Download File in php