Posts

Showing posts from November, 2012

Menghilangkan index.php di url Codeigniter

Image
penggunaan index.php pada URL ketika menggunakan codeigniter sangat mengganggu pandangan. Misal, ketika ingin mengakses controller "home", maka sebelum nama controller tersebut harus disertakan index.php, sehingga menjadi index.php/home. cara menghilangkannya yaitu : 1. buat file .htaccess di top folder ci, 2. copy paste script berikut : RewriteEngine On RewriteBase / #Removes access to the system folder by users. #Additionally this will allow you to create a System.php controller, #previously this would not have been possible. #’system’ can be replaced if you have renamed your system folder. RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #When your application folder isn’t in the system folder #This snippet prevents user access to the application folder #Submitted by: Fabdrol #Rename ‘application’ to your applications folder name. RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] #Checks to see i...

Menambah dan Mengurangi Datetime di SQL SERVER / MYSQL | DATEADD | DATEDIFF

Cara Menambahkan tanggal dengan int  yaitu menggunakan fungsi DATEADD, dengan format sebagai  berikut : select DATEADD("dd", @jumlah , @DATE) --> hasil :  contoh : select DATEADD("dd", 2 , 2012-03-21) --> hasil : 2012-03-23  Menambahkan atau mengurangi tanggal dengan tanggal. menggunakan fungsi DATEDIFF, formatnya yaitu : select DATEDIFF("dd",'01-01-2011','02-01-2011'); --> Hasil : adalah 31 select DATEDIFF("dd",'03/01/2011','02/01/2011'); --> Hasil : adalah -28

Create Calculator With Visual Studio 2012 | VB.Net Calculator

Image
picture : if text field is null How to create Simple Calculator with visual studio 2012 or VB.Net? This is your solution, you can read this tutorial, you also can Download Source Code Simple Calculator with visual studio 2012 , and direct practice this tutorial. Open Visual Studio, New Project  then, create design like this picture : 3. Right Click or F7 to view Source Code, 4. Write code like this : Public Class Calculator Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim A = varA.Text Dim B = varB.Text If (A = "") Then warn.Text = "var A Not Allow null" ElseIf (B = "") Then warn.Text = "var B Not Allow null" Else Dim c = A * B Operation.Text = "X" Result.Text = c End If End Sub Private Sub ExitToolStripMenuItem_Click(sender As Object, e As...

Create box shadow with css | css tutorial

Image
to create box shadow as above you should prepare css script as follows: div { width:300px; height:100px; background-color:yellow; -moz-box-shadow: 10px 10px 5px #888888; /* Firefox 3.6 and earlier */ box-shadow: 10px 10px 5px #888888; } download example here . thanks.

PHP with MySQL-Create mysql connection in php

To connect php with mysql, we need a code to connect. follow the tutorial below: create a file "connect.php" edit script: <?php $host="server"; $user = "username"; $pass = "password"; $dbname = "dbname"; $conn = mysql_connect ($host, $user, $pass); if ($conn) { $conect = mysql_select_db ($dbname); if (!$conect) { die ("can't open database!"); } } else { die ("Can't connect to server"); } ?> save and run. success. thank you for this blog visit home kitprogrammer