title: Volley timeout error attempting to POST to localhost
body: <p>I've battling a volley timeout error when attempting to post a registration form to a <code>localhost (WAMP)</code> for testing purposes. I've been looking at the code for sometime and cannot seem to find the issue. Timeout errors from what I understand are generally due to connection issues. I don't seem to be getting any errors via logcat, and the URL to my localhost php file seem to be correct.</p>
  
  <p>I hope it's something small. In my db_function.php file, I did <code>(include/connectiondb.php)</code> but not sure if its correct. I originally had <code>(connectiondb.php)</code> but still no go.</p>
  
  <p>Any assistance is appreciated.</p>
  
  <p>All my code is below.</p>
  
  <p>database details</p>
  
  <pre><code>CREATE TABLE jobseekerusers (
  jobSeekerId int,
  jobSeekerFirstName VARCHAR,
  jobSeekerLastName VARCHAR,
  jobSeekerEmaiLAddress VARCHAR,
  jobSeekerPasswordVARCHAR,
  );
  </code></pre>
  
  <p>connectdb.php</p>
  
  <pre><code>&lt;?php
  
  define('DB_HOST', 'localhost');
  define('DB_USER', 'root');
  define('DB_PASSWORD', '');
  define('DB_DATABASE', 'Discover');
  
  $con = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_DATABASE);
  
  
  ?&gt;
  </code></pre>
  
  <p>db_function.php</p>
  
  <pre><code>&lt;?php
  if($_SERVER['REQUEST_METHOD']=='POST')
  {
  $jobFirstName = $_POST['jobFirstName'];
  $jobLastName = $_POST['jobLastName'];
  $jobEmailAddress = $_POST['jobEmailAddress'];
  $jobPassword = $_POST['jobPassword'];
  
  require_once('include/connectdb.php');
  
  $sql = "INSERT INTO jobseekerusers(jobSeekerFirstName, jobSeekerLastName, 
  jobSeekerEmailAddress, jobSeekerPassword)
  values ('$jobFirstName', '$jobLastName', '$jobEmailAddress', 
  '$jobPassword')";
  if(mysql_query($con,$sql))
  {
      echo "Success";
  }
  else
  {
      echo "Fail";
  }
  
  }
  else
  {
  echo "Something Failed";
  }
  ?&gt;
  </code></pre>
  
  <p>job_seeker_sign_up.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#FFFFFF"
  android:fitsSystemWindows="true"&gt;
  
  &lt;RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="180dp"
          android:background="@drawable/shape_gradient_orange"
          android:gravity="center"
          android:orientation="vertical"&gt;
  
          &lt;ImageView
              android:layout_width="80dp"
              android:layout_height="80dp"
              android:src="@drawable/search_icon" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/app_full_name"
              android:textColor="#FAFAFA"
              android:textSize="20sp" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="350dp"
          android:layout_height="320dp"
          android:paddingBottom="20dp"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="160dp"
          android:background="@drawable/border"
          android:id="@+id/cardView"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:weightSum="6"
              android:orientation="vertical"&gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:layout_weight="1"
                  android:padding="10dp"
                  android:text="@string/signUp"
                  android:textSize="20dp" /&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="vertical"&gt;
  
                  &lt;EditText
                      android:id="@+id/jobFirstName"
                      android:layout_width="match_parent"
                      android:layout_height="50dp"
                      android:layout_gravity="center"
                      android:singleLine="true"
                      android:layout_weight="1"
                      android:layout_marginTop="15dp"
                      android:background="#FAFAFA"
                      android:drawableLeft="@mipmap/rate"
                      android:drawablePadding="10dp"
                      android:hint="@string/employerFirstName"
                      android:maxLines="1"
                      android:textSize="15sp" /&gt;
  
                  &lt;EditText
                      android:id="@+id/jobLastName"
                      android:layout_width="match_parent"
                      android:layout_height="50dp"
                      android:layout_gravity="center"
                      android:layout_marginTop="15dp"
                      android:singleLine="true"
                      android:layout_weight="1"
                      android:background="#FAFAFA"
                      android:drawableLeft="@mipmap/employer_icon"
                      android:drawablePadding="10dp"
                      android:hint="@string/employerLastName"
                      android:maxLines="1"
                      android:textSize="15sp" /&gt;
  
                  &lt;EditText
                      android:id="@+id/jobEmailAddress"
                      android:layout_width="match_parent"
                      android:layout_height="50dp"
                      android:inputType="textEmailAddress"
                      android:layout_gravity="center"
                      android:singleLine="true"
                      android:layout_marginTop="15dp"
                      android:background="#FAFAFA"
                      android:layout_weight="1"
                      android:drawableLeft="@mipmap/email_icon"
                      android:drawablePadding="10dp"
                      android:hint="@string/employerEmailAddress"
                      android:maxLines="1"
                      android:textSize="15sp" /&gt;
  
                  &lt;EditText
                      android:id="@+id/jobPassword"
                      android:inputType="textPassword"
                      android:layout_width="match_parent"
                      android:layout_height="50dp"
                      android:singleLine="true"
                      android:layout_gravity="center"
                      android:layout_marginTop="15dp"
                      android:layout_weight="1"
                      android:background="#FAFAFA"
                      android:drawableLeft="@mipmap/password_icon"
                      android:drawablePadding="10dp"
                      android:hint="@string/employerPassword"
                      android:maxLines="1"
                      android:textSize="15sp" /&gt;
  
  
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
  
  
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_below="@+id/cardView"
          android:gravity="center"
          android:orientation="vertical"
          android:layout_height="wrap_content"&gt;
          &lt;Button
              android:id="@+id/jobSubmit"
              android:layout_width="200dp"
              android:layout_marginTop="10dp"
              android:textColor="#FAFAFA"
              android:layout_height="wrap_content"
              android:text="Submit"
              android:background="@drawable/shape_gradient_orange"/&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:id="@+id/jobHaveAccount"
              android:layout_height="wrap_content"
              android:textColor="#999"
              android:padding="10dp"
              android:text="@string/haveAccount"/&gt;
      &lt;/LinearLayout&gt;
  
  
     &lt;/RelativeLayout&gt;
  
  
   &lt;/ScrollView&gt;
  </code></pre>
  
  <p>jobSeekerPage.java</p>
  
  <pre><code>package com.example.dennis.discover;
  
  import android.app.DownloadManager;
  import android.content.Intent;
  import android.provider.ContactsContract;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.view.WindowManager;
  import android.widget.Button;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.android.volley.AuthFailureError;
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.StringRequest;
  import com.android.volley.toolbox.Volley;
  
  import org.w3c.dom.Text;
  
  import java.util.HashMap;
  import java.util.Map;
  
  public class JobSeekerSignUp extends AppCompatActivity implements 
  View.OnClickListener {
  private TextView jobHaveAccount;
  private TextView jobFirstName;
  private TextView jobLastName;
  private TextView jobEmailAddress;
  private TextView jobPassword;
  private Button jobSubmit;
  String URL = "http://192.168.0.9/Discover/db_functions.php";
  public static final String FIRSTNAME = "jobSeekerFirstName";
  public static final String LASTNAME = "jobSeekerLastName";
  public static final String EMAILADDRESSID = "jobSeekerEmailAddress";
  public static final String PASSWORD = "jobSeekerPassword";
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_job_seeker_sign_up);
  
      jobHaveAccount = (TextView) findViewById(R.id.jobHaveAccount);
      jobFirstName = (TextView) findViewById(R.id.jobFirstName);
      jobLastName = (TextView) findViewById(R.id.jobLastName);
      jobEmailAddress = (TextView) findViewById(R.id.jobEmailAddress);
      jobPassword = (TextView) findViewById(R.id.jobPassword);
      jobSubmit = (Button) findViewById(R.id.jobSubmit);
      jobSubmit.setOnClickListener(this);
  
  
  
      jobHaveAccount.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Intent jobSeekerSignIn = new Intent(JobSeekerSignUp.this, 
   JobSeekerLogIn.class);
              startActivity(jobSeekerSignIn);
          }
      });
  
    }
  
  @Override
  public void onClick(View view) {
  
      final String firstName = jobFirstName.getText().toString().trim();
      final String lastName = jobLastName.getText().toString().trim();
      final String emailAddress = jobEmailAddress.getText().toString().trim();
      final String password = jobPassword.getText().toString().trim();
  
   //Initiate request queue
      RequestQueue requestQueue = Volley.newRequestQueue(this);
   //get String Response using URL (variable defined above - currently WAMP)
      StringRequest stringrequest = new StringRequest(Request.Method.POST, 
   URL, new Response.Listener&lt;String&gt;() {
          @Override
          public void onResponse(String response) {
              Toast.makeText(JobSeekerSignUp.this, response, 
   Toast.LENGTH_LONG).show();
          }
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              Toast.makeText(JobSeekerSignUp.this, error.toString(), 
    Toast.LENGTH_LONG).show();
          }
      })
      {
          @Override
          protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
  
              Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
              params.put(FIRSTNAME, firstName);
              params.put(LASTNAME, lastName);
              params.put(EMAILADDRESSID, emailAddress);
              params.put(PASSWORD, password);
  
  
              return super.getParams();
          }
      };
  
      // Adding the request to the request queue
      requestQueue.add(stringrequest);
  
   }
  
  
  }
  </code></pre>