Recently I was facing problem on restoring database with a lot of data into MYSQL using phpMyAdmin. The restoring process keeps interrupted due to the connection between browser and server time's timeout and also due to the timeout in PHP script. Only partial data is restored and I kept dropping the database, increase PHP timeout, increased memory limit, and tried to restore … [Read more...]
PHP: How to Protect Password in Database – Password Hashing
If you are a programmer, you may have developed applications that store users or your customers' information in database. How to store users' or customers' sensitive data (especially password) might be an issues for most programmer. How do you ensure and convience that your users or customers' password are actually secured? … [Read more...]
PHP: Format integer into number of decimal places
Previous I have written an article about formating interger into number of decimal places in Java. The main reason to store money value in integer in to prevent loss in precision. For example the actual value for 12.33 in float could be 12.3333333333...; while 1233 in integer is always 1233. Today I will be showing you the same code but in PHP language. I know you can do the … [Read more...]
PHP: session_start() – No such file or directory error
Have you encountered the following PHP error (or something similar) before in your Windows Vista? Warning: session_start() [function.session-start]: open(C:\Users\YOURNAME\AppData\Local\Temp\php\session\sess_ficdel21e6lupsojqdk62ofts5, O_RDWR) failed: No such file or directory (2) in C:\webapp\folder\index.php on line 24 The solution to the above error is really simple. … [Read more...]
PHP: Short URL Algorithm Implementation
Few months ago, I introduced a simple algorithm that allow users to implement their own short URL into their system. Today, I have some spare time so I decided to write the short URL algorithm's implementation in PHP. At first, we define a function called shorturl() that receives a URL as the input and returns an array that contains 4 hashed values (each 6 … [Read more...]