Skip to main content

Posts

Showing posts from April, 2017

Panduan MySQLI

Connect to database using php mysqli In order to connect to MySQL database using mysqli, mysqli_connect function is used, you need to provide host name ,  username ,  password and database name . Connect to database using php mysqli – procedural way In procedural way mysqli_connect function is used. mysql_connect function opens a connection to database server and connection object is returned. If connection to database fails  mysqli_connect_errno() throws an error. <?php $host = "localhost"; $user = "root"; $password = ""; $database = "dbusers"; $mysqli = mysqli_connect($host, $user, $password, $database); if (mysqli_connect_errno($mysqli)) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } ?> Connect to database using php mysqli – object oriented way Object oriented way to connect to database, mysqli function is called and an object is returned. In case database connection is ...

Web Server dalam Satu Server

<?php //https://www.youtube.com/watch?v=cC4L367NriM function conectarse() {         $servername = "localhost"; $username = "root"; $password = ""; $dbname = "dikti";         $conn = mysqli_connect($servername, $username, $password, $dbname);          if (!$conn) {             die("Connection failed: " . mysqli_connect_error());         return ($conn);                }                     } ?> //service <?php     include ('lib/nusoap.php');     require ('connection.php');     $url = "http://localhost/051001/service.php";     $server = new nusoap_server();     $server->configureWSDL("consulta", $url)...
Go to My Computer->properties -> Advanced system setting Now click on Environment Variables.. Add ;C:\xampp\php in path variable value Restart command prompt and check if not work follow below step: Double click on TEMP and TMP variables and add ;C:\xampp\php in Variable value

Upload Many Files

<?php if(isset($_FILES['files'])){     $errors= array();  foreach($_FILES['files']['tmp_name'] as $key => $tmp_name ){   $file_name = $key.$_FILES['files']['name'][$key];   $file_size =$_FILES['files']['size'][$key];   $file_tmp =$_FILES['files']['tmp_name'][$key];   $file_type=$_FILES['files']['type'][$key];         if($file_size > 2097152){    $errors[]='File size must be less than 2 MB';         }           $desired_dir="user_data";         if(empty($errors)==true){             if(is_dir($desired_dir)==false){                 mkdir("$desired_dir", 0700);  // Create directory if it does not exist   ...

Cetak Foto Masal PHP

<?php ini_set("memory_limit",-1); set_time_limit(0); require('../academic/fpdf/fpdf.php'); class PDF_Rotate extends FPDF { var $angle=0; function Rotate($angle,$x=-1,$y=-1) {     if($x==-1)         $x=$this->x;     if($y==-1)         $y=$this->y;     if($this->angle!=0)         $this->_out('Q');     $this->angle=$angle;     if($angle!=0)     {         $angle*=M_PI/180;         $c=cos($angle);         $s=sin($angle);         $cx=$x*$this->k;         $cy=($this->h-$y)*$this->k;         $this->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F...

Migrasi All Struktur MYSQL in server to Postgre database

<!DOCTYPE html> <html> <head>   <title>Migrasi Struktur</title> </head> <body> <!-- Progress bar holder --> <link rel="stylesheet" href="progress/bootstrap.min.css"> <div id="progress" class="progress-bar progress-bar-striped active" style="width:500px;border:1px solid #000;"></div> <!-- Progress information --> <div id="information" style="width"></div> </br> <?php @include "config-postgre.php";            // please copy the config.sample.php and edit the correct fields @include "config.php";            // please copy the config.sample.php and edit the correct fields  // Initializing vars ini_set( 'memory_limit', '2048M' ); set_time_limit( 0 ); $time_start = time(); /* $conn_postgre =    pg_connect("host=$db_host dbname=$db_name user=$db_uname password=$db_passwd"); */ $conn_pos...

Export MYSQL database to POSTGRE - Bagian 1

<!DOCTYPE html> <html> <head>   <title>Progress Bar</title> </head> <body> <!-- Progress bar holder --> <link rel="stylesheet" href="progress/bootstrap.min.css"> <div id="progress" class="progress-bar progress-bar-striped active" style="width:500px;border:1px solid #000;"></div> <!-- Progress information --> <div id="information" style="width"></div> </br> <?php @include "config-postgre.php";            // please copy the config.sample.php and edit the correct fields @include "config.php";            // please copy the config.sample.php and edit the correct fields  // Initializing vars ini_set( 'memory_limit', '2048M' ); set_time_limit( 0 ); $time_start = time(); /* $conn_postgre =    pg_connect("host=$db_host dbname=$db_name user=$db_uname password=$db_passwd"); */ $conn_postgre...

Kode Import DBF to POSTGRE

<!DOCTYPE html> <html> <head>   <title>Progress Bar</title> </head> <body> <!-- Progress bar holder --> <link rel="stylesheet" href="progress/bootstrap.min.css"> <div id="progress" class="progress-bar progress-bar-striped active" style="width:500px;border:1px solid #000;"></div> <!-- Progress information --> <div id="information" style="width"></div> </br> <?php @include "config-postgre.php";            // please copy the config.sample.php and edit the correct fields @include "classes/XBase/Table.php"; @include "classes/XBase/Column.php"; @include "classes/XBase/Record.php"; @include "classes/DBFhandler.php"; use XBase\Table;  // Initializing vars ini_set( 'memory_limit', '2048M' ); set_time_limit( 0 ); $time_start = time(); $files = scandir($xbase_dir) or die...

Import DBF to Postgre

dbf-posrgre.php   <!DOCTYPE html> <html> <head>   <title>Progress Bar</title> </head> <body> <!-- Progress bar holder --> <link rel="stylesheet" href="progress/bootstrap.min.css"> <div id="progress" class="progress-bar progress-bar-striped active" style="width:500px;border:1px solid #000;"></div> <!-- Progress information --> <div id="information" style="width"></div> </br> <?php @include "config-postgre.php";             @include "classes/XBase/Table.php"; @include "classes/XBase/Column.php"; @include "classes/XBase/Record.php"; @include "classes/DBFhandler.php"; use XBase\Table;  // Initializing vars ini_set( 'memory_limit', '2048M' ); set_time_limit( 0 ); $time_start = time(); $files = scandir($xbase_dir) or die ("Error! Could not open directory ...

IP-Address

Ip Address atau bisa disebut juga dengan alamat IP adalah kumpulan angka yang unikdari sebuah komputer yang terhubung ke internet. Kenapa unik? Karena pada suatu jaringan di internet, masing masing komputer yang terhubung memiliki alamat IP sendiri-sendiri dan tidak ada yang sama. Oke, langsung saja berikut adalah langkah langkah untuk mengetahui alamat IP komputer yang terhubung dengan jaringan LAN. 1. Pastikan komputer/laptop anda sudah terhubung dengan jaringan LAN 2. Jika sudah, bukalah Command Prompt (CMD) anda, anda dapat membukanya dengan menekan tombol keyboard (Windows + R) untuk menampilkan jendela RUN. Jika sudah muncul jendela RUN, ketikkan “CMD” kemudian klik “OK”. 3. Setelah jendela Command Prompt muncul, ketikkan perintah “net view” kemudian Enter 4. Tadaaaa, akan muncul list nama kompuer yang terhubung dengan Jaringan LAN. Ett, itu baru nama komputernya saja lho. 5. Untuk mengetahui alamat Ipnya, anda bisa melakukan ping dengan men...