Tampilkan postingan dengan label trik. Tampilkan semua postingan
Tampilkan postingan dengan label trik. Tampilkan semua postingan

Senin, 24 Juni 2013

Convert Date Format to YYYY-MM-DD with PHP

Tidak ada komentar:

How Convert Date Format to YYYY-MM-DD with PHP


$date = "07/12/2010";
$your_date = date("Y-m-d", strtotime($date));

Senin, 12 November 2012

How to Detect Browser Internet Explorer with PHP

Tidak ada komentar:

How to Detect Browser Internet Explorer with PHP


You know, if you are website programmer or website designer you will understand why so important to detect Internet Explorer browser, cause generaly this browser have different treatment  in processing html, css and javascript. So maybe you need different page for this browser.
So this is PHP script will help you for detect Internet Explorer Browser or not.

<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], '(compatible; MSIE ')!==FALSE) {
   //action for internet explorer
   header('location:form-ie.php?idu='.$_GET['idu']);  
} else {
      //action for other browser
header('location:form.php?idu='.$_GET['idu']);
}


Rabu, 07 November 2012

Handling Event Window Close or Reload With jQuery

Tidak ada komentar:

Handling Event Window Close or  Reload With jQuery

         When we want to know that the user will leave the pages of the website, we need a trigger that can be used as a reference to determine the user has left the website pages.
There are some conditions in which the user can leave the web page:

- Refresh or reload page
- Back to previous page
- Close page

example with javascript:
window.onunload=function(){SomeJavaScriptCode};

example with jquery
$(window).unload(function() {
    //some javascript code
}

Some Problem :
onUnload only working on Firefox , Internet Explorer and Opera

Minggu, 03 Juni 2012

Can't Running Microsoft Office Powerpoint with Wine on Linux

Tidak ada komentar:
Can’t Running Microsoft Office Powerpoint on Wine


After i do installation Microsoft office 2007 with Wine on my Linux Ubuntu, all looks very good, but when i running Powerpoint it can't.
and i do it for fix it:




  1. open Wine configuration  ” winecfg
  2. Make sure that the Windows Version is set to Windows XP (Applications Tab).
  3. In the Libraries section, you need to add two overrides: “riched20” and “usp10”. To do this, simply type the the names (no quotes) into the dropdown-looking textbox, and click “Add”. Repeat this for both of the overrides, and you are done!
  4. do it : ” - wget http://www.kegel.com/wine/winetricks”  ”- chmod +x winetricks
  5. Run (and change prefix if need be): “./winetricks vcrun2005

Minggu, 11 Desember 2011

Get Date Yesterday in PHP

Tidak ada komentar:
 How to get date of yesterday in php ??
$yesterday = date("Y-m-d",strtotime("-1 day"));

echo $yesterday;

Kamis, 24 November 2011

How To Insert and View Vietnam Font To Mysql And PHP

Tidak ada komentar:
Later I 've got problem with Vietnam Font when I insert Vietnam font on my web, can't save on Mysql, then i change colation with utf8_general_ci


ALTER TABLE `table-name` CHANGE  `table-name`. `field_name` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL

Jumat, 18 November 2011

PHP Error Logging Reporting Handler

Tidak ada komentar:
PHP Error, Logging, Reporting and Handler 


1. error_get_last()
example:
echo $testing;print_r(error_get_last());?>
Output :
Array([type] => 8[message] => Undefined variable: testing[file] => C:\webfolder\test.php[line] => 2)



2. error_log(error,type,destination,headers)
ParameterDescription
errorRequired. The error message to log
typeOptional. Specifies the error log type.
Possible log types:
  • 0 - Default. The error is sent to the servers logging system or a file, depending on how the error_log configuration is set in the php.ini file
  • 1 - The error is sent by email to the address in the destination parameter. This message type is the only one that uses the headers parameter
  • 2 - The error is sent through the PHP debugging connection. This option is only available in PHP 3
  • 3 - The error is added to the file destination string
destinationOptional. Specifies where to send the error message. The value of this parameter depends on the value of the "type" parameter
headersOptional. Only used if the "type" parameter is "1". Specifies additional headers, like From, Cc, and Bcc. The additional headers should be separated with a CRLF (\r\n).Note: When sending an email, it must contain a From header. This can be set with this parameter or in the php.ini file.
example:
$test=2;
if ($test>1){error_log("A custom error has been triggered",1,"someone@example.com","From: webmaster@example.com");}?>
Output:
A custom error has been triggered


3. error_reporting(report_level)
ValueConstantDescription
1E_ERRORFatal run-time errors. Errors that can not be recovered from. Execution of the script is halted
2E_WARNINGNon-fatal run-time errors. Execution of the script is not halted
4E_PARSECompile-time parse errors. Parse errors should only be generated by the parser
8E_NOTICERun-time notices. The script found something that might be an error, but could also happen when running a script normally
16E_CORE_ERRORFatal errors at PHP startup. This is like an E_ERROR in the PHP core
32E_CORE_WARNINGNon-fatal errors at PHP startup. This is like an E_WARNING in the PHP core
64E_COMPILE_ERRORFatal compile-time errors. This is like an E_ERROR generated by the Zend Scripting Engine
128E_COMPILE_WARNINGNon-fatal compile-time errors. This is like an E_WARNING generated by the Zend Scripting Engine
256E_USER_ERRORFatal user-generated error. This is like an E_ERROR set by the programmer using the PHP function trigger_error()
512E_USER_WARNINGNon-fatal user-generated warning. This is like an E_WARNING set by the programmer using the PHP function trigger_error()
1024E_USER_NOTICEUser-generated notice. This is like an E_NOTICE set by the programmer using the PHP function trigger_error()
2048E_STRICTRun-time notices. PHP suggest changes to your code to help interoperability and compatibility of the code
4096E_RECOVERABLE_ERRORCatchable fatal error. This is like an E_ERROR but can be caught by a user defined handle (see also set_error_handler())
8191E_ALLAll errors and warnings, except level E_STRICT (E_STRICT will be part of E_ALL as of PHP 6.0)
example:
//Disable error reportingerror_reporting(0);
//Report runtime errorserror_reporting(E_ERROR | E_WARNING | E_PARSE);
//Report all errorserror_reporting(E_ALL);?>


4. restore_error_handler()
example:
//custom error handler functionfunction customError($errno, $errstr, $errfile, $errline)  {  echo "Custom error: [$errno] $errstr
";
  echo " Error on line $errline in $errfile
";
  }
//set user-defined error handlerset_error_handler("customError");
$test=2;
//trigger errorif ($test>1)  {  trigger_error("A custom error has been triggered");  }
//restore built-in error handlerrestore_error_handler();
//trigger error againif ($test>1)  {  trigger_error("A custom error has been triggered");  }?>
Output
Custom error: [1024] A custom error has been triggeredError on line 14 in C:\webfolder\test.php
Notice: A custom error has been triggered in C:\webfolder\test.php on line 21

Senin, 14 November 2011

Useragent Addon for Browser Firefox

Tidak ada komentar:
Useragent Addon for Browser Firefox


If u want check for view of your web or wap on some device or other browser u can using some addon in   Firefox like User Agent Switcher or UAControl.


User Agent SwitcherThe User Agent Switcher extension adds a menu and a toolbar button to switch the user agent of a browser.install addon user agent switcher for firefox hereDownload xml device list here




UAControllerUser agent switcher addon changes the user agent globally (for every site). If you want to just change the user agent on a site-by-site basis, install the UA Control addoninstall addon user agent switcher for firefox here

Rabu, 09 November 2011

How to Disappear Home Button in Blogspot

Tidak ada komentar:

Please folow the instruction bellow :
1.  Log In to your blogger account
2. select layout design then Edit HTML
3. Do not forget to download the full template first, in case there is an error
4. check Expand Template Widget
5. Search Code bellow :
to make easy push Ctrl+F then entring thas code and ENTER.
6. when u found it delete and save
7. Done
---------------------------------------------------------------------------------------------------------
Silahkan ikuti petunjuk di bawah ini :
1. Seperti biasa Log In dulu ke akun blog
2. Pilih Rancangan lalu pilih Edit HTML
3. Jangan lupa download template lengkap dahulu, berjaga-jaga bila ada kesalahan
4. Centang Expand Template Widget
5. Carilah Kode di bawah ini :
Untuk memudahkan pencarian Tekan Ctrl+F lalu masukkan kode di atas dan tekan ENTER.
6. Setelah ketemu tinggal hapus kodenya. lalu klik Simpan Template
7. Selesai

Sabtu, 05 November 2011

Where IDM Stores Download Temporary Files

Tidak ada komentar:
Where IDM Stores Download Temporary Files ??


Im Using IDM for download files, and sometime when my download progres only few minute and.. thats stoped mybe bcause internet connection or download server and it can't resume, thats so bad :(

and i don't want lose  parts that have been downloaded


if u using windows 7 u can find your download temp files on :
C:\Users\AppData\Roaming\IDM\DwnlData

Selasa, 01 November 2011

Cara Cek Pulsa Operator Indonesia

Tidak ada komentar:
Cara Cek Pulsa

Berikut ini nomor untuk cek pulsa untuk masing-masing operator.
Simpati (0812, 0813, 0811)
Cek pulsa *888#

As (0852, 0853)
Cek pulsa *888#

Mentari (0815, 0816, 0858)
Cek Pulsa *555#
Paket SMS, GPRS *555*1#

Im3 (0856, 0857)
Cek Pulsa *388#
Paket SMS, GPRS *388*1#

XL (0817, 0818, 0819, 0859, 0878)
Cek Pulsa *123#

Three (0896, 0897, 0898, 0899)
Cek pulsa *111#

Axis (0831, 0838)
Cek Pulsa *888#

Fren (0885, 0886, 0887, 0888)
Cek Pulsa 999

Smart (0881, 0882, 0883, 0884)
Cek Pulsa *999*

Flexi
Cek Pulsa *99#

Star One
Cek Pulsa *555#

Esia
Cek Pulsa *955

Hepi
Cek Pulsa 999

Minggu, 09 Oktober 2011

Disable / Enable Flashdrive on Windows 7

Tidak ada komentar:
How to Disable or Enable Flashdrive or Flashdisk on Windows 7


Start  >>  Control Panel  >> Hardware and Sound






Click Device Manager



Then Click Right on USB Mass Strorage Device and Click Disable / Enable


Sabtu, 24 September 2011

Posting HTML Code to Blog

4 komentar:
using this web http://centricle.com/tools/html-entities/ for encode and decode your HTML Code..

Random PHP Code with Capital, Text and Number

Tidak ada komentar:

<?php
function createRandomPassword($long=4) {
    $charsL = "abcdefghijklmnopqrstuvwxyz";
$charsU = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$int = "0123456789";
    srand((double)microtime()*1000000);
    $i = 1;
    $pass = '' ;
$randStart = rand(1,3);
    while ($i <= $long) {
   
if ($randStart == 1){
$num = rand() % 26;
$tmp = substr($charsL, $num, 1);
}
if ($randStart == 2){
$num = rand() % 26;
$tmp = substr($charsU, $num, 1);
}
if ($randStart == 3){
$num = rand() % 10;
$tmp = substr($int, $num, 1);
}
        $pass = $pass . $tmp;
if ($randStart <= 2 )
$randStart = $randStart +1;
else
$randStart = $randStart -2;
        $i++;
    }
    return $pass;
}
echo createRandomPassword();  // 

Rabu, 21 September 2011

Intalasi ActiveMQ pada Ubuntu

Tidak ada komentar:
bisa di download di http://activemq.apache.org/download.html
copy folder activemq ke /opt/chmod 777 folder activemq
sudo /opt/activemq/bin/activemq start

akses http://localhost:8161/admin/ pada browser






Senin, 19 September 2011

Extract file using terminal

Tidak ada komentar:
FOR .tar file
----------------------------------------------------------------------
sudo tar xf /your/file/path /extration/path/here

or if the archive is on the path where you are right now:

sudo tar xf ./file_name.tar







For .rar file
----------------------------------------------------------------------
pastikan anda telah menginstall .rar
retnet@retnet:~$ sudo apt-get install unrar rar


----------------------------------
retnet@retnet:$ unrar x testing.rar UNRAR 3.90 beta 2 freeware Copyright (c) 1993-2009 Alexander Roshal Extracting from testing.rar Extracting testing.txt OK Extracting Testing-lagi1.txt OK Extracting Testing-lagi2.txt OK All OK retnet@retnet:$

Jumat, 16 September 2011

Ubuntu Linux Start / Restart / Stop Apache Web Server

Tidak ada komentar:

Task: Start Apache 2 Server

# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start

Task: Restart Apache 2 Server

# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart

Task: Stop Apache 2 Server

# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop

Minggu, 21 Agustus 2011

25 Shortcut Ubuntu yang cukup Berguna

Tidak ada komentar:

1 Win + E - Menunjukkan semua ruang kerja dengan cara yang bagus dan memungkinkan Anda beralih di antara ruang kerja dengan mudah.

2 Alt + Ctrl + Kiri / kanan Arrow - Pindah ke Workspace di Kiri / Kanan

3 Alt + Ctrl + Shift + Kiri / kanan Arrow - Pindah jendela aktif ke workspace lain

4 Alt + Shift + Up Arrow -. Ini memulai mencari antarmuka jendela keren switcher dengan mana Anda dapat beralih di antara jendela dengan menggunakan tombol panah sambil memegang Alt + Shift



5 Alt + F9/F10 -. Minimalkan / Maksimalkan jendela aktif


6 Alt + F5 -. UnMaximizes Jendela Lancar


7 Alt + F7 -. Shortcut ini akan mengaktifkan opsi memindahkan jendela yang memungkinkan Anda memindahkan jendela saat ini menggunakan tombol panah. Anda bahkan dapat memindahkan jendela ke ruang kerja lainnya, coba pindah ke kanan ekstrim.


. 8 Alt + F8 - Mengubah ukuran jendela saat ini dengan tombol panah


9 Ctrl + Alt + D - Show Desktop / Restore jendela terbuka jika desktop yang digunakan menunjukkan sebelumnya


10 Alt + Shift + Tab - Berpindah Windows di Balik Arah seperti yang dilakukan menggunakan Alt + Tab


11. Shift + Ctrl + N - Create New Folder, shortcut Sangat berguna


12 Alt + Enter -. Tampilkan properti dari file yang dipilih / folder tanpa memerlukan untuk klik kanan padanya dan pilih Properties.


13 Ctrl + 1 / 2 - Ubah folder tujuan untuk ikon / daftar..


14. Ctrl + W - dekat saat Nautilus Jendela


15 Ctrl + Shift + W -. Tutup semua terbuka Nautilus Windows


16. Ctrl + T - Buka tab baru di Nautilus


17 Alt + Up / Down Arrow - Pindah ke Folder Parent / folder Terpilih


18 Alt + Kiri / Kanan Arrow - Pindah Kembali / maju di Nautilus


19 Alt + Home - Pindah langsung ke Home Folder Anda


20 F9 - menampilkan Beralih dari Nautilus Sidepane.


21 Ctrl + H - Layar Beralih dari file dan folder tersembunyi


22 Ctrl + Alt + L - Cepat pintas untuk Mengunci Layar jika Anda perlu untuk berada jauh dari desktop Anda untuk beberapa saat dan tidak ingin orang lain untuk melihat desktop Anda.


24 Alt + F2 - Buka Kotak dialog Jalankan Aplikasi


23 Alt + F1 - Buka menu Aplikasi


25 Win + roda mouse - Perbesar / Perkecil Desktop.. Yang satu ini cukup berguna jika Anda memiliki keyboard nirkabel / mouse.

Sabtu, 20 Agustus 2011

Skema Warna untuk Netbeans mirip Gvim

Tidak ada komentar:

Mungkin hanya beberapa programer yang mengenal text Editor Gvim, saya juga baru mengenal text editor ini, dan saya langsung menyukainya, salah satu hal yang membuat saya menyukai text editor ini adalah tampilan skema warnanya yang sangat menarik.
Namun dari kekurangan fungsi gvim, saya masih tetap menggunakan netbeans, tapi yang saya inginkan memiliki tampilan skema warna yang sama seperti gvim untuk netbeans saya... dan akhirnya saya temukan..
berikut link download untuk skema warna untuk netbeans yang bernama desert