Posts

Showing posts from September, 2012

How to extract or fetch urls from text in PHP?

How to show url as a link from a text in php. this code will return you the link from a text . simply copy and paste this in you php file and call the function.  <?php             function make_clickable_string_url($text) {             return preg_replace_callback(             '#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#',             create_function(             '$matches',             'return "<br/><a href=\'{$matches[0]}\'>{$matches[0]}</a>";'             ),             $text             );             }         ?> it will return you the string as well as return a link of url which exist in content

How can I to search in mysql within a table of comma-separated values?

I have a MySQL table which contains comma-separated values like 2,4,56,125 and i want to search record which have a particular value. so how can i search in mysql  simple copy and paste this code in your table and change your table name and field name and search keyword. SELECT * FROM table WHERE FIND_IN_SET(search_keyword , field_name)  like SELECT * FROM tbl_font WHERE FIND_IN_SET(2,cat_id)

How to use 301 url redirect in magento via htacess?

Make a .htaccess file on root of your magento paste this code on this file and change path of site..... <IfModule mod_rewrite.c> DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|media|skin|js|robots\.txt) RewriteRule ^typefaceselection.aspx$ /insignedesigncom/index.php/$1 [R=301,L] RewriteRule ^contact.aspx$ /insignedesigncom/index.php/contacts/$1 [R=301,L] RewriteRule ^thankyou.aspx$ /insignedesigncom/index.php/thankyou.aspx/$1 [R=301,L] </IfModule>

How to create custom script to convert ttf, otf or font file to png image via image magic script?

Image
Please check that image magick must be install on your server please note  /usr/bin/convert this path could be change which is define below of script to find out the path of image magick make a new php page and paste this code on this page <?php echo "<pre>"; system("type convert"); echo "</pre>"; ?> and run the page and can check that path is right or not if path is changed so please change the path from  /usr/bin/convert this path Create custom script to convert ttf, otf or font file to png image via image magic script? this script will generate the image of ttf ,otf, .pfm , pfb or font file. simply copy and paste this code on your browser. <?php set_time_limit(0); ini_set('max_execution_time', 0); if($_SERVER['HTTP_HOST']=="localhost") { $DB["dbName"] = "fontxs"; $DB["host"] = "localhost"; $DB["user"] = "root";

How to add jQuery email validation in my site?

Image
I want to add jQuery email validation in my site which is good looking also simply copy and paste this code for add jQuery email validation for your site <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1.7.1"); </script> <script type="text/javascript">     $(document).ready(function(){         try {         var domains =['hotmail.co.uk','yahoo.co.uk','yahoo.com.tw','yahoo.com.au','yahoo.com.mx','gmail.com','hotmail.com','yahoo.com','aol.com','comcast.net','msn.com','seznam.cz','sbcglobal.net','live.com','bellsouth.net','hotmail.fr','verizon.net','mail.ru','btinternet.com','cox.net','yahoo.com.br','bigpond.com','att.net',

How to remove index.php from Codeigniter URL or .htaccess and codeigniter not working?

After  after visiting so many sites  article i solve this problem that why its not working with index.php or why sub page links are not working without index.php I think all article has same copy and paste code on their website that's why you are wondering here and there ... try this code i think this will definitely work for you if your site is uploaded on root of website than open you htaccess from you root and paste this code on you htaccess Options +FollowSymLinks All -Indexes Options All -Indexes DirectoryIndex index.php RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] if your site is inside in sub-folder of any site like www.site.com/yoursitefolder/ so you have to paste this code on your htaccess file of your codeigniter site Options +FollowSymLinks All -Indexes Options All -Indexes DirectoryIndex index.php RewriteEngine on RewriteBase /yoursitefolder Rewrit

How can i remove 24X7 customer service image in magento?

Follow the path which is define below You need to comment all code in app/design/frontend/Your theme/default/template/callouts/left_col.phtml file now refresh the cache and check its works pefectly :)

How to Show or Hide File Extensions in window 7 or window xp?

Image
How to Show or Hide File Extensions in window 7 or window xp? This is main problem that you can not see the extension of file in operating system on window wista and window 7 and you can not change the extension by rename the file. For window 7 open any folder press alt button a top navigation will show on top. Click on tools as image shows below 1. Click on folder option 2. Click on View Tab 3. Click Show or hide file extensions . 4. In the Folder Options box that appears, clear the checkbox next to Hide extensions for known file types , then click OK .