( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
include('Connections/videoondemand.php');
require("DbSql2.inc.php");
require("NewsSql2.inc.php");
$db = new NewsSQL;
//a class to handle database operations
ini_set('max_execution_time', 30000000); //300 seconds = 5 minutes
error_reporting(1);
global $link;
$sql = "select * from bizcards where type=1 order by id asc limit 0,50";
$result = mysqli_query($link, $sql) or die(mysqli_error($link));
if(empty($result)){exit("no result!");}
while ($row1 = mysqli_fetch_assoc($result)) {
$id = $row1['id'];
$id = $id;
$specialID=$id;
$json = $row1['json'];
$json = stripslashes($json);
$json =str_replace('"{"','{"',$json);
$json =str_replace('}}"','}}',$json);
$data = json_decode($json , true);
// $row = $data["data"]["objects"];
$json = json_encode($data);
$title = urlencode("Logo Design Template- $id");
$preview = urlencode($preview);
$slug = strtolower($title);
$slug = preg_replace('/[^A-Za-z0-9-]+/', '-', $slug);
$slug = urlencode($slug);
$url = "https://www.thebrand.ai/TheBrandZ/mode.php?mode=importLogoV3&slug=$slug&title=$title&specialID=$specialID&main_category=809";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"$url");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"$json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close ($ch);
if($httpcode>=200 && $httpcode<300)
{
echo $server_output;
sleep(2);
}
else
{
echo "fail";
}
}