Archive for the ‘PHP’ Category

Setting Up a MemCached Server

memcached

image from www.memcached.org Based on their official website memcached is defined as: Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many [...]

Continue Reading

No Comments

Use Gmail Account To Relay Email From PHP mail Function

Localhost Mail

One of the things I find hard in developing a web application is using a library for sending email such as PHPMailer. I find it hard when used to send emails. Another thing I find hard is when sending emails in a localhost webserver. It would also cost me more and would take much time in setting up my own mail server. PHP’s mail function is also very useless in such testing ground. If you are using a gmail account [...]

Continue Reading

1 Comment

PDO Database Extensions Error

Drupal Logo

    I installed Apache, MySQL and PHP on windows 7.  I tried to install drupal version 7.9 and went through an error as shown in the image below: The error “Your web server does not appear to support any common PDO database extensions.” can be fixed by following these steps: Open your php.ini file Around line 966 uncomment the line “extension=php_pdo_mysql.dll” Make sure you have php_pdo_mysql.dll on your ext folder or download it here php_pdo_mysql Restart Apache and you can [...]

Continue Reading

No Comments

Website Virus (ncoyrl.htm, zcv.gif and iframe)

With millions of websites in search engines we can never be sure that the sites we are visiting are not harmful.  Some search engines like Google helps us detect websites that can cause harm to out computer.  Some search engines do not have this feature which makes us vulnerable to to exploit attacks especially for those that are webmasters.  We must always make sure that we have computer protection such as anti spyware or even the basic antivirus software which can be [...]

Continue Reading

No Comments

Simple PHP Date Function

PHP has a function date where you can specify different ways on how to display the date.  How do you generate current date and display only month and date like ‘September 2010′.  Here is a simple php howto, The code above will simply output September 2010, a simple code that will surely help you especially when coding PHP from scratch. Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments [...]

Continue Reading

No Comments

Slackware PHP GD Error

In the past months I was able to handle a LAMP server, this is my second time to handle a UNIX based web server but this time its a lot different because I will will be the one to install and configure the web server.  Our System administrator was the one who installed the latest version of slackware which is 13.1 on the machine, so all I need to do is have the web server up and running. Our system [...]

Continue Reading

No Comments

Getting Main Domain

Do you want to extract the main domain of a URL?  Here is a function that works well and can be modified easily.  I found this function while searching for a good Regular Expression to fulfill such result. {code type=php}<?php function get_base_domain($url)  { $debug = 0; $base_domain = ”; $G_TLD = array( ‘biz’,'com’,'edu’,'gov’,'info’,'int’,'mil’,'name’,'net’,'org’,'aero’,'asia’,'cat’,'coop’,'jobs’,'mobi’,'museum’, ‘pro’,'tel’,'travel’,'arpa’,'root’,'berlin’,'bzh’,'cym’,'gal’,'geo’,'kid’,'kids’,'lat’,'mail’,'nyc’,'post’,'sco’,'web’,'xxx’, ‘nato’,'example’,'invalid’,'localhost’,'test’,'bitnet’,'csnet’,'ip’,'local’,'onion’,'uucp’, ‘co’ ); // country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain) $C_TLD = array( ‘ac’,'ad’,'ae’,'af’,'ag’,'ai’,'al’,'am’,'an’,'ao’,'aq’,'ar’,'as’,'at’,'au’,'aw’,'ax’,'az’, ‘ba’,'bb’,'bd’,'be’,'bf’,'bg’,'bh’,'bi’,'bj’,'bm’,'bn’,'bo’,'br’,'bs’,'bt’,'bw’,'by’,'bz’, ‘ca’,'cc’,'cd’,'cf’,'cg’,'ch’,'ci’,'ck’,'cl’,'cm’,'cn’,'co’,'cr’,'cu’,'cv’,'cx’,'cy’,'cz’, ‘de’,'dj’,'dk’,'dm’,'do’,'dz’,'ec’,'ee’,'eg’,'er’,'es’,'et’,'eu’,'fi’,'fj’,'fk’,'fm’,'fo’, ‘fr’,'ga’,'gd’,'ge’,'gf’,'gg’,'gh’,'gi’,'gl’,'gm’,'gn’,'gp’,'gq’,'gr’,'gs’,'gt’,'gu’,'gw’, ‘gy’,'hk’,'hm’,'hn’,'hr’,'ht’,'hu’,'id’,'ie’,'il’,'im’,'in’,'io’,'iq’,'ir’,'is’,'it’,'je’, ‘jm’,'jo’,'jp’,'ke’,'kg’,'kh’,'ki’,'km’,'kn’,'kr’,'kw’,'ky’,'kz’,'la’,'lb’,'lc’,'li’,'lk’, ‘lr’,'ls’,'lt’,'lu’,'lv’,'ly’,'ma’,'mc’,'md’,'mg’,'mh’,'mk’,'ml’,'mm’,'mn’,'mo’,'mp’,'mq’, ‘mr’,'ms’,'mt’,'mu’,'mv’,'mw’,'mx’,'my’,'mz’,'na’,'nc’,'ne’,'nf’,'ng’,'ni’,'nl’,'no’,'np’, ‘nr’,'nu’,'nz’,'om’,'pa’,'pe’,'pf’,'pg’,'ph’,'pk’,'pl’,'pn’,'pr’,'ps’,'pt’,'pw’,'py’,'qa’, ‘re’,'ro’,'ru’,'rw’,'sa’,'sb’,'sc’,'sd’,'se’,'sg’,'sh’,'si’,'sk’,'sl’,'sm’,'sn’,'sr’,'st’, ‘sv’,'sy’,'sz’,'tc’,'td’,'tf’,'tg’,'th’,'tj’,'tk’,'tl’,'tm’,'tn’,'to’,'tr’,'tt’,'tv’,'tw’, ‘tz’,'ua’,'ug’,'uk’,'us’,'uy’,'uz’,'va’,'vc’,'ve’,'vg’,'vi’,'vn’,'vu’,'wf’,'ws’,'ye’,'yu’, ‘za’,'zm’,'zw’,'eh’,'kp’,'me’,'rs’,'um’,'bv’,'gb’,'pm’,'sj’,'so’,'yt’,'su’,'tp’,'bu’,'cs’,'dd’,'zr’ ); [...]

Continue Reading

4 Comments

Page 1 of 3123

Rss Feeds