Header Ads

header ads

EASY WAY TO CONVERT AND MIGRATE PHP 5 TO PHP 7 FILES

Sampeyan yang masih kesulitan migrasi PHP 5 ke PHP 7.x apalagi saat aplikasi sudah diupload ke server, sementara layanan server/hosting menggunakan PHP 7.x secara default dan aplikasi Sampeyan masih pada PHP 5 sehingga menjadi error.EASY WAY TO CONVERT AND MIGRATE PHP 5 TO PHP 7 FILES
PHP 7.x

Caranya:
  1. Download file: parser-php-version.php
  2. Letakkan file tersebut di folder utama (public_html)
  3. Buka file config.php
  4. Lakukan include file:parser-php-version.php pada file config php seperti berikut:
<?php
include ”parser-php-version.php”;

date_default_timezone_set(’Asia/Jakarta’);
$server = ”localhost”;
$username = ”####”;
$password = ”####”;
$database = ”####”;
mysql_connect($server,$username,$password);
mysql_select_db($database);

function anti_injection($data){
$filter = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
return $filter;
}

function average($arr){
if (!is_array($arr)) return false;
return array_sum($arr)/count($arr);
}

function cek_session_admin(){
$level = $_SESSION[level];
if ($level != ’superuser’ AND $level != ’header’){
echo ”<script>document.location=’index.php’;</script>”;
}
}

function cek_session_admin(){
$level = $_SESSION[level];
if ($level != ’admin’ AND $level != ’superuser’ AND $level != ’header’){
echo ”<script>document.location=’index.php’;</script>”;
}
}

function cek_session_user(){
$level = $_SESSION[level];
if ($level == ’’){
echo ”<script>document.location=’index.php’;</script>”;
}
}

?>