Friday, 29 May 2015

How to Get Your New Website or Blog Discovered in Google search engine ?


So how can you get your new website discovered by the Googlebot? Here are some great ways. The best part is that some of the following will help you get referral traffic to your new website too!
·         Create a Sitemap – A sitemap is an XML document on your website’s server that basically lists each page on your website. It tells search engines when new pages have been added and how often to check back for changes on specific pages. For example, you might want a search engine to come back and check your homepage daily for new products, news items, and other new content. If your website is built on WordPress, you can install the Google XML Sitemaps plugin and have it automatically create and update your sitemap for you as well as submit it to search engines. You can also use tools such as the XML Sitemaps Generator.

how  to  create  sitemap.xml  file   for  any  website:

(1)first go to website

https://www.xml-sitemaps.com/

"http://smallseotools.com/xml-sitemap-generator/"

Enter your website url & click on generate & download sitemap.xml file

& upload this to your website ..

Download the sitemap file here and upload it into the domain root folder of your site (yourdomainname.com).
Check that sitemap is showing for you at http://yourdomainname.com/sitemap.xml, go to your Google Webmaster account and add your sitemap URL.

·         Submit Sitemap to Google Webmaster Tools – The first place you should take your sitemap for a new website is Google Webmaster Tools. If you don’t already have one, simply create a free Google Account, then sign up for Webmaster Tools. Add your new site to Webmaster Tools, then go to Optimization > Sitemaps and add the link to your website’s sitemap to Webmaster Tools to notify Google about it and the pages you have already published. For extra credit, create an account with Bing and submit your sitemap to them via their Webmaster Tools.
·         Install Google Analytics – You’ll want to do this for tracking purposes regardless, but it certainly might give Google the heads up that a new website is on the horizon.
·         Submit Website URL to Search Engines – Some people suggest that you don’t do this simply because there are many other ways to get a search engine’s crawler to your website. But it only takes a moment, and it certainly doesn’t hurt things. So submit your website URL to Google by signing into your Google Account and going to the Submit URL option in Webmaster Tools. For extra credit, submit your site to Bing. You can use the anonymous tool to submit URL’s below the Webmaster Tools Sign In – this will also submit it to Yahoo.
·         Create or Update Social Profiles – As mentioned previously, crawlers get to your site via links. One way to get some quick links is by creating social networking profiles for your new website or adding a link to your new website to pre-existing profiles. This includes Twitter profiles, Facebook pages, Google+ profiles or pages, LinkedIn profiles or company pages, Pinterest profiles, and YouTube channels.
·         Share Your New Website Link – Once you have added your new website link to a new or pre-existing social profile, share it in a status update on those networks. While these links are nofollow, they will still alert search engines that are tracking social signals. For Pinterest, pin an image from the website and for YouTube, create a video introducing your new website and include a link to it in the video’s description.
·         Bookmark It – Use quality social bookmarking sites like Delicious andStumbleUpon.
·         Create Offsite Content – Again, to help in the link building process, get some more links to your new website by creating offsite content such as submitting guest posts to blogs in your niche, articles to quality article directories, and press releases to services that offer SEO optimization and distribution. Please note this is about quality content from quality sites – you don’t want spammy content from spammy sites because that just tells Google that your website is spammy.


(2)How to  use  Google webmaster tools?
n order to start using Google Webmaster Tools, you should create a new account (or use an existing one if you already have a Google account). Visit the Google Webmaster Tools web page:
You will be asked to log in or create a new account. The registration process is simple and you should not experience any troubles.
Once logged in with your Google account to the Google Webmaster Tools interface you should start by adding your website. To do so click on the Add a Site button. A pop-up will appear and you will be prompted to enter your website domain name. Once you have done it you will see your newly-added website under the sites menu.
The next step is to verify you are the owner of the website. For this purpose click the Verify this site link. The easiest way to verify the website is by uploading an HTML file. Choose this option from the Verification Method drop-down menu and follow the verification steps:
1.    Click the Download verification file link and save the file to your local computer.
2.    Connect to your hosting account via an FTP Client or using cPanel -> File manager and upload the downloaded file under the webroot directory (most commonly public_html) for your domain name.
3.    Verify that the file is successfully uploaded by visiting the proposed link.
4.    Finally click the verify button.
At this point you will be redirected to the Google Webmaster Tools dashboard for the website you have just verified.


To track website & how many visitors are on that…make login in analytics add your website url & get your tarcking code and paste this to all pages which you want to track.

(4) How   to   indexed   &  check   for   indexed pages or website in Google :
All  it done using  google webmaster  add site map here & verify &  add  google fetch…
Check pages whether it is  indexed or not http://indexchecking.com/





Wednesday, 27 May 2015

Advance-PHP-Tutorials

Advance   PHP    Tutorials:

Class example:

<?php

class books
{

var $bookname;
var  $price;

function display($name,$cost)
{
echo $this->bookname=$name;
echo '<br>';
echo $this->price=$cost;
echo '<br>';

}
}

$obj=new books();
$obj->display("om",10);

?>
Output:
om
10


Constructor & Destructor in php:


<?php
class  example
{

function  __construct()
{

echo "constructor is called & object  is created";

}

function __destruct()
{

echo "destructor is called & object is free";

}
}
$obj=new  example();

?>
Output:
constructor is called & object is created
destructor is called & object is free

Inheritance in php:

<?php

class  parent1

{

var $name="test";
var $phone="123456";

public function disp()
{

echo $this->name;
echo "<br>";
echo $this->phone;
echo “<br>”;
}
}

class  inheritance1 extends parent1
{

function read()
{

echo "it is working fine";

}


}

$obj=new inheritance1();

$obj->disp();

$obj->read();


?>
Output:
test
123456
it is working fine


interface in php:

<?php

interface  test

{

function disp();

}

class  hello implements test
{


function disp()
{


echo "it is interface function";


}


}

$obj=new  hello();


$obj->disp();


?>

Output:
it is interface function


Static variable & static member function in php:

<?php

class staticexample

{

public static $name="om"; // static variable


public static function disp()  //static member function


{

echo "static member function is this";


}


}


$obj=new  staticexample();


print  staticexample::$name;    // accessing static variable

echo "<br>";
staticexample::disp();        //accessing static member function





?>
Output:
om
static member function is this


Auto load  keywords in php:


First write code for  interface1.php file:
<?php

interface  test

{

function disp();

}

class  interface1  implements test
{


function disp()
{


echo "it is interface function";


}


}

$obj=new  interface1();


$obj->disp();


?>
Output:
it is interface function
And write code for  inheritance1.php file:

<?php

class  parent1

{

var $name="test";
var $phone="123456";

public function disp()
{

echo $this->name;
echo "<br>";
echo $this->phone;

}
}

class  inheritance1 extends parent1
{

function read()
{

echo "it is working fine";

}


}

$obj=new inheritance1();

$obj->disp();

$obj->read();


?>
Output:
test
123456it is working fine
And finally use  following  code autoload these two  files :

<?php

function __autoload($class_name)
{
    include $class_name . '.php';
}

$obj  = new inheritance1();

$obj2 = new interface1();

?>

Output:
(note: It will display boths files output together…)
test
123456it is working fine it is interface function


PHP-Curl-web-scrapping-example

<?php

  $curl_handle=curl_init();
  
  curl_setopt($curl_handle,CURLOPT_URL,'http://www.vissicomp.com');
  
  curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
  
  curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
  
  $buffer = curl_exec($curl_handle);
  
  curl_close($curl_handle);
  
  if (empty($buffer))
{
      print "Nothing returned from url.<p>";
  }
  
  else
{

      print $buffer;

  }
?>

Saturday, 9 May 2015

Geolocation plugin-cordova

(1)use following to install  geolocation plugins using CLI:
cordova plugin add org.apache.cordova.geolocation

(2)use code example:

<!DOCTYPE html>
<html>
  <head>
    <title>Device Properties Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for device API libraries to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // device APIs are available
    //
    function onDeviceReady() {
        navigator.geolocation.getCurrentPosition(onSuccess, onError);
    }

    // onSuccess Geolocation
    //
    function onSuccess(position) {
        var element = document.getElementById('geolocation');
        element.innerHTML = 'Latitude: '           + position.coords.latitude              + '<br />' +
                            'Longitude: '          + position.coords.longitude             + '<br />' +
                            'Altitude: '           + position.coords.altitude              + '<br />' +
                            'Accuracy: '           + position.coords.accuracy              + '<br />' +
                            'Altitude Accuracy: '  + position.coords.altitudeAccuracy      + '<br />' +
                            'Heading: '            + position.coords.heading               + '<br />' +
                            'Speed: '              + position.coords.speed                 + '<br />' +
                            'Timestamp: '          + position.timestamp                    + '<br />';
    }

    // onError Callback receives a PositionError object
    //
    function onError(error) {
        alert('code: '    + error.code    + '\n' +
              'message: ' + error.message + '\n');
    }

    </script>
  </head>
  <body>
    <p id="geolocation">Finding geolocation...</p>
  </body>
</html>

NOtification-plugins-in-Cordova


Notifications:

(1)install plugins using CLI:

cordova plugin add org.apache.cordova.dialogs

(2)install plugins using CLI:

cordova plugin add org.apache.cordova.vibration

(3) CODE example:

<!DOCTYPE html>
<html>
  <head>
    <title>Notification Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for device API libraries to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // device APIs are available
    //
    function onDeviceReady() {
        // Empty
    }

    // alert dialog dismissed
        function alertDismissed() {
            // do something
        }

    // Show a custom alertDismissed
    //
    function showAlert() {
        navigator.notification.alert(
            'You are the winner!',  // message
            alertDismissed,         // callback
            'Game Over',            // title
            'Done'                  // buttonName
        );
    }

    </script>
  </head>
  <body>
    <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
  </body>
</html>

Cordova-Basic-Device-Plugin


(1)first install plugin for device using CLI:

cordova plugin add org.apache.cordova.device
(2)use following code :

<!DOCTYPE html>
<html>
  <head>
    <title>Device Properties Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for device API libraries to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // device APIs are available
    //
    function onDeviceReady() {
        var element = document.getElementById('deviceProperties');
        element.innerHTML = 'Device Model: '    + device.model    + '<br />' +
                            'Device Cordova: '  + device.cordova  + '<br />' +
                            'Device Platform: ' + device.platform + '<br />' +
                            'Device UUID: '     + device.uuid     + '<br />' +
                            'Device Version: '  + device.version  + '<br />';
    }

    </script>
  </head>
  <body>
    <p id="deviceProperties">Loading device properties...</p>
  </body>
</html>

Camera-Plugin-in-Cordova

(1)First install plugin using CLI interface :

cordova plugin add org.apache.cordova.camera

(2)write code this for camera:

<!DOCTYPE html>
<html>
  <head>
    <title>Capture Photo</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    var pictureSource;   // picture source
    var destinationType; // sets the format of returned value

    // Wait for Cordova to connect with the device
    //
    document.addEventListener("deviceready",onDeviceReady,false);

    // Cordova is ready to be used!
    //
    function onDeviceReady() {
        pictureSource=navigator.camera.PictureSourceType;
        destinationType=navigator.camera.DestinationType;
    }

    // Called when a photo is successfully retrieved
    //
    function onPhotoDataSuccess(imageData) {
      // Uncomment to view the base64 encoded image data
      // console.log(imageData);

      // Get image handle
      //
      var smallImage = document.getElementById('smallImage');

      // Unhide image elements
      //
      smallImage.style.display = 'block';

      // Show the captured photo
      // The inline CSS rules are used to resize the image
      //
      smallImage.src = "data:image/jpeg;base64," + imageData;
    }

    // Called when a photo is successfully retrieved
    //
    function onPhotoURISuccess(imageURI) {
      // Uncomment to view the image file URI
      // console.log(imageURI);

      // Get image handle
      //
      var largeImage = document.getElementById('largeImage');

      // Unhide image elements
      //
      largeImage.style.display = 'block';

      // Show the captured photo
      // The inline CSS rules are used to resize the image
      //
      largeImage.src = imageURI;
    }

    // A button will call this function
    //
    function capturePhoto() {
      // Take picture using device camera and retrieve image as base64-encoded string
      navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
        destinationType: destinationType.DATA_URL });
    }

    // A button will call this function
    //
    function capturePhotoEdit() {
      // Take picture using device camera, allow edit, and retrieve image as base64-encoded string
      navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true,
        destinationType: destinationType.DATA_URL });
    }

    // A button will call this function
    //
    function getPhoto(source) {
      // Retrieve image file location from specified source
      navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
        destinationType: destinationType.FILE_URI,
        sourceType: source });
    }

    // Called if something bad happens.
    //
    function onFail(message) {
      alert('Failed because: ' + message);
    }

    </script>
  </head>
  <body>
    <button onclick="capturePhoto();">Capture Photo</button> <br>
    <button onclick="capturePhotoEdit();">Capture Editable Photo</button> <br>
    <button onclick="getPhoto(pictureSource.PHOTOLIBRARY);">From Photo Library</button><br>
    <button onclick="getPhoto(pictureSource.SAVEDPHOTOALBUM);">From Photo Album</button><br>
    <img style="display:none;width:60px;height:60px;" id="smallImage" src="" />
    <img style="display:none;" id="largeImage" src="" />
  </body>
</html>

cordova- plugins(phone gap plugins)

When you build and view a new project, the default application that appears doesn't do very much. You can modify the app in many ways to take advantage of standard web technologies, but for the app to communicate closely with various device-level features, you need to add plugins that provide access to core Cordova APIs.
A plugin is a bit of add-on code that provides an interface to native components. You can design your own plugin interface, for example when designing a hybrid app that mixes a Cordova WebView with native components. (See Embedding WebViews andPlugin Development Guide for details.) More commonly, you would add a plugin to enable one of Cordova's basic device-level features detailed in the API Reference.
As of version 3.0, when you create a Cordova project it does not have any plugins present. This is the new default behavior. Any plugins you desire, even the core plugins, must be explicitly added.
A list of these plugins, including additional third-party plugins provided by the community, can be found in the registry atplugins.cordova.io. You can use the CLI to search for plugins from this registry. For example, searching for bar and codeproduces a single result that matches both terms as case-insensitive substrings:
    $ cordova plugin search bar code

    com.phonegap.plugins.barcodescanner - Scans Barcodes
Searching for only the bar term yields and additional result:
    org.apache.cordova.statusbar - Cordova StatusBar Plugin
The cordova plugin add command requires you to specify the repository for the plugin code. Here are examples of how you might use the CLI to add features to the app:
·         Basic device information (Device API):
  $ cordova plugin add org.apache.cordova.device
·         Network Connection and Battery Events:
  $ cordova plugin add org.apache.cordova.network-information
  $ cordova plugin add org.apache.cordova.battery-status
·         Accelerometer, Compass, and Geolocation:
  $ cordova plugin add org.apache.cordova.device-motion
  $ cordova plugin add org.apache.cordova.device-orientation
  $ cordova plugin add org.apache.cordova.geolocation
·         Camera, Media playback and Capture:
  $ cordova plugin add org.apache.cordova.camera
  $ cordova plugin add org.apache.cordova.media-capture
  $ cordova plugin add org.apache.cordova.media
·         Access files on device or network (File API):
  $ cordova plugin add org.apache.cordova.file
  $ cordova plugin add org.apache.cordova.file-transfer
·         Notification via dialog box or vibration:
  $ cordova plugin add org.apache.cordova.dialogs
  $ cordova plugin add org.apache.cordova.vibration
·         Contacts:
  $ cordova plugin add org.apache.cordova.contacts
·         Globalization:
  $ cordova plugin add org.apache.cordova.globalization
·         Splashscreen:
  $ cordova plugin add org.apache.cordova.splashscreen
·         Open new browser windows (InAppBrowser):
  $ cordova plugin add org.apache.cordova.inappbrowser
·         Debug console:
  $ cordova plugin add org.apache.cordova.console
NOTE: The CLI adds plugin code as appropriate for each platform. If you want to develop with lower-level shell tools or platform SDKs as discussed in the Overview, you need to run the Plugman utility to add plugins separately for each platform. (For more information, see Using Plugman to Manage Plugins.)
Use plugin ls (or plugin list, or plugin by itself) to view currently installed plugins. Each displays by its identifier:
    $ cordova plugin ls    # or 'plugin list'
    [ 'org.apache.cordova.console' ]
To remove a plugin, refer to it by the same identifier that appears in the listing. For example, here is how you would remove support for a debug console from a release version:
    $ cordova plugin rm org.apache.cordova.console
    $ cordova plugin remove org.apache.cordova.console    # same
You can batch-remove or add plugins by specifying more than one argument for each command:
    $ cordova plugin add org.apache.cordova.console org.apache.cordova.device
When adding a plugin, several options allow you to specify from where to fetch the plugin. The examples above use a well-knownregistry.cordova.io registry, and the plugin is specified by the id:
    $ cordova plugin add org.apache.cordova.console
The id may also include the plugin's version number, appended after an @ character. The latest version is an alias for the most recent version. For example:
    $ cordova plugin add org.apache.cordova.console@latest
    $ cordova plugin add org.apache.cordova.console@0.2.1
If the plugin is not registered at registry.cordova.io but is located in another git repository, you can specify an alternate URL:
    $ cordova plugin add https://github.com/apache/cordova-plugin-console.git
The git example above fetches the plugin from the end of the master branch, but an alternate git-ref such as a tag or branch can be appended after a # character:
    $ cordova plugin add https://github.com/apache/cordova-plugin-console.git#r0.2.0
If the plugin (and its plugin.xml file) is in a subdirectory within the git repo, you can specify it with a : character. Note that the # character is still needed:
    $ cordova plugin add https://github.com/someone/aplugin.git#:/my/sub/dir
You can also combine both the git-ref and the subdirectory:
    $ cordova plugin add https://github.com/someone/aplugin.git#r0.0.1:/my/sub/dir
Alternately, specify a local path to the plugin directory that contains the plugin.xml file:
    $ cordova plugin add ../my_plugin_dir
While Cordova allows you to easily deploy an app for many different platforms, sometimes you need to add customizations. In that case, you don't want to modify the source files in various www directories within the top-level platforms directory, because they're regularly replaced with the top-level www directory's cross-platform source.
Instead, the top-level merges directory offers a place to specify assets to deploy on specific platforms. Each platform-specific subdirectory within merges mirrors the directory structure of the www source tree, allowing you to override or add files as needed. For example, here is how you might uses merges to boost the default font size for Android and Amazon Fire OS devices:
·         Edit the www/index.html file, adding a link to an additional CSS file, overrides.css in this case:
  <link rel="stylesheet" type="text/css" href="css/overrides.css" />
·         Optionally create an empty www/css/overrides.css file, which would apply for all non-Android builds, preventing a missing-file error.
·         Create a css subdirectory within merges/android, then add a corresponding overrides.css file. Specify CSS that overrides the 12-point default font size specified within www/css/index.css, for example:
  body { font-size:14px; }
When you rebuild the project, the Android version features the custom font size, while others remain unchanged.
You can also use merges to add files not present in the original www directory. For example, an app can incorporate a back button graphic into the iOS interface, stored in merges/ios/img/back_button.png, while the Android version can instead capture backbutton events from the corresponding hardware button.
Cordova features a couple of global commands, which may help you if you get stuck or experience a problem. The helpcommand displays all available Cordova commands and their syntax:
$ cordova help
$ cordova        # same
Additionally, you can get more detailed help on a specific command. For example:
$ cordova run --help
The info command produces a listing of potentially useful details, such as currently installed platforms and plugins, SDK versions for each platform, and versions of the CLI and node.js:
$ cordova info
It both presents the information to screen and captures the output in a local info.txt file.
NOTE: Currently, only details on iOS and Android platforms are available.
After installing the cordova utility, you can always update it to the latest version by running the following command:
    $ sudo npm update -g cordova
Use this syntax to install a specific version:
    $ sudo npm install -g cordova@3.1.0-0.2.0
Run cordova -v to see which version is currently running. Run the npm info command for a longer listing that includes the current version along with other available version numbers:
    $ npm info cordova
Cordova 3.0 is the first version to support the command-line interface described in this section. If you are updating from a version prior to 3.0, you need to create a new project as described above, then copy the older application's assets into the top-level wwwdirectory. Where applicable, further details about upgrading to 3.0 are available in the Platform Guides. Once you upgrade to the cordova command-line interface and use npm update to stay current, the more time-consuming procedures described there are no longer relevant.
Cordova 3.0+ may still require various changes to project-level directory structures and other dependencies. After you run the npm command above to update Cordova itself, you may need to ensure your project's resources conform to the latest version's requirements. Run a command such as the following for each platform you're building:
    $ cordova platform update android
    $ cordova platform update ios
    ...etc.