<?php header("Access-Control-Allow-Origin: *"); ?> <?php $ecodedata = $_POST["postdata"]; $b= json_decode ($ecodedata); $qid= $b->qid; $pid= $b->pid; $ownid= $b->oid; // dont need base 64 as issue with special schars echo base64_decode($rname); //$jsonobj = '{"Peter":35,"Ben":37,"Joe":43}'; //$obj = json_decode($jsonobj); // echo $obj->Peter; ?> <?php require_once "configs.php"; $a=$aname; $b=$qname; $lastid=0; $sql='SELECT * FROM users '; $sql = "select id from lisa where fixaid=$qid and packid=$pid"; $res = $db->query($sql); $lastid=0; while ($row = $res->fetchArray()) { // echo "{$row['username']} {$row['company']}<br>"; $lastid++; } if ($lastid<1) { //$sql = "INSERT INTO lisa(packid, fixaid,ownlisaid) VALUES ('$pid', $qid,'$ownid')"; $sql = "INSERT INTO lisa(packid, fixaid) VALUES ($pid, $qid)"; $db->exec($sql) or die("Unable to add user "); } $c=$db->changes(); if ($c>0) echo "OK"; else echo "Already there"; exit; $qlastid="q".$lastid; $sql = "update items set code='$qlastid' where id = $lastid;"; if ($link->connect_error) { die("Connection failed: " . $link->connect_error); } if ($link->query($sql) === TRUE) { echo "updated successfully $a$b"; // include "s_asqpl.php"; } else { echo "Error: " . $sql . "<br>" . $link->error; } mysqli_close($link); ?>
Edit file:zqtop.php1596