PHP

php code snippets, check valis email by php

Adding Google Adsense Vbulletin Mobile Style

If you want to put google adsense in Vbulletin Mobile Theme, go to your adsense account and choose ads for content. After that go to Styles and Templates, choose edit template from dropdown, choose ‘Ad Location Templates’. Vbulletin 3.7 has 7 locations for  ads.

The 7 locations are called:
ad_footer_end
ad_footer_start
ad_forumdisplay_afterthreads
ad_forumhome_afterforums
ad_header_end
ad_header_logo
ad_navbar_below
ad_showthread_beforeqr
ad_showthread_firstpost

Click to see the various ad locations available, find the one which is relavant to your ad and paste the google code in that template.

You will see header template. Now you can put adsense code in it and wait for sometime for tha ads to become active. The ads do not show for some time usually. It might take 48hours max for the ads to show, so don’t worry and wait. When ads are visible you can change their postion or color scheme as you wish.

Website RSS to Twitter (Posting to Twitter)

A lot of people would want to post  to twitter from their website. This means that the rss feed is tweeted to your twitter timeline. I will share a wonderful php script that can do it for you. Connecting your website with twitter is too easy now, using php you can post rss feed of your website to twitter. Check out the php code snippet given below and replace the values for your site and see how it works.

source: Posting to Twitter

Check Valid Email Using PHP

You can check if the email is valid or not by using regular experessions. Just copy and use the function below

function is_valid_email($email)
{
if( preg_match(“/+@+.+/”, $email) > 0)
return true;
else
return false;
}