Saturday, December 26, 2015

Top 38 SEO Interview Questions & Answers




1) What is SEO and introduce its types?

Search engine optimization (SEO)  is a process to visibility the position of a web page or website in a search engine results by using keywords or phrases.

Two Types of SEO are:

    On Page Optimization
    Off Page Optimization

2) What are the SEO tools do you use?

The SEO tools that I use are Google analytic, keyword search, Alexa, open site explorer, Google Webmaster.

3) What do you mean by Backlink?

 The incoming links to your website or webpage is referred as Back link.

4) What are out bound Links?

The outbound links are our website links to other webpage or website.

5) Can you tell me something about Googlebot?

To index a webpage Google uses the Googlebot software. Caching, Crawling and indexing of a webpage are done through Googlebot by collecting details from that webpage.

Seo

6) What is Cross linking and what are the function of Cross linking?

    Cross linking is used to refer the process of linking one website to another website and provide a way to allow the accessing to it.
    It provides the users with reference sites that consists the content related to the search.
    It doesn’t need to be owned by the same person as it provides the methods that have been built on the Internet.
    It serves the purpose to display the page on the search engines using search engine optimization techniques and methods.
    The website ranking is calculated on the basis of the relevance of the sites and then it is reflected on the search engine.
    It uses SEO tools that provide reciprocal links and inbound links that can be used as our SEO.

7) What is the main purpose of using keyword in SEO?

Keyword is a single word, and while a combination of those keywords makes phrases. These keywords or phrases are used by the search engines to populate the subjects over the internet. Search engine stores keywords in the database, and when search is done, it will come up with the best possible match.

8) Can you mention the functions of body content relevance?

Whenever there is a text that does not have images on the web page is referred as body content relevance or non-image text. It helps in good optimization of the sites and also to improve your ranking in the search engine.

9) What are Spiders, Robots and Crawlers and what are their functions?

Spiders, robot and crawler, they are all same and referred by different names. It is a software program that follows, or “Crawls” different links throughout the internet, and then grabs the content from the sites and adds to the search engine indexes.

10) What does it mean if nothing appears on doing search on the domain?

On doing search on your domain and if nothing appears then there are three possibilities.

    May be the site is banned by search engines
    May be no index by search engines
    Some canonical issues

11)What is keyword stemming?

The process of finding out the root word from the search query is referred as keywords stemming.

12) Name some SEO blogs that you frequently read?

    Jimboykins
    Search Engine Land
    SEOSmarty
    MOZ
    Search Engine Journal

13) What do you mean by Cloaking?

Cloaking is a deceptive way of optimizing search. In this technique a different content will be searched by the search engine than what is presented or searched by the users.

14) How many types of Meta Tags are there in SEO and what are their characters limits?

There are two types Meta tags in SEO.

    Description Meta tag with 100- 150 characters limits
    Keyword Meta tag with 200 characters limits

15) How many characters limits in Title tag?

We can add 60-70 characters in title tag.

16) What is Google Sandbox?

Google sandbox is an imaginary area where new websites and their search rating are put on hold until they prove worthy for ranking. In other words, it checks the standard of the website.

17) Tell me something about Black Hat SEO?

In order to get a high ranking in search engine result page, websites go for various methods and techniques which are characterized by two categories. One method that is acceptable by search engine guidelines is known as White Hat SEO, while the other method which is not acceptable by search engine guidelines is known as Black Hat SEO.

18) Name few Black Hat SEO techniques?

    Link Farming
    Hidden text, etc.
    Gateway or Doorway pages
    Cloaking
    Keyword Stuffing

19) Can you differentiate between ‘nofollow’ and ‘dofollow’ link?

Nofollow links are not passed by search engines bot and therefore cannot be cached or indexed. Dofollow link is a kind of hyperlink and it passes through all search engines and it puts an impact over page rank.

20) What is the difference between PR (page rank) and SERP (Search engine result page)?

Page rank is calculated on the basis of quality inbound links from other website or webpages to our webpage or a website.

SERP (Search Engine Result page) is the placement of the website or web-pages which is returned by the search engine after a search query or attribute.

21) Why the Title Tag in website is valuable?

Title tags are very essential in SEO, as it tells about the contents on that web page. Through title tags only the search engine will tell the user, what is there in the page.

22) What is considered as more significant, creating content or building backlinks?

Both are necessary, creating quality content is equally important to building backlinks. Although, building backlinks are useful in building authority to a site and for ranking as well, quality content is the first element that is considered to be more responsible for ranking.

23) Can you mention the difference between SEO and SEM?

SEM (Search Engine Marketing), it is used for the promotion of website through Search Engine Result Page (SERP) , while to optimize the search result of your webpage or website SEO (Search Engine Optimization) is used.

24) What do you know about LSI?

LSI stands for Latent Semantic Indexing. This technique is established to obtain the data by relating the word to its closest counterparts or to its similar context. For example, if you are searching something with a keyword “CAR” it will show all the related things like classic cars, car auctions, Bentley car, car race etc.

25) How will you cross-check whether your SEO campaign is working or not?

To check whether your SEO campaign is working or not, the first approach is to check the websites statistics, which tells you about the origin of traffic.  The other way of checking is to make a search based on the relevant keywords and key phrases and look for the search result. The number of search result will tell you whether your SEO campaign is working or not.

26) What is the meaning of competitive analysis?

Competitive analysis does the comparison, between the website I am optimizing, and the website that is ranked highly in search results.

27) What will be your next steps if your SEO methods or technique does not work?

My first attempt would to try analysis the problem and resolve them step by step

    Firstly I would try to see whether it is a new project, and then like to re-check the key words.
    Also, I would look for relevant key-words that can be helpful.
    Even though the webpage and website has been indexed well and still not appearing on the first 10 pages of search engine result page, then I would make some changes in page text, titles and description.
    If website is not indexed well or dropped from the index, than it might comprises     serious issues and re-work might be required.

28) What is PPC?

PPC stands for Pay Per Click and is an advertisement campaign hosted by Google.  It is segmented into two modules CPC ( Cost per click) and CPM ( Cost per thousand impressions) through flat rate and bidding respectively. In CPC, if the user clicks on the advert, only then the advertiser will be charged.

29) What is 301 redirect?

It is a method by which the user is redirected to new page url to old page url . It is a permanent redirect and it is also useful in directing link juice to new url from old url .

30) What are Webmaster tools?

Webmaster tool is a service provided by Google from where you can get backlink information, crawl errors, search queries, Indexing data, CTR etc.

31) What is keyword density and what is the formula for knowing keyword density?

From SEO point of view, keyword density will definitely help to stand out your content from others. The formula to know the keyword density is ( Total number of keyword/ total number of words in your article) multiply by 100.

32) What is robots.txt?

Robots.txt is a text file. It is through this file, it gives instruction to search engine crawlers about indexing and caching of a webpage, file of a website or directory, domain.

33) What will you do, for the company website you are working for, decides to move all the contents to new domain?

The first step would be to update the previous site with a permanent redirect to new page for all the pages. After that, I will remove the previous content from search engine in order to avoid duplicate content issues.

34) Can you optimize the website which has pages in millions?

From SEO point of view, for dynamic website, special additional SEO stuffs have to be    implemented.

    Good Internal link structure
    Generation of dynamic title and description
    Dynamic XML sitemap generation

35) What is the latest update in SEO?

The latest updates in SEO are:

    Panda
    Penguin

Bonus! 3 More!

36) What are the key aspects of Panda update?

Panda is to improve the search in Google. The latest version has focused on quality content, proper design, proper speed, proper use of images and many more.

37) What are the key aspects of Penguin update?

Penguin is the code name for Google algorithm. Its main target is to decrease the ranking of that website that are violating the Google Webmaster guidelines. These guidelines are violated by using black hat techniques like cloaking and stuffing.

38) How will you neutralize a toxic link to your website?
Through Backlink Quality Checker you can know who links to your website. Now, you have to go to ‘ Toxic link’ report, where you will find all the links, that are harmful to your websites. If there is any link in ‘ Toxic link report’ that matches with the link on your website, then you can remove it by using ‘Google Disavov tool’.

Latest PHP Technical Interview Questions & Answers for Freshers



What is the latest current version of PHP?
php 5.3

What are the differences between GET and POST methods in form submitting?
On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.
On the browser side, the difference is that data submitted by the GET method will be displayed in the browser’s address field. Data submitted by the POST method will not be displayed anywhere on the browser.
GET method is mostly used for submitting a small amount and less sensitive data.
POST method is mostly used for submitting a large amount or sensitive data.
Explain the different types of errors in PHP.
Notices, Warnings and Fatal errors are the types of errors in PHP
Notices:
Notices represents non-critical errors, i.e. accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all but whenever required, you can change this default behavior.
Warnings: 
Warnings are more serious errors but they do not result in script termination. i.e calling include() a file which does not exist. By default, these errors are displayed to the user.
Fatal errors:
Fatal errors are critical errors i.e. calling a non-existent function or class. These errors cause the immediate termination of the script.

What are the differences between require and include?
Both include and require used to include a file but when included file not found
Include send Warning where as Require send Fatal Error .

How to find current date and time?
The date() function provides you with a means of retrieving the current date and time, applying the format integer parameters indicated in your script to the timestamp provided or the current local time if no timestamp is given. In simplified terms, passing a time parameter is optional - if you don't, the current timestamp will be used. Where as time function returns current Unix timestamp.
How can we get second of the current time using date function?
$second = date("s");
How to increase the execution time of a php script?
To Change max_execution_time variable in php.ini file .By Default time is 30 seconds.
The file path is xampp/php/php.ini if xampp software is using.
What does a special set of tags do in PHP?
In PHP special tags the use of this Tags are The output is displayed directly to the browser.
What is meant by nl2br()?
Inserts HTML line breaks (
) before all newlines in a string.
What is use of header() function in php ? What is the limitation of HEADER()?
In PHP Important to notice the Limitation of HEADER() function is that header() must be called before any actual output is send. Means must use header function before HTML or any echo statement
There are Number of Use of HEADER() function in php like below
1> The header() function use to sends a raw HTTP header to a client.
2> We can use header() function for redirection of pages.
3> Used to refresh the page on given time interval automatically.
4> To send email header content like cc, bcc , reply to etc data and lot more
How can we know the total number of elements of Array?
sizeof($array_var)
count($array_var)
If we just pass a simple var instead of a an array it will return 1.

Different Types of Tables in Mysql?
There are Five Types Tables in Mysql
1)INNODB
2)MYISAM
3)MERGE
4)HEAP
5)ISAM
What is the maximum length of a table name, a database name, or a field name in MySQL?
Database name: 64 characters
Table name: 64 characters
Column name: 64 characters
What is the difference between the functions unlink and unset?
unlink() deletes the given file from the file system.
unset() makes a variable undefined.
How can we convert asp pages to PHP pages?
There are lots of tools available for asp to PHP conversion. you can
search Google for that. the best one is available athttp://asp2php.naken.cc./
How can we set and destroy the cookie in php?
By using setcookie(name, value, expire, path, domain); function we can set the cookie in php ;
Set the cookies in past for destroy. like
setcookie("user", "sonia", time()+3600); for set the cookie
setcookie("user", "", time()-3600); for destroy or delete the cookies;

Monday, April 27, 2015

How to create PHP web service with JSON respond? For Android, Iphone or Web Application.

There is a list at the official PHP website: http://www.php.net/manual/en/refs.webservice.php You can see that PHP can work with OAuth, SCA, SOAP, Yar and XML-RPC. But there is another way which is so simple to create a webservice. It is JSON.

I will show how to create a simple web service with JSON. Our service will get the parameters by using $_GET , therefore we will put the parameters to url. For instance http://mywebserviceurl.com?s=myparameter , so the service will answer depending on myparameter.

Lets look at service's index file:

index.php
   
<?php

include('connectdb.php');

$something = $_GET['s'];
$sqlcode = mysql_query("Select $something from mydb limit 5 ");

$jsonObj= array();
while($result=mysql_fetch_object($sqlcode))
{
  $jsonObj[] = $result;
}

$final_res =json_encode($jsonObj) ;
echo $final_res;
 
?>

connectdb.php
   
<?php
    $hostname="localhost";
    $username=""; //write your username
    $password=""; //write your password
    $db_name=""; //write your db name
    $con=mysql_connect($hostname,$username,$password);
    mysql_select_db($db_name,$con) or die ("Cannot connect the Database");
    mysql_query("SET NAMES 'utf8'",$con);

?>

Thats all. You will see the JSON results on the screen. You can validate the JSON results with the help of some sites. Json validator addresses:

http://jsoneditor.net/
http://jsonlint.com/

How to get results of a web service?

Your application will ask this webservice something, then the service will give response with a json result. Your application should get the results with a reader to read the webservice's output.

In PHP, you can do that with file_get_contents() function. Here is an example of my php application:

readwebservice.php
<?php
$jsonObj = file_get_contents('http://mywebserviceurl.com/?s=myparameter');
$final_res = json_decode($jsonObj, true) ;
var_dump( $final_res );
?>

In Android, you can use JSONParser.java which you can find the whole codes at the following topic below. You can simply use jsonParser.getJSONFromUrl() function to read the results. Here is example:

UserFunctions.java

import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;
  /**
  * function make webservice Request
  * @param myparameter
  * */
 public JSONObject loginUser(String myparameter){
  String webserviceURL = "http://mywebserviceurl.com/";
  JSONParser jsonParser = new JSONParser();
  // Building Parameters
  List params = new ArrayList();
  params.add(new BasicNameValuePair("s", myparameter));
  JSONObject json = jsonParser.getJSONFromUrl(webserviceURL, params);
  // return json
  // Log.e("JSON", json.toString());
  return json;
 }

Thats all for a simple webservice example. Lets look at an complex example now.


PHP LOGIN WEBSERVICE AND HOW TO USE IT IN ANDROID APP

If you want to create more complex webservices, I am gonna give you an example which is for "login" control. (If you want to look at my source files, you can download full "PHP Login Webservice" from https://sourceforge.net/p/phploginwebservice/)

Put the php web service codes into a directory which name is "android_login_api", so you can reach the web service via "http://mywebserviceurl.com/android_login_api/" url link. Also you should create another directory for other web service needs like "search" or "post" etc. By this way, you can seperate the service codes in a logical manner.

In web service with PHP:
index.php (Web service)
   
<?php

/**
 * File to handle all API requests
 * Accepts GET and POST
 *
 * Each request will be identified by TAG
 * Response will be JSON data

 /**
 * check for POST request
 */
if (isset($_POST['tag']) && $_POST['tag'] != '') {
 // get tag
 $tag = $_POST['tag'];

 // include db handler
 require_once 'DB_Functions.php';
 $db = new DB_Functions();

 // response Array
 $response = array("tag" => $tag, "success" => 0, "error" => 0);

 // check for tag type
 if ($tag == 'login') {
      // Request type is check Login
      $email = $_POST['email'];
      $password = $_POST['password'];

      // check for user
      $user = $db->getUserByEmailAndPassword($email, $password);
      if ($user != false) {
          // user found
          // echo json with success = 1
          $response["success"] = 1;
          $response["uid"] = $user["unique_id"];
          $response["user"]["name"] = $user["name"];
          $response["user"]["email"] = $user["email"];
          $response["user"]["created_at"] = $user["created_at"];
          $response["user"]["updated_at"] = $user["updated_at"];
          echo json_encode($response);
      } else {
          // user not found
          // echo json with error = 1
          $response["error"] = 1;
          $response["error_msg"] = "Incorrect email or password!";
          echo json_encode($response);
      }
 } else if ($tag == 'register') {
      // Request type is Register new user
      $name = $_POST['name'];
      $email = $_POST['email'];
      $password = $_POST['password'];

      // check if user is already existed
      if ($db->isUserExisted($email)) {
          // user is already existed - error response
          $response["error"] = 2;
          $response["error_msg"] = "User already existed";
          echo json_encode($response);
      } else {
          // store user
          $user = $db->storeUser($name, $email, $password);
          if ($user) {
               // user stored successfully
               $response["success"] = 1;
               $response["uid"] = $user["unique_id"];
               $response["user"]["name"] = $user["name"];
               $response["user"]["email"] = $user["email"];
               $response["user"]["created_at"] = $user["created_at"];
               $response["user"]["updated_at"] = $user["updated_at"];
               echo json_encode($response);
         } else {
               // user failed to store
               $response["error"] = 1;
               $response["error_msg"] = "Error occured in Registartion";
               echo json_encode($response);
         }
      }
 } else {
  echo "Invalid Request";
 }
} else {
 echo "Access Denied";
}
?>

DB_Functions.php (Web service)

   
<?php
class DB_Functions {

    private $db;

    //put your code here
    // constructor
    function __construct() {
        require_once 'DB_Connect.php';
        // connecting to database
        $this->db = new DB_Connect();
        $this->db->connect();
    }

    // destructor
    function __destruct() {
        
    }

    /**
     * Storing new user
     * returns user details
     */
    public function storeUser($name, $email, $password) {
        $uuid = uniqid('', true);
        $hash = $this->hashSSHA($password);
        $encrypted_password = $hash["encrypted"]; // encrypted password
        $salt = $hash["salt"]; // salt
        $result = mysql_query("INSERT INTO users(unique_id, name, email, encrypted_password, salt, created_at) VALUES('$uuid', '$name', '$email', '$encrypted_password', '$salt', NOW())");
        // check for successful store
        if ($result) {
            // get user details
            $uid = mysql_insert_id(); // last inserted id
            $result = mysql_query("SELECT * FROM users WHERE uid = $uid");
            // return user details
            return mysql_fetch_array($result);
        } else {
            return false;
        }
    }

    /**
     * Get user by email and password
     */
    public function getUserByEmailAndPassword($email, $password) {
        $result = mysql_query("SELECT * FROM users WHERE email = '$email'") or die(mysql_error());
        // check for result
        $no_of_rows = mysql_num_rows($result);
        if ($no_of_rows > 0) {
            $result = mysql_fetch_array($result);
            $salt = $result['salt'];
            $encrypted_password = $result['encrypted_password'];
            $hash = $this->checkhashSSHA($salt, $password);
            // check for password equality
            if ($encrypted_password == $hash) {
                // user authentication details are correct
                return $result;
            }
        } else {
            // user not found
            return false;
        }
    }

    /**
     * Check user is existed or not
     */
    public function isUserExisted($email) {
        $result = mysql_query("SELECT email from users WHERE email = '$email'");
        $no_of_rows = mysql_num_rows($result);
        if ($no_of_rows > 0) {
            // user existed
            return true;
        } else {
            // user not existed
            return false;
        }
    }

    /**
     * Encrypting password
     * @param password
     * returns salt and encrypted password
     */
    public function hashSSHA($password) {

        $salt = sha1(rand());
        $salt = substr($salt, 0, 10);
        $encrypted = base64_encode(sha1($password . $salt, true) . $salt);
        $hash = array("salt" => $salt, "encrypted" => $encrypted);
        return $hash;
    }

    /**
     * Decrypting password
     * @param salt, password
     * returns hash string
     */
    public function checkhashSSHA($salt, $password) {

        $hash = base64_encode(sha1($password . $salt, true) . $salt);

        return $hash;
    }
}

?>

DB_Connect.php (Web service)

   
<?php
class DB_Connect {

    // constructor
    function __construct() {
        
    }

    // destructor
    function __destruct() {
        // $this->close();
    }

    // Connecting to database
    public function connect() {
        /**
         * Database config variables
         */
         define("DB_HOST", "localhost");
         define("DB_USER", "my_db_user");
         define("DB_PASSWORD", "my_db_pass");
         define("DB_DATABASE", "my_db_name");

        // connecting to mysql
        $con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
        // selecting database
        mysql_select_db(DB_DATABASE);

        // return database handler
        return $con;
    }

    // Closing database connection
    public function close() {
        mysql_close();
    }

}
?>

This is all for web service. Now you can go to Android app source codes. In Android:

JSONParser.java (Android)

   
package com.myapp.library;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.List;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

public class JSONParser {

 static InputStream is = null;
 static JSONObject jObj = null;
 static String json = "";

 // constructor
 public JSONParser() {

 }

 public JSONObject getJSONFromUrl(String url, List params) {

  // Making HTTP request
  try {
   // defaultHttpClient
   DefaultHttpClient httpClient = new DefaultHttpClient();
   HttpPost httpPost = new HttpPost(url);
   httpPost.setEntity(new UrlEncodedFormEntity(params));

   HttpResponse httpResponse = httpClient.execute(httpPost);
   HttpEntity httpEntity = httpResponse.getEntity();
   is = httpEntity.getContent();

  } catch (UnsupportedEncodingException e) {
   e.printStackTrace();
  } catch (ClientProtocolException e) {
   e.printStackTrace();
  } catch (IOException e) {
   e.printStackTrace();
  }

  try {
   BufferedReader reader = new BufferedReader(new InputStreamReader(
     is, "iso-8859-1"), 8);
   StringBuilder sb = new StringBuilder();
   String line = null;
   while ((line = reader.readLine()) != null) {
    sb.append(line + "\n");
   }
   is.close();
   json = sb.toString();
   Log.e("JSON", json);
  } catch (Exception e) {
   Log.e("Buffer Error", "Error converting result " + e.toString());
  }

  // try parse the string to a JSON object
  try {
   jObj = new JSONObject(json);  
  } catch (JSONException e) {
   Log.e("JSON Parser", "Error parsing data " + e.toString());
  }

  // return JSON String
  return jObj;

 }
}


UserFunctions.java (Android)

package com.myapp.library;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;

import android.content.Context;

public class UserFunctions {
 
 private JSONParser jsonParser;
 
 private static String loginURL = "http://mywebserviceurl.com/android_login_api/";
 private static String registerURL = "http://mywebserviceurl.com/android_login_api/";
 
 private static String login_tag = "login";
 private static String register_tag = "register";
 
 // constructor
 public UserFunctions(){
  jsonParser = new JSONParser();
 }
 
 /**
  * function make Login Request
  * @param email
  * @param password
  * */
 public JSONObject loginUser(String email, String password){
  // Building Parameters
  List params = new ArrayList();
  params.add(new BasicNameValuePair("tag", login_tag));
  params.add(new BasicNameValuePair("email", email));
  params.add(new BasicNameValuePair("password", password));
  JSONObject json = jsonParser.getJSONFromUrl(loginURL, params);
  // return json
  // Log.e("JSON", json.toString());
  return json;
 }
 
 /**
  * function make Login Request
  * @param name
  * @param email
  * @param password
  * */
 public JSONObject registerUser(String name, String email, String password){
  // Building Parameters
  List params = new ArrayList();
  params.add(new BasicNameValuePair("tag", register_tag));
  params.add(new BasicNameValuePair("name", name));
  params.add(new BasicNameValuePair("email", email));
  params.add(new BasicNameValuePair("password", password));
  
  // getting JSON Object
  JSONObject json = jsonParser.getJSONFromUrl(registerURL, params);
  // return json
  return json;
 }
 
 /**
  * Function get Login status
  * */
 public boolean isUserLoggedIn(Context context){
  DatabaseHandler db = new DatabaseHandler(context);
  int count = db.getRowCount();
  if(count > 0){
   // user logged in
   return true;
  }
  return false;
 }
 
 /**
  * Function to logout user
  * Reset Database
  * */
 public boolean logoutUser(Context context){
  DatabaseHandler db = new DatabaseHandler(context);
  db.resetTables();
  return true;
 }
 
}

In your application, you can use this UserFunctions.java like that:

import com.myapp.library.UserFunctions;

Lets say our response JSON of webservice will be like that:


{ "success": 1,
  "user": {
     "name":"Seval",
     "email":"hello@hotmail.com"
   }
}

You can call parse the results in a function, for example "loginUser":

JSONObject json = userFunction.loginUser(email, password);

// check for login response
String res = json.getString("success");
if(Integer.parseInt(res) == 1){
   JSONObject json_user = json.getJSONObject("user");
   String name = json_user.getString("name");
   String email = json_user.getString("email");
}