Aug
11
2008
I am saving this for my reference , A post with all commonly used regex, first one to go is finding <img> tag through php using regex.
$pattern = ‘/<img[^>]+src[\\s=\'"]‘;
$pattern .= ‘+([^"\'>\\s]+)/is’;
if(preg_match($pattern,$subject,$match))
{
echo $match[0];
}
Tags: php, regex
Aug
06
2008
Most of my readers know that i started my career as a web hosting guy, Selling hosting and domain names. Hosting and domain flipping still remains my favorite past time, And i research a lot, Lately i was not able to answer all my friend queries for hosting queries so trying to sum up , What i think is best and have used personally or used for some of clients some or other time.
Small usage :-
Usually we don`t get good enough hosting companies when we need small hosting space and quick support.
This is the space that i started to fill once i started my career as a hosting provider, We all don`t need 100 or 1000 GB space, Most of the time we need few 100 mb space.
For this my all time recommendation is www.hostcurry.com , For some obvious reasons.
1. I owned the servers , so you can bug me anytime on any problem.
2. We are not oversized as we are very limited to people whom we give hosting.
Medium usage:-
This usage comes under once you need few Gb`s and a shared hosting plan , i.e your usage doesn`t cross 50 thousand users per day. Go for hostgator
Large Usage:-
Contact me 
Tags: hostcurry, hosting
Aug
02
2008
Usually we all get very greedy while making our url structure using .htaccess
For example, This will not work as you think
RewriteRule ^(.*)/$ category/categories.php?cat=$1 [L,QSA]
RewriteRule ^(.*)/(.*)/$ category/categories.php?cat=$1&name=$2 [L,QSA]
This will not work as after first rewrite will write , the current url structure will change to www.mydomain.com/<something>, Which will result to the last rewrite rule to be implemented after current url structure , i.e www.mydomain.com/<something>/ , Which is different from origianl structure www.mydomain.com. This can also result in loss of images as they are on relative path
RewriteRule ^([^/]+)/$ category/categories.php?region=$1 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/$ category/categories.php?cat=$1&name=$2 [L,QSA]
My two cents
Tags: apache, php
Aug
02
2008
Alone in the dark, A boy was standing
looking at the world, Trying to understand.
What they mean, Why i am like this. But…
No replies, No hands, No faces.
Tags: life