Can I use Infolinks and AdSense ads together on the same page?

Yes, both Infolinks ads and AdSense ads can be placed on the same page, even next to each other without any problem. It won’t violate terms of any of these service. Ads from both these online advertising services complement each other well, being visually different from each other. In fact, you can use ads of other advertising services like Clicksor, Chitika with AdSense without any issue.

Google TOS clearly states this on its website. It says,

“Publishers can put ads from third parties on the same page as AdSense ads, even next to each other subjected to the fact that both ads must have a different formatting and color combination. In other words, website visitors must know that both these ads are served by different ad networks and have no association to each other.”

Source: Google Support

And, even if you (mistakenly) violate this rule then AdSense team would first inform you through email and ask to make changes before taking any action.

Furthermore, here are some tips on placing Infolinks and AdSense ads together on a page,

  1. Always keep sufficient distance between the two ads (ie Infolinks and AdSense). Avoid placing them next to each other many do with AdSense ads.
  2. ‘Infold’ infolinks ads appear at the bottom of the page. They may cover AdSense ad placed at the bottom of your content. This is a violation of AdSense terms hence you must avoid using this Infolinks format when having an AdSense ad at the bottom of your page.

    infolinks infold ad with adsense ad

  3. ‘InFrame’ and ‘InScreen’ Infolinks ads are innovative and best revenue generating ads. They are completely different to AdSense ads, hence suggested for using on the website.

    adsense and infolinks inscreen ad format

    adsense ad and infolinks inframe ad format

  4. Though less useful but ‘Intag’ ad can be used, but it must be placed away and with a different color format than AdSense text ads. If placed close to each other, with similar color formats, you could violate AdSense terms.

Most website owners and even I use Infolinks and AdSense ads on my other website searchmytrain.com for few months now without any problem. You could do this as well and add an another revenue channel.

Leave a comment

How to Insert AdSense Ad within Post Content in WordPress (without Plugin)

Best place for placing AdSense ad is within the content. By doing so, we increase the visibility of ad, and hence there are better chances of readers checking them.

Inserting Ads within post content in a WordPress site isn’t easy since we need to know the programming structure of WordPress or use a plugin to do this. But in today’s post, we’ll do this using a simple code that you can copy and paste.

1. Displaying ad to left/right of post content, in first paragraph

1. Open post-template.php file contained in ‘wp-includes’ folder of your WordPress installation.

open post-template.php file in wp-includes of wordpress installation

2. Inside post-template.php, find the the_content function which will be somewhere in the 211th line of code.

3. In the code below, add your AdSense code in the $ad variable. Copy and paste the code after get_the_content function inside the_content function.

<?PHP
if( is_single() ) { // If posts, not for pages, homepage or any other page
$ad = "<p style='margin:15px;float:right;'>"; // Float right or left depending on the ad position you want
$ad .= "//------YOUR ADSENSE CODE------//"; // Place your AdSense code within quotes
$ad .= "</p>";
$content = $ad.$content; // Append AdSense code ad to the content
}
?>

4. Save the file. The the_content function should look something like this.

add adsense code within post content

5. That’s it. Check your website, a small block of ad would be appearing alongside the text.

2. Displaying ad in 2nd or 3rd paragraph, towards left or right

This too isn’t tough, all you need to do is to break content into two parts and put AdSense code sandwiching between the two. Here is how you can do this,

<?PHP
if( is_single() ) {
$new_content_part1 = $new_content_part2 = '';

$content_split_by_space = explode( ' ', $content ); // Break content from space

for( $i = 0; $i < 100; $i++ ) {
$new_content_part1 .= $content_split_by_space[$i].' '; // First to 100th word
}

$ad = "<p style='margin:15px;float:right;'>";
$ad .= "//------YOUR ADSENSE CODE------//";
$ad .= "</p>";

for( $i = 100; $i < count( $content_split_by_space ); $i++ ) {
$new_content_part2 .= $content_split_by_space[$i].' '; // 100th word to Last
}

$content = $new_content_part1.$ad.$new_content_part2; // Ad between two parts
}
?>

This is one way of doing this. You can break content from full stop(sentence end), comma or whatever you prefer. Another important to remember is that you should keep smaller sized ads in the middle as, sometimes, big ads deteriorates the reading experience of the visitors which shouldn’t happen.

If your ad isn’t appearing correctly, specify the height and width of the ad container ie the element <p> in which you’re putting the code.

If there is any problem, or there is any better way of doing this, please mention in comments.

Leave a comment

How to Book Newspaper Ads Online from Home

Booking a newspaper advertisement is easy with releaseMyAd, one of the premier online ad booking service in India. The process of ad booking through the website is simple, all you have to do is to choose a newspaper, write content, select date, make payment and your ad will appear in the newspaper on the selected date. It’s a great way of marketing your brand or startup, sitting at home, at reasonable price without huffing.

Stepwise Guide For Online Booking of Newspaper Ad

1. Go to releaseMyAd and select the ad type.

Here we’ve chosen classified display ad (second one) as you can see in the image above.

book classified display ad using releasemyad

Basically there are three types of ads – ‘Classified Text’ and ‘Classified Display’ ads which appear on classified section of the newspaper. In text ads, you can write text content only, and they are generally very cheaper and are charged on per word basis. In classified display ads, which are costlier than text ads, you can write text, add heading and logo of the company/firm. They are charged on the basis of area (per sq) they cover on the newspaper. Third type of ad is the ‘Display ad’ which appears on different pages of the newspaper, alongside the editorial section. It’s costly and is more preferred by big brands. They can be published on the front page, third page, back page and other pages as well.

2. Next select ad category. Here we’ve selected ‘Business’ since we’ll be publishing an ad for inviting clients for services offered by our firm Cyberpassion.

select newspaper ad category

3. Choose the newspaper, select region(s) and proceed clicking ‘Book Now’. Here we’ve selected Amar Ujala newspaper and Agra region where distribution is about 147000 copies which is good.

select newspaper,edition and book ad online

4. Next step is to choose one of the given templates, and modify it to create our own ad.

select ad layout and compose ad

5. Editing layout and creating ad is simple. You can do it in minutes using the online editor provided on the website. If you’re facing trouble doing this, you can ask the releasemyad editorial team to do this for you by contacting their customer support at customercare@releasemyad.com or the customer care executives available on live chat during daytime. Also you can create ad on Photoshop and send them the PDF or TIFF file.

create classified display ad

6. After you’ve finished creating the ad, click ‘Preview Ad’ to preview it and visualize how it would look like when published on the newspaper. Try to keep content as minimum as possible, and also keep text size as small as possible but big enough for readers to view it.

7. After finalizing, proceed to select date for ads to appear in the newspaper.

8. Select dates using the calender GUI provided on the website. You can select one or more dates. View the final amount clicking ‘Preview Details’. Final amount may increase depending on the area your ad is covering.

select dates for publishing ad in newspaper

9. On the same page, below date, do registration entering your information in the left section. If already registered, enter login credentials on the right and continue.

login to releasemyad profile

10. Finally select the payment option to make payment. Netbanking, credit card, debit card and cash collection etc options are all provided. Here we’ve chosen Axis bank netbanking.

make payment for publishing ad in newspaper

11. Make the payment. After it’s done, your ad will be submitted to releasemyad editorial team for proofreading.

newspaper ad booked through releasemyad

12. You’ll be asked to provide id proof – PAN card/DL/Aadhar card copy by releasemyad editorial team via email or phone. Send them your scanned documents as attachment to documents@releasemyad.com.

13. And that’s it. Your ad will be forwarded by releaseMyAd to the newspaper office and will come published in the newspaper on the selected date. If there is any query you want to make, or want to stop ad from publishing, you can directly mail to customercare@releasemyad.com or contact their live customer care support.

I’ve booked ads with releasemyad thrice and I’m pretty satisfied with their service. They too offer discounts to existing customers and discount over bulk ordering. You can ask about that to their customer support as well.

Leave a comment

11 Killer Tips to Increase CPC of Adsense Ads

Low CPC value can considerably reduce your income. I’ve faced this in the past, but there are ways to increase it. Yes, with little tweaks and clever tips, you can increase CPC of the AdSense ads appearing on your website.

Here are 11 of those best tips that’ll boost your income by a big margin,

Tip 1: Place your Best Performing Ad to the Top

Best CPC ads are displayed at the top of the page, and its value starts decreasing as we move from top to bottom and from left to right.

Why it’s so, Huh? Here is why: Before displaying an ad, Google analyses the webpage, matches it with the keywords, and display top-paying ads starting from top to bottom. So an ad placed to the top-left side of the page would have the highest CPC and the one placed at absolute bottom-right would have the lowest.

Tip 2: Enable Both Text and Image Ads

When creating AdSense ads, make sure you enable both text as well as image ads. By doing this, you increase the range of ads to appear on your site. Since Google always show high CPC ads relevant to the content, if an image ad isn’t available then it’d show high CPC text ad. So you always have a alternative ad when one ad-type is not present. It’s been observed that, income nearly doubles when both text and image ads are enabled.

Tips 3: Don’t Block any Ad

In AdSense account, don’t block any specific ad or disable any category. Some people block ads from competitors and sections like apparel (showing ads of lingerie) which can significantly cut down their income. Such ads usually carry high CPCs and disabling them could spoil your plan of attaining better revenue with increased CPC.

Tip 4: Pick a Competitive Niche for Better Ads

Since Google show ads matching content of the page, it’s important to write on topics that has more competition and possess higher CPC. Some of the fields where competition is higher are Insurance, Banking, e-Commerce, Health, Technology, Travel, and Beauty.

Tip 5: Write Fresh and Unique Content

The better your content is, better will be Google’s response. Fresh, simple, easy to read, high quality content in proper English gets receives better ads being more understandable to Google’s automated system that analyses content and delivers ad matching to it.

Tip 6: Pick High CPC Keywords For Website Content

Use Google AdWords and search for keywords which have more competition and have a higher bidding value. By including such keywords and writing content around them you can invite high CPC ads.

use high cpc keywords for increased cpc

Read our post on searching high CPC keyword using Google AdWords.

Tip 7: Write Lengthier Posts

By writing longer posts, you advertently cover more keywords, and hence you’re inviting high CPC ads from a bigger pool of keywords.

Tip 8: Ensure Website Gets Regular Traffic

regular traffic to website to increase adsense cpc

Though small but make sure visitors are coming to your site regularly. It’s an indication of what website reputation is, and Google does take a note of it while delivering ads.

So if your website is getting regular visits, more pageviews and bounce rate is low then you’re most likely to get ads of better CPC from Google.

Tip 9: Increase Website Pagerank

Pagerank is how well your website is connected to other websites in your niche. It has a direct relation with the reputation of website. Good content is linked by more website than a poor one. Google does count it big time, both in search results as well as deciding ads to show on a website.

Building Pagerank is a slow process, but it’s possible by writing good articles that other writers may find useful and give a backlinks(credit) to, and by sharing it to different social media sites and bookmarking sites like Slashdot and Digg.

Tip 10: Check Website Traffic Sources

In entire Asia, CPC for ads are lower than western countries, simply because here the competition in online marketing is lower. Hence, ads don’t carry more CPC here. So it’s always good to target audience from western countries as much as you can.

Tip 11: Prefer Best Ad Units

Being the most common size, the 336×280, 300×250 rectangle and 728×90 leaderboard ads are generally most competitive and hence have more CPC. Make sure you place one of these three in the upper half of the page.

300×600 large skyscraper is also of high value, but being new it has low competition. It invites huge number of clicks as per recent release by Google.

Why Increasing CPC is Important?

Total income through AdSense is a multiplication of 2 things – number of clicks and the value of ad. If an ad appearing on website is worth $0.1 (its CPC), and it gets 10 clicks then your total income would be 1$ or 64 rupees approximately.

mutiply clicks with cpc for total adsense income

Now if you increase CPC of ads by employing the above mentioned tweaks, you could get upto 2-3$ per click which can push your income to 20 dollars(2×10) or 1300rupees which isn’t bad.

Understand CPC, AdWords and AdSense Better

CPC is ‘Cost Per Click’, is the money you earn when an ad on your website is clicked. It’s paid by Google directly to your AdSense account.

On every click, you get something but everytime the amount isn’t the same. This is because all ads don’t carry the same value; some can be as low as 0.01$ while some could be of 2-3 dollars or more. Let’s understand why these ads have variable CPCs,

Google has 2 services – AdWords and AdSense. Lets assume there is an apparel company ‘APC’ and a blogger ‘BGR’.

‘APC’ announces 20% discount on all its apparels. For maximum reach, it uses Google AdWords for marketing, and decides to spend Rs 200 per day for 20 days. Google will now do the marketing on behalf of the company through publishers affiliated to its Google AdSense service.

‘BGR’ has an Adsense account. He writes on style and beauty. Since, the niche of blog and the firm is similar, Google may display APC’s ad on BGR’s. And when the ad is checked by a vistor on the website, publisher BGR gets the money and APC’s daily budget is chunked a bit. Google takes its service-charge and everybody gets happy.

Leave a comment

How to Choose Best Web Hosting Service for Website: Best Tips

The biggest concern for an individual while starting a website is to choose the right web hosting service. There are hundreds of companies, all promising to be the best in service, but only a few has the infrastructure and team to tackle the ever increasing cyber-threats and extreme traffic that sites experience at times. Apart from this, keeping websites online 365×7, 24 hours a day isn’t a task that all hosting providers would bet on doing. And those who do this, charge very high.

In today’s post, we’re going to give you some very easy tips on choosing the right host for your website,

Who has the best Customer Care Support?

Going offline is the worst thing that could happen to your website. Google demotes unresponsive websites, pagerank takes a hit, and visitors start to sway. Such a situation can be averted if your hosting provider offers a speedy customer care support.

For me, customer care support is the number one thing, even more than the price. I don’t want my website to go offline in any case. If the customer care guys are ready to listen to me and are fast in taking actions, I’ll be more than happy to pay them extra if I had to.

I’ve heard lot of reports where website owners keep on contacting customer care for one reason or the other without getting a satisfactory reply.

Best Option: Always choose a web hosting service that has reputed customer care support. Those having an office in your country are the best.

Do you really provide near 100% Website Uptime?

Almost all providers promise 99.99% uptime but in reality 77% hosting firms offer not more than 98% uptime. So its important for you to do an extensive research before taking a descision.

Best Option: All reputed hosting providers like Hostgator, Media Temple, GoDaddy, VPS.net, BlueHost, DigitalOcean are good in uptime. Low cost hosting providers are usually the most problematic ones.

Do they offer local Server/DataCenter for my website?

Datacenters are data storehouses located at different geolocations of the world but connected together through high speed internet. All reputed web hosting providers have multiple datacenters across the globe.

Websites hosted on datacenter near to their target audience are faster in performance. If your website is primarily for Indian audience, go for a hosting service that has datacenter in India or nearby like in Singapore, Austtalia or Japan.

choose best web hosting service provider having datacenters nearby

Best Option: Servers/Datacenters in Asia, Africa, Europe(except UK) are much costlier than US-based ones. So if budget is an issue or website is really lightweight, you can skip this point. On the contrary, you can use content delivery services like MaxCDN, Cloudflare which are quite affordable.

The Security

All hosting providers take security very setiously still some are prone to attacks slightly more than others because of their low-cost, less-secured infrastructure.

From outside, we can never know which one is secure and which isn’t. So the best thing is to do a Google search and find which were attacked in the past and why. Avoid all those which has a bad history.

Best Option: All the reputed sites namely GoDaddy, VPS.net, Hostgator are good in this aspect.

How much plans cost?

Price is a very big consideration while choosing a hosting plan for website. You can find plans from as low as 0.99$ per month to 800$ or more per month.

Price has direct relation with brand value of hosting company and the hosting plan – shared, VPS or dedicated you’re interested in. So its important for you to estimate traffic, CPU consumption, and weigh your pocket before opting for a hosting provider.

Best Tip: Go with a reputed brand if you’re starting up a business website. For a personal website or a starting blog, you can go with a low-cost hosting service.

Single and Multi-Domain Hosting Prices?

Different hosting services provide different plans. Some allow single website to host while some can allow multiple websites on single account. Depending on your need, choose the plan.

Can I Upgrade my Hosting Plan without website going Offline?

You may start with shared hosting plan, and with increase of traffic may require shifting on a VPS or dedicated server. So its important for you to ask if they provide easy migration of site without going offline.

As websites run for months and years, huge amount of data (in many Gbs) gets accumulated and hence server shifting isn’t a easy work if done manually. I’ve faced this problem myself hence recommend you to confirm on this at first.

Best Tip: Most hosting providers server upgradation/migration chare. This is somewhere between 50-100$.

Free of Cost Features, Addon, Services they offer?

Its always nice on the part of potential buyers to ask for something extra. Though most service provider does give free addons like one click WordPress, Drupal, Joomla, Magento installation and free scripts for use, and discounts to new customers, its always a good habit to ask anything and everything you have in mind. Customer care guys listen more when the tag of ‘potential’ is with a customer.

Best Tip: Reputed hosting companies provide nothing more than what’s mentioned in their plan but startups can provide hefty discounts and additional services.

Check Existing Offers and Discounts, Yearly Deals

web hosting companies provide timely offers and discountsHosting providers offer timely deals for potential customers. From big brands to startups, all follow this marketing strategy. So its good for you to hook with the one which is reputed and is offering good discount.

Most brands offer discount on bulk ordering as well.

Best Tip: Such offers are seasonal like during Diwali, Christmas, New Year and when a company enters into a new market.

Check Reputation

choose best web hosting service providerFace value is a big thing. You get the promised quality of service from reputed firms. They handle lacs of clients and most of them are satisfied that’s why they have this reputation.

Reputed web hosting service providers tend to have advanced infrastructures and better services on offer.

Best Tip: Web hosting providers like Sitegrond, Inmotion hosting and DigitalOcean may not the biggest but they have a very good reputation in the market.

Cpanel or Plesk Interface. Fee or Paid

Interface allow a non-geeky guy to host and run website on a web host. For installing WordPress, creating database and email-id, reading emails, interface is required.

choose best web hosting service provider,ask-cpanel-or-plesk

Cpanel and Plesk are two of the most famous interface that hosting companies provide. Some provide this for free while some charge extra bucks for it. So before buying a hosting, confirm what interface they’ll provide and if its free or paid.

Best Tip: Cpanel is easier to use than Plesk. Its used by more than 80% users. Most services provide cpanel free with shared hosting but not with VPS and dedicated hosting.

Ask yourself – Which Hosting to Purchase?

choose best web hosting provider,shared-vps-dedicated web hostingBasically there are 3 types of hosting plans – Shared, VPS, Dedicated.

Shared is cheapest and most basic plan which is good for websites with low to medium traffic and less CPU usage. Data storage, CPU, bandwidth, everything is limited and as the maximum point is reached, website is thrown offline.

VPS is slightly costlier and best for medium sized websites where traffic is slightly higher. It has a dedicated RAM and allow higher level of CPU and bandwidth consumption.

Dedicated server is for websites where everything is very high. Cost of dedicated servers are over-the-roof as well.

Know Plan Limits – Server Type, Storage, CPU Usage, Bandwidth, Database, Emails

There are few technical things you must enquire about. This includes,

1. Server Type: All hosting providers offer both Linux and Windows operating system. Windows OS is best if your website is in asp.net, Linux is best if its in PHP. In fact, Linux is best overall because of its security, less-problematic operation and low cost.

2. Storage Space: From as small as 50Mbs to hundreds of Gbs, you can get as much storage space as you need for your website. With increase of space, your hosting plan needs to be upgraded too. Price increases with space as well.

Apart from this, on most servers you can’t store videos, pirated content or anything that’s not good to kids. If you do this, accounts would get suspended permanently.

3. CPU consumption, Bandwidth: In shared hosting, you can’t consume more CPU and bandwidth than what’s allocated to your website. If you do, then your site will get suspended. On VPS hosting, you have RAM and CPU dedicated for your website, and you can even shift to higher a plan with a single click whenever you want.

4. Database and Emails: Just like CPU and bandwidth, number of free database and email accounts is limited on a shared hosting plan. There is also limitation over bulk email sending. In VPS and dedicated hosting, there are very few limitations.

Its always a better idea for you to read more about Shared, VPS and Dedicated servers before choosing one.

After-sale service, Refund Policy

After-sale service indicates how much a company values its customers, and how much its orientation towards providing better services to them. So before buying a hosting plan ask them about the refund process, free-of-cost and paid services they can offer you.

Site Data, Backup

Don’t forget to ask them if they keep a backup of data just in case their system crashes. You won’t like to be losing those useful articles and images you’ve compiled for months, so it’s important for you to ensure that they have proper system in place to backup sites to last working condition in case something bad happens.

What if my Account is Suspended?

After buying a hosting service, if your website or hosting account gets suspended due to heavy CPU usage, bandwidth, or traffic, ask them if you can get it started again? If yes, do you have to pay anything extra. Hurl such questions at them and seek for a satisfactory answer. You could also read their Terms of Services for this as well.

Best Tip: In most cases, hosting providers don’t take the responsibility of data when accounts gets suspended or charge extra for putting it online or ask for server upgradation as mandatory. So its important for you to be clear on this while selecting best web hosting service for your website.

Can I move to a new Hosting Provider?

Web Hosting providers never want to see a client going, so they put-in different sorts of boundation to prevent an existing client from going. They encourage you to take up a yearly hosting plan at a great discount, and you inadvertently end up in a year-long plan. In case you’re dissatisfied with their service and wish to leave, you either have to forfeit all the money (and switch to an another host) or continue using their services.

Apart from this, many hosting providers save your debit/credit card details and auto-debit money for renewal few days prior to scheduled renewal date. So you have to be careful before switching to a new host otherwise existing hosting provider would auto-renew the plan before you knowing.

Best Tip: Always use web hosting services for trial for 10-15 days before taking a call on buying. Most reputed hosting companies offer free-of-cost trial of their services.

Leave a comment

What is Document Open Password for Aadhar Card

Online copy of aadhar card (e-aadhar) can be taken from eaadhaar.uidai.gov.in, the website of Unique Identification Authority of India.

1. Once you’ve fill entries and entered the OTP, your e-aadhar card will automatically download to your computer.

2. On opening, it’ll ask for a ‘document open password’ for authentication.

A block saying ‘Eaadhar_123456789 is protected. Please enter a Open Document Password’ will appear.

3. Your pincode is the password.

Enter same pincode as mentioned in the registration slip given to you at the time of fingerprint and eye scan session.

enter Document Open Password for Aadhar Card-1

4. Taa daa! PDF file containing your e-aadhar card will open up.

online copy of e-aadhar card

Now cut the bottom part and laminate. Aadhar number is your identity as well as residential proof.

Leave a comment

How to Get Copy of Aadhar Card Online on eaadhaar.uidai.gov.in

Aadhar card is made compulsory for all Indian citizens. Daily thousands of aadhar cards are issued to Indian nationals by Unique Identification Authority of India.

Due to huge influx of requests, sometimes the postal delivery of Aadhar card is delayed. But you can get copy of aadhar card online on the website https://eaadhaar.uidai.gov.in. Here the stepwise guide to get e-aadhar card online,

1. Go to https://eaadhaar.uidai.gov.in.

2. Enter enrollment number, date-time, name, pincode and phone number as mentioned in aadhar registration slip given to you at the time of fingerprint, eye scan session.

A one-time password will be sent to your registered mobile number which may take upto 5 minutes to receive. Enter the OTP code and click ‘Validate and Download’ to download the online copy of aadhar card, called as e-aadhar.

Get Copy of Aadhar Card Online-1

3. Open the downloaded copy entering password (learn to get open document password of aadhar card).

Get Copy of Aadhar Card Online-2

4. Get the print of it, cut off the bottom part and laminate it.

online copy of e-aadhar card

That’s it. Now start carrying your aadhar card with you. Its your single, most powerful proof that you’re a proud Indian citizen.

This online copy of aadhar card works fine wherever you need to provide an identity or address proof or both. In fact, its the aadhar number that’s important rather than the entire card.

Aadhar is a great initiative by Indian Government to provide citizens a proof of their nationality. It’s similar to Social Security Number in the United States.

In the coming years, aadhar card would become a mandatory document for proof. So if you haven’t got it yet, better go and pay a visit to nearby aadhar card center.

Leave a comment

Facebook Update Publishing System Explained with PHP Code (and Ajax)

Sharing updates on Facebook is a great way telling your friends what you’re upto. But have you realized how update publishing system in Facebook is designed and why it works so awesomely. From a programmer’s point of view, its really an intriguing matter.

Such a system can be designed using PHP and Ajax. In this post we’ll design a similar system and discuss the entire code in detail. Before we start, have a look at the end-product – View Demo.

1. Making Design in HTML – the front end

In designing, we create two things – the space where updates are written and the block where all updates show up.

Facebook Update Publishing System Explained with PHP Code-1

1. Make textarea (ie the space) for users to write update. When ‘Post’ button is clicked, its published.

<textarea id='fb-update'></textarea>
<input type='submit' id='publish-fb-update' value='Post'>

2. The block div#feed-stream is where updates appear.

In the following code, we’re getting 5 recently published updates(by friends and user) from the database using getFeedsForUser PHP function. Results are returned to showFeedsForUser function which displays it inside div#feed-stream.

<div id='feed-stream'><?PHP echo showFeedsForUser(); ?></div>

<?PHP
// Display Feed for User
function showFeedsForUser() {
	$getFeeds = getFeedsForUser(); // Get feeds in array
	$feeds = "<ul id='feeds'>";
		foreach( $getFeeds as $f ) {
			$feeds .= "<li>";
			$feeds .= "<span class='update'> $f[0] </span>"; // Update
			$feeds .= "<span class='update-time'>".date( 'd M', strtotime( $f[1] ) )."</span>"; // Date
			$feeds .= </li>";
		}
	return $feeds .= "</ul>";
}
?>

<?PHP
// Get Updates From Database
function getFeedsForUser() {
	$feeds = array();
	$q = mysql_query( "SELECT * FROM ".FBUPDATES." ORDER BY ptr DESC LIMIT 5" );
	while( $r = mysql_fetch_row( $q ) ) {
		array_push( $feeds, array( $r[2], $r[3] ) );
	}
	return $feeds; // Return array containing older updates
}
?>

Sending Update to Facebook and Displaying it in Feeds – the backend

The magic of everything lies in what happens at the back-end.

Traditionally, when you post something, the page refreshes – like it goes away and appears again. This is very slow, not user-friendly and potentially fatal for your internet plan. Also it makes the overall experience of the website really bad.

Then came ‘AJAX’ or Asynchronous Javascript and XML that allow to-and-fro data transfer between server and browser without page reload. So virtually user perceives as if everything is happening in real-time, instantly. Due to Ajax, websites and app can communicate with server in a much faster and user-friendly manner.

Almost all features of Facebook use this and update publishing is one of them. Here, as an update is posted, its sent to the server where its saved in the database. After storing, a success message and the published update is returned to user browser which is shown at the top of feeds. All this happens in a blink of an eye, in the background, without user knowing anything about it.

1. jQuery Code picking the update entered by user inside textarea.

$('textarea#fb-update').val()

2. Sending update to Facebook server using Ajax.

<script>
$('input#publish-fb-update').click(function() {
	$.post('facebook-ajax.php','fb_update='+$('textarea#fb-update').val()+
'&op=publish_update',function(data){
		if( data ) {
			$('ul#feeds').prepend("<li>"+data+"</li>"); // If success, publish update
		}
	});
	return false;
});
</script>

3. Sent data is received on server and stored in the database. Server returns the update which is displayed in feeds.

<?PHP
$user_id = 123456789; // Every fb user has an id set in session variable, here we have a fixed value as an example
	$fb_update = strip_tags( $_POST['fb_update'] ); // Get update.
	date_default_timezone_set("Asia/Kolkata");
	$datetime = date( "Y-m-d h:i:s", time() ); // Date and time is calculated based on user country. Here we're saving everything as per India time
	if( !empty( $fb_update ) && mysql_query( "INSERT INTO fb_updates VALUES( '', '$user_id', '$fb_update', '$datetime' )") ) {
		echo "<span class='update'> $fb_update </span><span class='update-time'>".date( 'd M', strtotime( $datetime ) )."</span>"; // If saved successfully
	}
	else {
		echo false; // If saving failed, just in case
	}
?>

That’s the entire idea of publishing user update in Facebook and tweets in Twitter. This is nothing too tricky as this can be done with little knowledge of PHP, Javascript and HTML.

If there is any query, mention in the comments and I’ll try and answer them asap. Thanks for reading.

Leave a comment

How to Connect Remote MySQL Database using PHP

For connecting to MySQL database hosted on the same server, we generally use ‘localhost’ as hostname. Apart from this, we need the username, password and name of the database we need to connect to.

Remote MySQL database means we have our database located at some distant location, not on the same place(host) where our website/app is. For connecting to such a database, we need to get its hostname, username and password.

After we have all this, here is how we make a connection to it using PHP,

1. Go to the (remote) server, and open database in phpMyAdmin.

connect remote mysql database using php-1

2. Copy the hostname appearing at the top.

connect remote mysql database using php-2

3. Get the database username and password. Its set at the time of database creation.

4. Once you have all this, make connection to this server from yours using the following PHP code,

<?PHP
$con = mysql_connect( 'remote-db-hostname', 'remote-db-username', 'remote-db-password' );
$selectdb = mysql_select_db( 'remote MySQL database name', $con );
?>

For WordPress site

If you wish to show posts from a remote MySQL database in your WordPress site, just replace the hostname, username, password and database name with remote server’s in wp-config.php file inside WordPress folder.

connect remote mysql database using php-3

Once you do this, your WordPress site will start showing posts from that remotely located MySQL database.

Leave a comment

Top 10 Weak Passwords to Avoid for Email Accounts

Be it your Gmail, Facebook or bank account, passwords are important in all. They are the keys to unlock those private things that we don’t want rest of the world to see. Despite being so important to us, we seldom give a heed on keeping a strong password to prevent it from attacking.

Weak Passwords to Avoid for Email AccountsEveryday as many as 10,000 accounts are compromised, and the most common reason for this is the weak passwords that people keep.

Even most of you guys reading this would be having your phone number or name as password. These are easily guessable, and such weak passwords can be broken using a simple bruteforce attack.

In the blog, we’re enlisting 10 of the weakest passwords that people keep,

  1. Phone number – As many as 37% people keep their phone number or phone number of their family member as their password. The main reason for phone number being a preferred choice is that it can be easily memorized. Its not a safe password since attackers – a friend or close relative could enter phone number and gain access to bank and email accounts of a user.
  2. password – Yes, this is the password of as many as 7% of internet users. Its really weird to think how this would provide any safety to an email account.
  3. 123456 – Another password that’s as good as hell, yet 11% believe in these numerals to provide security to their email accounts.
  4. 12345678 – Just an extension of previous one, its a password for those who can’t find a good 8 characters long password as required by some websites for registration.
  5. abcdef – The alphabetic version of 123456 is abcdef. A large contingent of netizens go for this alphabetical series. Its indeed an another weak password and we all must avoid.
  6. 111111 – Another bad password that people don’t stop keeping simply because its easier to type. Never keep this otherwise you’re account is gone without you knowing anything about it.
  7. qwerty – There is one more alphabetical series that’s famous among users as email account password. Being famous, its easily guessable too.
  8. Name or Nickname of self/wife/son/daughter/girlfriend – More than 25% guys keep name of their wife, son, daughter as password. This too isn’t secure as a known attacker could easily try these and break into an account without much fuss.
  9. Name of favorite sportsman/food/color/dress – People little-geeky tend to keep name of their ex, favorite sportsman or food as their password. Though its comparatively safer but still not that hard to guess.
  10. Car/Bike Number, Bank account – This again may look little safe but still prone to attacks. As many as 4% users keep either their car or bike number or bank account number as their password and attackers know that, that’s why should be avoided.

Do you have any of these passwords, or anything similar? If yes, then you’ve got a weak password and you must change it. I’ve came across lot of guys who had their Facebook and Gmail accounts taken over by attackers. This may happen to you too, so its time to take a step and set a strong, unguessable password.

A strong password is of alphanumeric-type with more than 8 characters. Alphanumeric passwords are a combination of alphabets(a to z), numerals(0 to 9) and special characters(!&%#$). Such passwords aren’t guessable and can’t be broken in less than 111 years so its virtually unbreakable.

Leave a comment

How to Book Confirmed Tatkal Train Tickets Successfully on IRCTC?

If you were asked 3 toughest tasks to do then getting a confirmed tatkal ticket would surely be the first one. This is something that Rajnikanth wouldn’t bet on doing during Diwalis when the traffic in trains is over the roof.

Is booking a confirmed tatkal ticket on irctc really that tough? I’ve spent over a decade booking train tickets (not as an agent though!) and based on my experience I must tell you that this thing is definitely tearing but still possible if you know the right way to do. And if you know some clever tweaks then you’re in much better position than others for getting a confirmed tatkal train ticket.

1. Create multiple accounts on irctc: By doing this you can try for ticket booking simultaneously from multiple accounts. If booking through one account fails you can continue with the second account and if that too fails you can switch to third account and so on.

One thing to note here is that while trying through different accounts, make sure you login with different browsers. Take Google Chrome for one, and Mozilla and Safari for other accounts.

This is called as Broker’s trick. Here is a video describing its working in detail,

Book Confirmed Tatkal Train Tickets Successfully on IRCTC-22. Always login 15 minutes prior to tatkal time of 10am. irctc.co.in, the website for online ticket booking in Indian Railways, gets slower as the time nears 10am so its always a better idea to login 10 to 15 minutes advance. If you fail to do this, its likely that you can’t login for the next 10-15 minutes as the sites gets bottle-necked with login requests.

After login, don’t leave the window idle for more than 3 minutes as you’ll be automatically logged out of the website. Keep on searching trains and doing other stuff for browser to think you’re doing something, not sitting idle.

3. Prefill entries: Irctc store details of failed bookings and display them up when booking is tried for the next time. So a great trick is doing a fake reservation attempt by filling passenger entries, and just as you reach the payment page, click on ‘Replan’ button to return back. Now when you go for tatkal booking(for real), all the previously filled information would appear pre-filled thus saving lot of time. Its a gold-trick to save time and create better chances of getting confirmed tatkal ticket.

Book Confirmed Tatkal Train Tickets Successfully on IRCTC-4

4. Keep passenger information on the table before starting. book confirmed tatkal ticket on irctc-5.jpgWhile booking tatkal ticket, you need to enter passenger information – name, age and identity card number of one of the travelling passenger.

Time is important in tatkal bootking so make sure you have everything in hand. This can save you vital seconds and help you getting preferred seat alongwith a confirmed tatkal ticket.

5. Work in Short: Move across form fields using keyboard’s tab button. In passenger info, write short form of the name like R Sharma for Rakesh Sharma, N Mishra for Nalini Mishra and so on. Don’t change the existing phone number with yours, and always keep cursor on ‘Submit’ button while filling entries. All these could save you vital seconds which could the difference be between a watlisted ticket and confirmed tatkal ticket.

6. Don’t mark seat preference as mandatory except there is any urgency. While booking tatkal ticket, don’t set lower or upper berth as compulsory as it reduces the seats available for you by nearly half. This is a suicide act hence must not be done if you want to get a tatkal ticket of confirmed quota.

7. Paying by debit/credit card is a better option since its fast. Book Confirmed Tatkal Train Tickets Successfully on IRCTC-3Paying by netbanking is slow as browser has to navigate to and from between irctc, payment gateway and the bank’s internet banking portal so there are every changes of transaction getting late.

In debit/credit card there are just 2 ends – the payment gateway and the irctc website so its faster, hence the preferred option for paying on irctc.

8. No returning back after starting: Doesn’t matter if you’ve made mistake in passenger name or age, there is no time to restart the tatkal booking process after starting. If you do, you’ll get late and fail to get a confirmed ticket. Everything is fine till you haven’t wronged the details of person having the identity card.

9. Work fast on keyboard: It’s very important for person booking tatkal ticket to be Rajnikanth-like on computer. Typing speed must be fast and the person must be aware of the entire ticket booking process. Also it’s important to enter correct entries. Time is the most important factor, little mistake can spoil the cherry for you.

10. There are some trains that allow tatkal ticket booking upto 2 days in advance. This is because their schedule is such that two trains of same name depart from source within the tatkal time of 10am and the midnight of next day. Some trains include Brahmaputra mail, Kerala Express. So if you fail to do confirm tatkal ticket booking on a given day you can give a shot on the succeeding day.

Leave a comment

How to Create Facebook ads to increase Facebook Page Likes?

Facebook ads is a great way of increasing likes of a Facebook page at a staggering pace. All you have to do is to create an ad, select target area and target audience and a payment mode to get started. Run your ad as many days as you want and see how likes increase by many folds within no time.

Here is a stepwise guide showing how you can use Facebook ads for promoting your Facebook page,

1. First of all make sure you have a Facebook page or you’re an admin on page owned by someone else.

2. On your Facebook page, go to on Build Page>Promote Page as shown in the image below.

create facebook ad for increasing page likes-step1

3. A block will appear with different options to customize your ad. Select your target country, state or city, age group, gender and amount you wish to spend each day. We’ discuss all these in details below.

increase page likes creating facebook ads-step2

4. Select ‘Interests’ which are a set of keywords using which Facebook decides the target audience for the ad. Lesser the interests, more impactfull will be the ad and greater will be its reach.

using facebook ads to increase facebook page likes-step3

5. Select budget to spend each day on page promotion.

increase facebook page like using ads on facebook-step4

6. Pick the number of days you want ad to run and invite likes.

Total expense is the multiplication of days and the daily budget. So if you’re spending 129INR per day for 3 days, your total expenditure will be Rs.387.

select dates for facebook ads to run while increasing facebook likes-step5

7. Click ‘Promote Page’ to see a payment block. Select a payment method, currently only credit card is allowed though paypal is also available. Click ‘continue’ to proceed.

pay by credit card for facebook ad for page like increase-step6

8. Enter your credit card details and submit. Though debit card option is also allowed but 90% debit cards aren’t accepted due to currency conversion issue.

provide credit card information for running facebook ad-step7

9. On successful addition of credit card details, your ad will be submitted to Facebook for approval.

facebook ads for increasing facebook liike increase started-step8

10. Approval is given in 4-5 minutes. You ad will start running soon after approval is provided and your Facebook page would start getting likes instantly. There is no specific rate at which pages receive likes but roughly its about 1 like per Rs 0.50-2. It basically depends on the name of page, its niche, content it publishes and the ongoing buzz among users for such pages.

11. After the advertisement starts running, you can view the stats clicking ‘View Promotion’ button below the page likes count on the page.

view facebook ads promotion for page like increase-step9

12. In the promotion status page, you can view the number of likes received by the page and the total amount spent on it. You can edit – change or pause the ad if you want to.

page likes increased within a day by promotion using facebook ads-step10

Here is how page likes of yourRavi increased from 6709 to 6295 in just 2 days.

page likes increased due to promotion using facebook ads-step11

Leave a comment