Archive for the 'programming' Category

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

One response 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 [...]

No responses yet

Jun 05 2008

Yav — Javascript Validation tool

Published by Gaurav Mishra under programming

I have been following cakephp framework for any new development that i do, But since now and then you come along some fixing work for old scripts.
I hate really fiddling with javascript for cross-browser issues everytime i use them, After starting through frameworks finally i got common sense of not re-inventing wheel again and again [...]

2 responses so far

May 30 2008

Running smarty on shared hosting

Published by Gaurav Mishra under programming, web

Just needed to install and make ready smarty for a small project, Was thiking of again going to official howto when i stumbled to a very nice “For dummies” article for putting smarty out of box http://tinyurl.com/5py5o8
Nice work dude.

No responses yet

FireStats icon Powered by FireStats