but here one little thing===>>>
code for posting to php:
<?php
//?????????? ? ?????????? ?????? ??? ??????? ? ??
$mysql_host = "localhost";
$mysql_database = "123123123";
$mysql_user = "123123123";
$mysql_password = "123123123";
$link = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die("???????? ?????...");
mysql_select_db($mysql_database, $link) or die ("??...");//???????????? ? ????
Header('Access-Control-Allow-Origin: *');
Header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
Header("Content-Type: text/html; charset=UTF-8");
if (isset($_POST['login'])) { $login = $_POST['login']; if ($login == '') { unset($login);} }
if (isset($_POST['pass'])) { $pass=$_POST['pass']; if ($pass =='') { unset($pass);} }
if (isset($_POST['data'])) { $data=$_POST['data']; if ($data =='') { unset($data);} }
if (empty($login) or empty($pass) or empty($data))
{
echo ("?? ????? ?? ??? ??????????, ????????? ??? ????!");
exit();
}
$login = stripslashes($login);
$login = htmlspecialchars($login);
$pass = stripslashes($pass);
$pass = htmlspecialchars($pass);
$data = stripslashes($data);
$data = htmlspecialchars($data);
$login = trim($login);
$pass = trim($pass);
$data = trim($data);
$q1 = mysql_query("SELECT login FROM `data` WHERE `login`='".$login."'");
$loginb = mysql_fetch_array($q1);
$loginbd=$loginb['login'];
if($loginbd == $login){
echo("????????, ????????? ???? ????? ??? ???????????????.");
exit();
}
else
$result2 = mysql_query ("INSERT INTO data (login,pass,data) VALUES('$login','$pass','$data')");
if ($result2=='TRUE')
{
echo "?? ??????? ????????????????!";
}
else {
echo "??????! ?? ?? ????????????????.";
}
?>
and the code to retrive data to c2dictionary:
<?php
//?????????? ? ?????????? ?????? ??? ??????? ? ??
$mysql_host = "localhost";
$mysql_database = "123123123";
$mysql_user = "123123123";
$mysql_password = "123123123";
$link = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die("???????? ?????...");
mysql_select_db($mysql_database, $link) or die ("??...");//???????????? ? ????
Header('Access-Control-Allow-Origin: *');
Header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
Header("Content-Type: text/html; charset=UTF-8");
//????????? ??????? ???????????? ??????
if (isset($_POST['loglog'])) { $login = $_POST['loglog']; if ($login == '') { unset($login);} }
if (isset($_POST['passwordlog'])) { $pass=$_POST['passwordlog']; if ($pass =='') { unset($pass);} }
if (empty($login) or empty($pass))
{
echo ("?? ????? ?? ??? ??????????, ????????? ??? ????!");
exit();
}
$login = stripslashes($login);
$login = htmlspecialchars($login);
$pass = stripslashes($pass);
$pass = htmlspecialchars($pass);
$data = stripslashes($data);
$data = htmlspecialchars($data);
$login = trim($login);
$pass = trim($pass);
$data = trim($data);
//????????? ??????? ?????????? ????????
if(isset($login) && isset($pass)){
//?????? ? ?? ?? ????????? ?????? ??????
$q1 = mysql_query("SELECT login FROM `data` WHERE `login`='".$login."' AND `pass`='".$pass."'");
$loginb = mysql_fetch_array($q1);
$loginbd=$loginb['login'];
$q2 = mysql_query("SELECT pass FROM `data` WHERE `login`='".$login."' AND `pass`='".$pass."'");
$passwordb = mysql_fetch_array($q2);
$passwordbd=$passwordb['pass'];
if($passwordbd == $pass){
$r1 = mysql_query("SELECT data FROM `data` WHERE `login`='".$login."' AND `pass`='".$pass."'");
$row = mysql_fetch_array($r1); // ?? ? ??????
$arr = array('c2dictionary' => 'true',
'data' => array('vin' => $row['vin'], 'year' => $row['year'],'mod' => $row['mod'],'phone' => $row['phone'],'fio' => $row['fio'],'mark' => $row['mark'])); // ?????? ???????? ?????? ???????
echo json_encode($arr);
}
//???? ?? ?????? ?????? ?? ??????? 1qqqq
else{
echo '? ???? ??? ?? ??????? ?????????';
}
}
?>
and here is the question - where i'm mistayken? no data recieve at all =((((