PHP

RSS Subscribe

Auto login to WordPress using user email id or id

Posted on March 10, 2015 by Suresh Kamrushi in PHP

+15-1 Using inbuilt functions of WordPress user can do auto login for the application. As a client requirement my wordpress need auto login using user …

Genrating SEO friendly url using .htaccess and modrewrite

Posted on September 29, 2014 by Suresh Kamrushi in PHP

+53-5 Here how you can create clean SEO friendly url: Normal practice of using url: 1) http://sforsuresh.in/user.php?u=123 2) http://sforsuresh.in/user.php?u=123&cat=php 3) http://sforsuresh.in/page.php You can just rewrite …

Creating Contact us page in Drupal 7

Posted on September 10, 2014 by Suresh Kamrushi in PHP

+16-2 Following are the steps to enable, configure and adding Contact us form: Enabling Contact module: Login to Admin and click on “Modules” link from …

RSS feeds generator

Posted on September 1, 2014 by Suresh Kamrushi in PHP

+210 RSS is an easy way to provide contents of your sites in form of XML. RSS is written using XML, so we can define our …

Migrating content/node from drupal 4.x to drupal 7.x

Posted on April 11, 2014 by Suresh Kamrushi in PHP

Drupal having a huge support with version 6 > but with 4.X with no support and 5.x with limited support.
Initially I install few module to import node/content with CSV/XML but they are not working as expected. I need to import content first which include mainly title, description images(more than one) and attachments (more than 1) for each
content. I checked feed, taxanomy csv import, migrate and couple of more but they are able to upload content but not images and attachements.

What is the difference between SMTP server mail() and PHP mail()

Posted on April 9, 2014 by Suresh Kamrushi in PHP

PHP support mail() function for sending mails. And in general we use it as it fast and easy to do it. But by doing this we for exactly what we are doing this. Because when we use mail() native function of php it goes to Spam box and not in inbox of the intended recipient.

Wamp server port conflict with skype

Posted on March 24, 2014 by Suresh Kamrushi in Mysql, PHP

+27-2 If you are a PHP developer with WAMP install in you system which gives error for port number (if skype is already started). WAMP does …

Generating ERD using PHPMyAdmin

Posted on March 5, 2014 by Suresh Kamrushi in Mysql, PHP

Today I need to generate ERD for my Database. If you search on net you will get number of people suggest Workbench for it but as i am using PHPMyAdmin as an GUI for my Mysql database I just don’t want to install workbench only for generating ERD. And above all when PHPMyAdmin support it (from 3.4 version) than what more I need.

How to access remote mysql server using local phpmyadmin

Posted on February 28, 2014 by Suresh Kamrushi in Mysql, PHP

It is very tough to connect your remote mysql box especially when you are working with VPN. Initially I used telnet to connect to mysql box than I try to use workbench. Workbench is good and better than using telnet but again it consume more memory and if VPN got disconnected it just hanged. It so irritating. Than I try to integrate my PHPMyAdmin to configure to access remote mysql server and it is really very easy to setup.

Date manipulation with mysql..

Posted on February 10, 2014 by Suresh Kamrushi in PHP

There are various instance when we do date calculation on date / unix datetime fields.Following are some example as how to use inbuilt functions of mysql which will reduce doing calculation in PHP, I hope it will help someone:

PHP: Calculating Business days from given dates or for particular period.

Posted on January 29, 2014 by Suresh Kamrushi in PHP

PHP has numbers of datetime related functions which we can use to get Business day between two dates. Even if we have list of holidays we can also consider that for calculating.
Here is a simple example how you will get Business day in a particular period:

My first experience with Codeigniter

Posted on August 10, 2013 by Suresh Kamrushi in PHP

Earlier, say 1.5 years back I have created a project in cakephp and my experience is good with CakePHP.Now when i try to create another project with cakePHP version 1.2 i am unable to do that. I unable to generate files from console it is giving me error regarding PHP that some of the functions are deprecated.

Removing index.php from url of codeigniter in WAMP

Posted on August 10, 2013 by Suresh Kamrushi in PHP

Only three steps are require to remove index.php from url in Codeigniter in WAMP environment.
1) Create .htacess file in parallel to application holder and just copy past the following code:

How Mysql reduce overhead from PHP!!!!!

Posted on August 10, 2013 by Suresh Kamrushi in Mysql, PHP

I enjoy to play with Mysql queries. what i learn from my past experience is,if you are doing a maintainance project or you are handling a project which is developed by some other developer and he mess up with the database definitions, than you “WILL LEARN A LOT NEW THINGS”…………. How?

HEREDoc in PHP

Posted on August 10, 2013 by Suresh Kamrushi in PHP

A way to delimit strings is the heredoc syntax: <<<. After this operator, an identifier is provided, then a newline. The string itself follows, and then the same identifier again to close the quotation.

CodeIgniter : Loosing session data after login

Posted on August 10, 2013 by Suresh Kamrushi in PHP

In Codeigniter after login I am storing all the data into session and redirecting to some controller.But i am loosing all values in that controller and code redirect back to login page. I try every trick to debug this issue but fail!!!

Implementation of User permission with PHP & Mysql Bitwise operators.

Posted on August 10, 2013 by Suresh Kamrushi in Mysql, PHP

Another way to implement user permission in your application and also a good use of bitwise operator. This can be done with PHP as well as Mysql.

Here I am showing how we can implement it with Mysql.

PHP-Mysql Interview Questions

Posted on August 10, 2013 by Suresh Kamrushi in Mysql, PHP

Some PHP interview question i am sharing with you, which are really interesting and upgraded my knowledge. It might help you out…:)

Htaccess and Modrewrite

Posted on August 10, 2013 by Suresh Kamrushi in PHP

In Windows, links will get to your pages regardless of capitalization (or lack of it). So if the search engine indexed your page when it was www.example.com/page01.htm, it will still find it even if you renamed it www.example.com/PAGE01.htm (but read on, as there ARE ways that capitalization might effect you). In a Linux or Unix-based environment, things are a little different. The good news is that the base URL

PHP: Calculating Business days from given dates or for particular period.

Posted on August 10, 2013 by Suresh Kamrushi in PHP

Whenever i get time i used to answers in PHP related questions in Stackoverflow. Today i come across common question being ask by number of developers, is to get the “Bussiness days” in a specific period. Developer write unneccessary of lines of codes, which we can get easily by using Datetime functions available with PHP.

PHP Interview Questions – Magic Contant,Methods and Quotes

Posted on August 9, 2013 by Suresh Kamrushi in PHP

PHP provides a large number of predefined
constants to any script which it runs.There are seven magical constants that
change depending on where they are used. For example, the value of __LINE__
depends on the line that it’s used on in your script. These special constants
are case-insensitive and are as follows: