Generating a simple jquery popup

Recently I needed to make a simple pop up box in wordpress and I searched for plugins to achieve what I wanted but failed. Well, if you look for it, you will surely find many plugins for jquery popup as well as wordpress popup but none helped me. In my lookout for the plugin I found this really cool and simple script that would do the required work for you with just simple tweaks.

Demo: Click me.

Continue reading “Generating a simple jquery popup”

Increase PHP Script Execution Time Limit

Every once in a while I need to process a HUGE file. Though PHP probably isn’t the most efficient way of processing the file, I’ll usually use PHP because it makes coding the processing script much faster. To prevent the script from timing out, I need to increase the execution time of the specific processing script. Here’s how I do it.

ini_set('max_execution_time', 60); //60 seconds = 1 minutes

Place this at the top of your PHP script and let your script loose!

Turn off gmail ads or web clips

Gmail by default shows ads also called web clips above the list of emails. It’s easy to switch these off but they’re not intuitively named when looking at Gmail’s settings. This post shows how to switch them off.

To remove the web clips, click the settings cog icon above-right from the message list. This will show a drop down menu where you can select the Settings option.

On the next page along the top of the settings are a series of tabs/options. Open the Web Clips tab and uncheck the Show my web clips above the Inbox checkbox. You don’t need to click a button to save, it immediately takes effect.

Now go back to your inbox and there are no longer any ads above the message list.

MYSQL next increment value or last inserted value

Getting the next auto increment value and last inserted value from a mysql table are both two different things and should not be confused with one another. Next increment value should be the next id to be inserted and last inserted value is the last id inserted. Sometimes I see programmers using former code to get the latter task done and vice-versa. That might do it in some cases, but in the long run will surely fail.

Correct way of getting the value of next to be inserted id, is:

$query_autoinc 		= "SHOW TABLE STATUS LIKE 'table'";
$exec_autoinc 		= mysql_query($query_autoinc);
$row_autoinc 		= mysql_fetch_assoc($exec_autoinc);
$next_insert_id 	= $row_autoinc['Auto_increment'];

Continue reading “MYSQL next increment value or last inserted value”