I have a j2me file which allows the user to regester by entering their name and password. when they press submit it connects to a url:http://localhost/SMSRegistration.php and sends the information:
http://localhost/SMSRegistration.ph...tField@ea0ef881
I need a php file to pick up the password and enter it into a SQL database, I am using phpmyadmin.
The problem is that it is not picking it up or it is not inserting it into the database? Is there any way to print the incoming value so that I know if the j2me file is actually sending the info?
the j2me file sends the data like this:
try
{
// Create the connection
http = (HttpConnection) Connector.open(url + “?password=” + password);
System.out.println(url + “?password=” + password);
// 1) Send request method
http.setRequestMethod(HttpConnection.POST);
}
Here is my php file, it is very basic:
<?php if (isset($_REQUEST['password'])) { // create short variable names $password=$_REQUEST['password']; $db_conn = mysql_connect('localhost', 'root'); mysql_select_db('auth', $db_conn); $query = "insert into auth value ('".$password."')"; if (!$db) { echo 'Error: Could not connect to database. Please try again later.'; exit; } } ?>