我执行一些PHP代码。
在此之后,我想通过帖子将值发送到另一个PHP站点,我希望通过$_POST
使用它。我不需要会话或cookie,或者无论如何。
else if ($tag == 'in_accepted') {
$coni=mysqli_connect("localhost","LOGIN","PW","movement");
$tablename = $_POST['tablename'];
$jsonString = $_POST['json'];
$jArray = json_decode($jsonString, true);
$comment = $_POST['comment'];
$result2 = mysqli_query($coni, "ALTER TABLE `$tablename` COMMENT = '$comment'");
$response["comment_succes"] = 1;
foreach($jArray as $key => $value){
$ean = $value["ean"];
//$trimmedean = substr($ean, 0, 3) .".". substr($ean, 3, 4) .".". substr($ean, 7, 4);
//$result = mysqli_query($coni,"INSERT INTO `$tablename` (unique_id, ean, accepted) VALUES ('$uuid', '$trimmedean', '0')"); // or die(mysql_error());
$result = mysqli_query($coni, "UPDATE `$tablename` SET accepted='1' where ean='$ean'");
}
if ($result > 0) {
$response["success"] = 1;
!!!!SEND $tablename to URL.php
echo json_encode($response);
}
else {
$response["error"] = 1;
echo json_encode($response);
}
答案 0 :(得分:0)