Archive for the ‘PHP’ tag
Contoh Stored Procedure MySQL
Apakah itu stored procedure MySQL? Secara singkat saja, stored procedure adalah sebuah function yang tersimpan di MySQL. Seperti layaknya sebuah function pada bahasa pemrograman lain, sebuah function bisa terdiri dari lebih dari satu baris, bermacam-macam operasi di dalamnya, mengandung variabel, dan lain-lain.
Read the rest of this entry »
Get Today Timestamp on PHP
To get today timestamp on PHP (for example now is 2 Januari 2009, 13:32), you want to get timestamp of 2 Januari 2009, 13:32, you can get it by this PHP code
<?php $time = strtotime('Today'); ?>
Very simple with strtotime
Download File On PHP
To download page (or file) by PHP, you can add this header to the page.
On PHP, you can use this function
header('Content-Disposition: attachment; filename="SOMETHING.HTML"');
On other web programming, you can use other function. The basic idea is by adding this header
Content-Disposition: attachment; filename="SOMETHING.HTML"
Check Your Bandwidth Speed
Actually, i use the resource from SpeedTest.net, but you can check your bandwidth speed width the mini version here. Your browser must support flash and has javascript enabled.
Read the rest of this entry »
Upgrade Your Script Automatically
Usually, most of your online script have to be updated regularly such as your online WordPress installation or other installation.

Usually, we download the script from the script download site to our local computer, and we upload it to our server.
Sometimes, it’s frustrating because the file is relatively big and we have to upload it from our local computer to our local server manually.
Now we don’t need to download it to our local computer and upload it manually.
Read the rest of this entry »
Animated Captcha
I’ve uploaded it somewhere, but here, you can get the official animated captcha

Country IP Blocking
If you run a proxy, you may want to block visitors that are from some countries, based from their IP address. And i will tell you how to do this with a little bit of PHP programming (just a simple one, believe me
)
Preg or Ereg ?
For PHP programmers, if you want to work with regular expression, you have two choices. You can use “preg” (preg_match, preg_match_all, preg_replace, etc), or “ereg” (ereg, eregi, ereg_replace, etc).
Which one should you use?
PHP Regular Expression Flags
Here is a case. You have “abc[def]xxx[123a]zzz”.
You want to remove everything inside the square brackets [ ].
What regular expression you should use?
Read the rest of this entry »
PHP Random Characters
Here is a small PHP code if you want to generate random character fast.