Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5938567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:42:16+00:00 2026-05-22T15:42:16+00:00

my java function private void adddataintophp(String title, String date, String time, String channel){ ArrayList<NameValuePair>

  • 0

my java function

private void adddataintophp(String title, String date, String time, String channel){
    ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
    //http post
    try{
        nameValuePairs.add(new BasicNameValuePair("Title", title));
        nameValuePairs.add(new BasicNameValuePair("Date", date));
        nameValuePairs.add(new BasicNameValuePair("Time", time));
        nameValuePairs.add(new BasicNameValuePair("Channel", channel));
        HttpClient httpclient = new DefaultHttpClient();
        HttpPost httppost = new HttpPost("http://10.0.2.2/insertprogram.php");
        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        HttpResponse response = httpclient.execute(httppost);
        HttpEntity entity = response.getEntity();
        is = entity.getContent();
    }catch(Exception e){
        Log.e("log_tag", "Error in http connection"+e.toString());
    }
}

my php code

<?php
$title = $_POST['Title'];
$date = $_POST['Date'];
$time = $_POST['Time'];
$channel = $_POST['Channel'];
mysql_connect("localhost","root","");
mysql_select_db("imammuda");
$sql=mysql_query("insert into Program (ID, Title, Date, Time, Channel) values ('NULL', '$title', '$date', '$time', '$channel')");
mysql_close();
?>

when i execute it, then i go database there and see.

It was added but with null value.

So, my question is how to pass the value that get by edittext in java into php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:42:16+00:00Added an answer on May 22, 2026 at 3:42 pm

    You’re doing a POST request from within Java, but read the GET request inside your PHP code. When posting your data, it won’t show up in the URL, where the data should be according to the GET verb.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following Function is executing in its own thread: private void doSendData() { try
I saw a java function that looked something like this- public static<T> foo() {...}
Is there any Java function or util class which does rounding this way: func(3/2)
How do I return a vector in a java function. I want to unserialize
I need a java script function that converts the document object of the current
I have a java script function that i have called on body load mousemove()
I have a problem using the Java search function in Eclipse on a particular
When overriding the equals() function of java.lang.Object, the javadocs suggest that, it is generally
I have a calc function in java script that takes three integer parameters, following
I need this for calling a C function from Java class (JNI) and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.