Archive for August, 2008

Aug 11 2008

Finding tag through regex

Published by Gaurav Mishra under programming

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];
}


2 responses so far

Aug 06 2008

Which is best web hosting for you ?

Published by Gaurav Mishra under hosting

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 :D


4 responses so far

Aug 02 2008

Correct .htaccess structure

Published by Gaurav Mishra under programming

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


No responses yet

Aug 02 2008

Some questions left unanswered, Some wishes unfulfilled

Published by Gaurav Mishra under life

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.


No responses yet

« Prev

FireStats icon Powered by FireStats