Programming Tips & Insights

How to redirect the visitor to another page or website?

This is one of the most common tasks in website development and also one of the most frequently asked question according to some of the keyword research tools. Well, you have 3 ways to achieve a web page redirection. Use PHP header() function to modify and send a HTTP Location header: header("Location: /thankyou.html"); // redirect …

How to redirect the visitor to another page or website? Read More »

MySQL: How to change or convert MyISAM to InnoDB or vice versa?

After we have discussed the advantages and disadvantages of MyISAM and InnoDB, you might want to convert them back and forth and see the performance differences yourself. For small website, the difference may be minor but for a large popular application, MyISAM tables yield better performance results in selecting data records InnoDB tables give better …

MySQL: How to change or convert MyISAM to InnoDB or vice versa? Read More »

MySQL Engines: InnoDB vs. MyISAM – A Comparison of Pros and Cons

The 2 major types of table storage engines for MySQL databases are InnoDB and MyISAM. To summarize the differences of features and performance, InnoDB is newer while MyISAM is older. InnoDB is more complex while MyISAM is simpler. InnoDB is more strict in data integrity while MyISAM is loose. InnoDB implements row-level lock for inserting …

MySQL Engines: InnoDB vs. MyISAM – A Comparison of Pros and Cons Read More »

PHP, JavaScript: Stop and prevent others from framing your site or web page

Though it does increase traffic and the pageviews, it doesn’t feel quite good with someone who’s loading your website or page as a part of theirs in the form of a <frame> or <iframe>, leeching your content as part of theirs. To prevent them from loading your pages this way, and make the visitor browser …

PHP, JavaScript: Stop and prevent others from framing your site or web page Read More »

PHP: Session ID changes automatically at every request / page load

Ideally the initial session id will remain the same throughout a session unless the developer has explicitly asked PHP to change it by the session_regenerate_id() function or the session_id() function. However, there’s a slight chance that you may encounter this problem of automatic changing session ID upon every new request when you are developing things …

PHP: Session ID changes automatically at every request / page load Read More »

How to change the browser window status bar text of Firefox with JavaScript?

It’s strange that you can accomplish this in IE while you can’t make it happen in Firefox. Well, that’s because the development team has decided that it’s potentially annoying and harmful for web developers to change the text of Firefox status bar whatever way they want. So the simple answer is, you can’t. But there’s …

How to change the browser window status bar text of Firefox with JavaScript? Read More »

One Simple Way to Encrypt, Obfuscate, Hide or Protect Your PHP Code

This way is so simple that anyone who’s a beginner in PHP can use it immediately to obfuscate and hide the original PHP code. Generally, it’d make it much harder for someone to find a specific phrase in your code as it’s encrypted, though in a rather simple way using 4 PHP functions: gzinflate(), gzdeflate(), …

One Simple Way to Encrypt, Obfuscate, Hide or Protect Your PHP Code Read More »

MySQL: Count the Number of Records and Update the Stats Field in Another Table

I wrote this before in 2 separate posts. Actually, here’s a much better idea: use a sub query. For example, you have 2 tables, Table poets – Columns: id, poet, nation Table nations – Columns: id, nation, count Basically, nations to poets has a mapping of one to many, naturally. For example, there are 1000 …

MySQL: Count the Number of Records and Update the Stats Field in Another Table Read More »

Instantly Boost SQL Query Efficiency of REGEXP or RLIKE by 2000%

Naturally, using regular expressions for SELECT queries to check if certain text strings or text patterns are residing somewhere in large chunks of data is the most resource-intensive option and thus your last option. However it’s somehow unavoidable to practice regular expressions in the SQL queries for complicated patterns. For example, word boundaries are a …

Instantly Boost SQL Query Efficiency of REGEXP or RLIKE by 2000% Read More »

mysql command line character set option for importing SQL files encoded in UTF8

For languages other than English, especially those in Asia such as Chinese, each character takes 2 bytes in storage and needs to be encoded in UTF8 or other encoding specifically designed for it. Normally, the command line mysql database importing command has no problem with English database SQL files that are encoded in ANSI or …

mysql command line character set option for importing SQL files encoded in UTF8 Read More »

Being simple as a bless for development cost

Usefulness is the king; and it doesn’t have to be complex. One of the premium rules of project management is to never add a feature without seeing any substantial demand for it. Whatever it is, any additional feature is a burden to the system and a cost of time, both growing exponentially. While many of …

Being simple as a bless for development cost Read More »

A few suggestions of good practices for accelerating PHP development

The slow and steady may win, but the fast and steady dominate. The old saying of faster not always being better may go well in other fields, but not in the IT world of today. Faster is absolutely better. You should by all means try to improve yours or your team’s programming proficiency and accelerate …

A few suggestions of good practices for accelerating PHP development Read More »

How to Recover or Reset MySQL root Password after You Forgot and Lost It

MySQL has come with a safe mode wherein access privileges are not checked, which essentially enables you to log in anonymously to change anything in any database. And we are going to get in this safe mode to reset the lost MySQL root password. First, you need to stop the current MySQL daemon by: /etc/init.d/mysql …

How to Recover or Reset MySQL root Password after You Forgot and Lost It Read More »

Work Around Zend Studio 5.5 PHP Class / Object / Method Auto-complete Problem

Don’t know if it’s a glitch of Zend itself but I frequently encounter this problem on Windows with Zend Studio when writing PHP. Function / object methods names auto-completion saves a lot of time by suggesting candidates and a quick flyover tooltip with the synopsis, however sometimes it doesn’t work with newly created functions and …

Work Around Zend Studio 5.5 PHP Class / Object / Method Auto-complete Problem Read More »

Best JavaScript Books for Learning JavaScript Programming and Development

Thanks to the computer scientists who set the standards of JavaScript, in the arena of event programming and behavioral manipulations of windows and objects, it is the one programming script that is so powerful that you can virtually build any possible interactive applications with it. That said, learning JavaScript to the mastery of it takes …

Best JavaScript Books for Learning JavaScript Programming and Development Read More »

Best MySQL Books to Learn MySQL Database Programming and Development (+ PHP Applications)

MySQL is by far the most popular and widespread database on the entire planet. It’s used in a wide array of industries and the Web is probably the most prominent scenario, websites database. Below are some hand selected books for you to learn MySQL: both database administration and database SQL programming, for both professionals and …

Best MySQL Books to Learn MySQL Database Programming and Development (+ PHP Applications) Read More »

Scroll to Top