Categories
Blogging Open Sources PHP Search Engine Optimization WebSites Wordpress

Top 10 Benefits Of Using WordPress For Your Website/Blog

WordPress is gaining in popularity now a days and 72,753,709 websites are running on WordPress. You can check the stats at http://en.wordpress.com/stats/

Top 10 Benefits Of Using WordPress For Your Website

One of the other benefits of using WordPress for your website of course, is that you have a website and a blog all in one. And a blog is a great way to build traffic to your website. Regularly publishing quality articles and content to your website/blog gives Google more content to crawl, and provides value to your web site visitors as well. When using WordPress for your website, you can set up a static front page that doesn’t look like a blog at all, and then have a link to an “articles” area on your site, where you can publish content rich articles.
You all must heard about the Open Source Platform WordPress. WordPress has been around since 2003 and is the most popular blogging software on the market. Over the last few years, WordPress has also become the content management software of choice for non-blogging websites. Here are the top 10 reasons why WordPress is so popular and why you might want to consider switching to a WordPress platform for your company’s website.

1. Easy to Use and User Friendly – If you can use Microsoft Word and Facebook then WordPress will be very easy for you. Tasks such as adding new pages/posts, images and video are now easy for everyone.

2. Update Your Website From Anywhere – WordPress runs in your web browser. So from any computer with Internet access (at home, at the office, on a business trip, etc) you can log in and update your website. Even from your smartphone.

3. Take Control of Your Site and Do Everything Yourself – After your website is built and live, you can update it yourself by adding content from backend. This way you will get a dynamic content website at a cost of static website. No more waiting for a web designer or programmer to upload the static pages and content on your website. With WordPress you enter the Do-It-Yourself world.

4. Free Search Engines Optimization – The coding and structure of WordPress is great for search engines. WordPress URL are more SEO friendly. That means your site is more likely to land on the first page of Google results, which means people are more likely to find you. Now you don’t need to hire a company for SEO of your website to get strong rankings.

5. Multiple Users from Many Places – WordPress is online and offers multiple users, which means you’re not the only one who can fix something in a pinch and you can access it from anywhere. If your company/business has several people who need to update your website (such as different blog authors) you can easily create individual accounts for each user. And each user can be assigned different access levels. So you can limit access to advanced features that you want to reserve only for your IT staff, etc.

6. Cheap or Almost Free – This is one of the most common but important feature of using WordPress for developing your website. Using WordPress for your website means it’s cost effective. WordPress itself is free, a theme is easily under $100 or even free and you save loads of money (compare the cost of template vs custom design).

7. Massive choice of themes – WordPress comes with two default themes (themes control the look and feel of your site) already installed which are quite basic. Despite of these themes you can search, upload & install themes from your WordPress dashboard. This way you can change your website design in less than 5 minutes. There are thousands of free themes available. You can also go further and install premium themes which typically sell for anywhere between $50 and $150.

8. Extensibility with thousands of plug ins – There are nearly 8,000 plugins available that you can install to enhance the usability and functionality of WordPress. Again these are easily searched, installed & activated via your dashboard. Some popular plug in additions, improve seo, enhance blog comment functions, page orders, twitter tools, XML sitemap creators, pinging, rotating tag clouds… the list is endless.

9. Automatic updating to keep you safe from Hacking – WordPress announces latest updated and release. These updates can be seen at your dashboard. You will need to upgrade them from time to time and this all can be done by more or less one click of your mouse. It is important to back up regularly and often. Keeping WordPress up to date with the latest release is the best way to keep it secure. There are enhancements you can install via plug ins for added peace of mind such as http://wordpress.org/extend/plugins/wp-security-scan/

10. Best Blogging Platform – If you are vivid blogger and you want to write articles on your websites then this is the best online blogging software/application for you. Its SEO friendly nature makes your website searchable on all major search engines so that you can get more advantages without any expense on SEO. However with the installation of one plug in “All In One SEO Plug In” the site will be fully optimized, taking away the mystery of SEO which is so often made to look so much more complicated than it actually is.

Categories
Google Google Maps MySql PHP phpMyAdmin Programming Languages

How to store Longitude/Latitude, from Google Maps in MySql?

If you are confused about the field type of longitude/latitude in the database tables and you are thinking about decimal or float then use the best way defined below.

In MySQL or SQL Server, we can save it as FLOAT( 10, 6 ) NOT NULL

This is the recommendation from google itself: https://developers.google.com/maps/articles/phpsqlajax

CREATE TABLE `markers` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 60 ) NOT NULL ,
`address` VARCHAR( 80 ) NOT NULL ,
`lat` FLOAT( 10, 6 ) NOT NULL ,
`lng` FLOAT( 10, 6 ) NOT NULL ,
`type` VARCHAR( 30 ) NOT NULL
) ENGINE = MYISAM ;

If you are using phpmyadmin then you can save the latitude and longitude shown below.

Categories
Git Linux Server PHP

Basic Git commands and use of these commands

Once you have installed git on your local computer then you have to go to the folder where git is installed.
To go to the folder you can write the following
pwd
cd c:/xampp/htdocs/
git branch

If you are using Git Public Repository then you must be aware about the following basic commands of Git.
Here is a small list of basic Git commands.

git push origin :BN – remove/delete branch from git server/repository

git stash – if there are conflicts and you want to avoid those conflicts

(git add filename) in which u resolved conflict then (git commit -a -m “resolved conflict while making design changes by nilesh”) then git push origin Dev and see your changes

git merge commit_id (to commit the changes in the branch that you are in now)

git reset – -hard (Reset current HEAD to the specified state)

git reset – -hard origin/master (if you are in master branch and git pull showing some conflicts then you can use this command to reset the master)

git branch -D BN – to delete a branch (you must be in other branch(i.e master or IndexFlowVaseem) to delete this branch)

git fetch origin BN:BN – to pull branch data from git

pwd – to see current working directory

git branch MyNewBranch – to create a new branch

git checkout master – to work in master branch or to switch master branch

git pull origin branchname – to get the github.com data on your local computer or git pull origin Dev

git pull origin Dev – a new branch named as Dev will be created with the code from git

git status – to see the changes in your branch and in github.com branch

git commit filepath_name1 filepath_name2 -m “your comment” – to commit the changes you have made

git push origin MyBranch – to upload your data to git branch

git add filename1 filename2 – to add new files in git

git log – to see the commit in the current branch

rm filename1 filename2 – to delete files

The most commonly used git commands are:
add–Add file contents to the index
bisect–Find by binary search the change that introduced a bug
branch–List, create, or delete branches
checkout–Checkout a branch or paths to the working tree
clone–Clone a repository into a new directory
commit–Record changes to the repository
diff–Show changes between commits, commit and working tree, etc
grep–Print lines matching a pattern
init–Create an empty git repository or reinitialize an existing one
log–Show commit logs
merge–Join two or more development histories together
mv–Move or rename a file, a directory, or a symlink
pull–Fetch from and merge with another repository or a local branch
push–Update remote refs along with associated objects
rebase–Forward-port local commits to the updated upstream head
rm–Remove files from the working tree and from the index
show–Show various types of objects
tag–Create, list, delete or verify a tag object signed with GPG

Categories
CakePHP PHP WAMP Server

How to Resolve Errors in CakePHP while installing it on Local Server

How to Resolve Errors in CakePHP

If you are newbie to CakePHP and getting the errors like below while installing CakePHP on Local Server.
“Please change the value of ‘Security.salt’ in app/config/core.php to a salt value specific to your application”
“Please change the value of ‘Security.cipherSeed’ in app/config/core.php to a numeric (digits only) seed value specific to your application”

Then the simple solution to resolve the errors is as follows-:
You just need to do as it says –

1. Edit yourInstallation/app/config/core.php
2. Search for Security.salt and change some random characters (this is so your application doesn’t have the same security seed as a billion other installations, which would be a serious security loophole.
3. Do the same with Security.cipherSeed but use only numbers for this.
4. Save core.php and the issue will be resolved

Categories
C Language CITI Bank Payment Gateway Linux Server Payment Gateway Integration PHP

How to Integrate CITI Bank Emi Payment Gateway in Linux Server

Today i am writing another simple steps to integrate the CITI Bank PG for advanced PHP Programmer.
The following steps will only work on Linux server as the linux server already have shell scripting enabled. I did not tried the below process on Windows.
I suggest you to first read the docs files sent by Citi Bank team. Although they are having a less technical guys sitting in there team and they can’t provide the program written in PHP not in other languages. They have a simple C program and nothing else. Don’t waste your time in calling them again and again and the output will be negative.

Step 1. Create a folder named citibank (name can be different as per your choice) on your Linux server. The location would be like this “/var/www/html/citibank”
Step 2. Copy the checksum.so.1 and prog.c or santest.c C program file provided by Citi Bank PG Support team in the folder.
Step 3. Then create a PHP program generate_checksum.php
<?php
shell_exec(‘gcc -rdynamic -o prog3 prog3.c -ldl’); // this shell command will create a prog3 compile file that will help to generate the checksum
?>
The above program will create the prog3 executable compile file on your server.
(* As the file will be created in the same citibank directory so the directory must have 0777 read write permission.)
If the executable compile file is not creating then there must be some problem and you can not proceed further without this file. Contact the Network Guy in your team or read the error log to resolve the issue.

Note: If you want to know that shell scripting is enabled on your Linux server is not then run the following php code.
<?php $output = shell_exec(‘ls -lart’); ?>
If the PHP Program shows some output then the shell scripting is enabled on your server.
If not then refer the log file at location “/var/log/httpd/error_log” (As i am using the Apache Server)

Step 4. If everything written above is working in a correct way then you may proceed further with the following PHP program.
Simple create a file form.php on your server and run the program.
<?php
function getChecksum($string ,$key)
{
$checksum_output = shell_exec(“./prog3 $string $key”);
$checksum_output = explode(‘=’,$checksum_output,2);
$checksum = $checksum_output[1];
$generatedChecksum = trim($checksum);
return $generatedChecksum;
}
$checksum = getChecksum(‘CITI’, ‘9310341016vasim’); // 4 digit and 12 digit
$return_url =’http://www.YourWebsite.com/anyreturnfile.php’;
$d_m_y_his = gmdate(‘dmYhis’); // 182652
$merchant_code = ‘44350912’;
$order_no = ‘20811332’; // 20662730
$trace_no = ‘662730’; // 662730
$amount = ‘200.0’;
?>
<FORM name=”frm” action=”https://www.test.citibank.co.in/servlets/TransReq?” method=”post” >
<INPUT type=”text” size=”200″ NAME=”MalltoCiti” VALUE=”0100|<?php echo $return_url; ?>|1|<?php echo $checksum; ?>|<?php echo $d_m_y_his; ?>|<?php echo $merchant_code; ?>|<?php echo $order_no; ?>|<?php echo $trace_no; ?>|<?php echo $amount; ?>|”>
<input type=”submit” NAME=”Submit” value=”Pay Now”>
</form>

The C Program that will be used by above php program is

#include
#include
#include
#include

int main(int argc, char *argv[] )
{
void *handle;
char temp1[strlen(argv[1])+1];
char temp2[strlen(argv[2])+1];
strncpy(temp1,argv[1],strlen(argv[1]));
temp1[strlen(argv[1])+1] = ‘\0’;
strncpy(temp2,argv[2],strlen(argv[2]));
temp2[strlen(argv[2])+1] = ‘\0’;

char *str;

char* (*func)(char*,char*);
handle=dlopen(“/var/www/html/non-deploy/checksum.so.1″,RTLD_LAZY);
func=(char* (*)(char*,char*))dlsym(handle,”Transpo”) ;
str=(char*)malloc(sizeof(char) * 20);
str=(char *)((*func)(temp1,temp2));
printf(“STR = %s \n”, str);
}

According to me everything will work fine and the Citibank url https://www.test.citibank.co.in/servlets/TransReq? will open successfully.
If there is something that you did not understand then you can Conact me.
Cheers and have fun!

Categories
PHP RSS Feeds

How to Display RSS Feeds from other websites in your PHP Page

RSS stands for Really Simple Syndication and Atom are two famous feed format.

If you open any RSS Feed page, first line starts with < ?xml … ?> and then and at the end .
So anything inside and is feed data.
Every content is placed under .
So all we need to do is read information inside and display it.

Here is a sample program that does it.

/* Our Code Starts Here */

//Enter the Feed url as parameter to function

$xml = simplexml_load_file(”http://www.vaseemansari.com/blog/feed”);

//To check if the read document is a rss feed

if($xml->channel->item)
{
$contents = $xml->channel->item;
foreach($contents as $content)
{
echo $content->title;
echo $content->description;
}
}
else
{
echo “Invalid RSS Format”;
}

/* Our Code Ends Here */

I will provide you the complete zip file of the php code very soon. Please be in touch and keep on reading.