Need backup on PHP =(((

Get help using Construct 2

Post » Wed Mar 09, 2016 10:45 am

exactly nothing work as should be. ajax post dictionary.asjson, in database dict.json looks like {quot;quot and some values and so on}. in my code i didn't understand where and what i must to place or write. no injection protection is correnctly needed. just, help with the code, to make it work.
The whole life is in the movement.Stopped - fell asleep to hell...
B
14
S
3
G
1
Posts: 122
Reputation: 1,694

Post » Wed Mar 09, 2016 11:09 am

here is what load.php returns in ajax.last data

{"c2dictionary":true,"data":{"vin":"123123123","year":"2015","mod":"A-classe","phone":"123","fio":"olejjon123","mark":"mercedes","count":1}}

here, is the code to retrive this data

$r1 = mysql_query("SELECT data FROM `data` WHERE `login`='".$login."' AND `pass`='".$pass."'");
$result = mysql_fetch_array($r1);
$r1=$result['data'];
echo $r1;


and dictionary must load json.ajax.lastdata. but he didn't do it. all keys are 0 =(((


here is the code, that sending to DB dictionary.asjsonstring from c2 project:

$q1 = mysql_query("SELECT login FROM `data` WHERE `login`='".$login."'");
$loginb = mysql_fetch_array($q1);
$loginbd=$loginb['login'];
if($loginbd == $login){
echo("sorry,it's already here.");
exit();
}
else
$result2 = mysql_query ("INSERT INTO data (login,pass,data) VALUES('$login','$pass','$data')");
//$data is the dictionary.jsonstring which is sent by ajax.

if ($result2=='TRUE')
{
echo "success";
}
else {
echo "error";
}
The whole life is in the movement.Stopped - fell asleep to hell...
B
14
S
3
G
1
Posts: 122
Reputation: 1,694

Previous

Return to How do I....?

Who is online

Users browsing this forum: sypher1987 and 5 guests