• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
  • Piet Souris
  • Mikalai Zaikin

How to post data from android app to php page

Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear friends,

I would like to find out how do i go about posting data into a php scripted file on a webserver??

Alex Koh

Below is the code which i had implemented but does not seems to work. Also posted is the php script.

This is the php file.

PHP Insert

<form action="insert.php" method="post">

Key information
<input type="text" name="information" />

<input type="submit" name="submit" value="Click Me">

if(isset($_POST['submit'])==true) {
$information = $_POST["information"];
print("You are welcome");
$con = mysql_connect("localhost:3306","RICHARD","1234");
if (!$con)
die('Could not connect: ' . mysql_error());

mysql_select_db("dip", $con);
mysql_query("INSERT INTO post (word)
//$information = "JUST WORLD0";
//$query = "(INSERT INTO post(word) VALUES ('" + "EXAMPLE" + "')";
$query = "INSERT INTO post(word) VALUES ('$information')";
//$result = mysql_query("SELECT ssn FROM employee WHERE fullname = '$tmpVar'");
//$query = " INSERT INTO post (word)
//VALUES ('qqqq')";

A wop bop a lu bop a womp bam boom! Tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic