Yesterday, I showed you how you can keep local installation of phpmyadmin from logging you out every few minutes. I took one more step and edited configuration to not ask me username, password at all. Now phpmyadmin never asks me for mysql username and password. Keep in mind if you follow this tutorial anyone would be able… Continue reading [HowTo] Stop phpmyadmin from asking username, password in localhost
Category: php
[HowTo] Extend phpmyadmin session expiration time
Recently, I got frustrated being logged out every few minutes (24 minutes, to be precise) from phpmyadmin on my localhost. I make some db changes, write some code and when I get back to phpmyadmin, I would see my session had expired. To fix this, I changed the configuration so that my session would expire… Continue reading [HowTo] Extend phpmyadmin session expiration time
[HowTo] Remove admin bar from wordpress 3.1
The new admin bar in wordpress 3.1 is one good feature to have but sometimes its unwanted. For example you might already have some other kind of top bar with which admin bar may interfere. You can remove the admin bar by putting the following code in /wp-content/YOURTHEME/functions.php: if(function_exists(‘show_admin_bar’)){ show_admin_bar(false); }
[HowTo] Check your php and server information using phpinfo()
We can check the php configuration, apache’s loaded modules and all other kinds of PHP configuration using a simple function called phpinfo(). Create a file called infophp.php in your web’s root directory and put the following code in it: <? phpinfo(); ?> This would output all the php configuration info and apache information. You can… Continue reading [HowTo] Check your php and server information using phpinfo()
[HOWTO] Validate Email-address in PHP using Regular expressions (the correct way)
Here’s a function which thoroughly checks email-address and returns true for a valid email address and returns false for invalid one. I thought it was worth sharing so I posted it on my blog. You will find the source link at the bottom. 1 2 3 4 5 6 7 8 9 10 11 12… Continue reading [HOWTO] Validate Email-address in PHP using Regular expressions (the correct way)
[HOWTO] Use local phpmyadmin with remote MySQL
My host recently started allowing remote connections to its mysql database. It was a really useful feature – I could not change database settings from my own computer. Since it started allowing remote connections from my IP, I could use any mysql client to connect to it. I fired up terminal and tried to connect… Continue reading [HOWTO] Use local phpmyadmin with remote MySQL
[SOLVED] Flush(), ob_flush() not working in PHP (Disabling gzip through htaccess)
Flushing the output buffer doesn’t works in PHP sometimes no matter what you do. I had this code which would never work on my server but would perfectly fine on localhost. This was the code. <?php include(‘common.php’); ini_set(‘output_buffering’,’on’); ini_set(‘zlib.output_compression’, 0); //ini_set(‘implicit_flush’,1); ob_implicit_flush(); for($i=0;$i<10;$i++) { echo $i; echo str_repeat(” “, 500); ob_flush(); flush(); sleep(1); } ?>… Continue reading [SOLVED] Flush(), ob_flush() not working in PHP (Disabling gzip through htaccess)
Missing alphabet check (is_alpha) in PHP
Well, you might have seen a huge number of variable checks ranging from is_file(), is_array() to is_numeric() and is_int(). While developing a script today I wanted to check for alphabets. I directly used is_alpha() but to my surprise it wasn’t defined. I researched more into the matter and found ctypealpha() does precisely the same thing.… Continue reading Missing alphabet check (is_alpha) in PHP
Using CodeIgniter’s Email library separately
I’ve developed my own libraries for rapid development of PHP applications. Email library is one area which I didn’t feel like developing a library for. Just then, I remembered how simple and robust CodeIgniter’s Email class was. I decided to try it on my own script. It was not at all difficult to get it… Continue reading Using CodeIgniter’s Email library separately