Category Archives: PHP

2,079 views

PHP how to include file from parent directory relative path

If You have an Android project web in PHP code, you can to try this code for including file from parent directory: Example source code: // from parent dir include "./myIncludeFile.php";     // from parent dir include __DIR__."/../myIncludeFile.php";   … Continue reading

Posted in PHP | Tagged , | Comments Off on PHP how to include file from parent directory relative path
1,921 views

PHP get daylight saving time

$dst = date("I"); //I (capital i); 0 or 1 if daylight saving time   // example: $hour = 14; if(date("I")===1){ $hour = $hour + 1; } // OR $hour = 14 + date("I");

Posted in PHP | Tagged | Comments Off on PHP get daylight saving time
2,688 views

Access-Control-Allow-Origin Multiple Origin Domains

In browser’s console get message: no ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin is therefore not allowed access. PHP source code: put into start of php script // different DOMAINS $http_origin = $_SERVER[’HTTP_ORIGIN’];   if ($http_origin == "http://www.domain1.com" … Continue reading

Posted in PHP | Tagged , | Comments Off on Access-Control-Allow-Origin Multiple Origin Domains