Commit 3f5287bc authored by Okthane's avatar Okthane

certificat

parent 9a7b3ed6
No preview for this file type
...@@ -12,20 +12,22 @@ ...@@ -12,20 +12,22 @@
// if(array_key_exists($ext, $allowed)) // if(array_key_exists($ext, $allowed))
// { // {
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// curl_setopt($ch, CURLOPT_CAINFO,__DIR__ . DIRECTORY_SEPARATOR . 'certif.cer'); // curl_setopt($ch, CURLOPT_CAINFO,__DIR__ . DIRECTORY_SEPARATOR . 'certif.cer');
// curl_setopt($ch, CURLOPT_CAPATH,__DIR__ . DIRECTORY_SEPARATOR);
curl_setopt($ch, CURLOPT_URL, 'https://api.remove.bg/v1.0/removebg'); curl_setopt($ch, CURLOPT_URL, 'https://api.remove.bg/v1.0/removebg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
$post = array( $post = array(
// 'image_file' => '@' .realpath('/img'.$_FILES["photo"]["name"]), // 'image_file' => '@' .realpath('/img'.$_FILES["photo"]["name"]),
'image_file' => '/img/pierremarque.jpg', 'image_file' =>'@' .realpath('/img/'.'pierremarque.jpg') ,
'size' => 'auto' 'size' => 'auto',
'format'=>'JPG'
); );
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$headers = array(); $headers = array();
$headers[] = 'X-Api-Key: Es8bAw68rDddjoK47i9EASEy'; $headers[] = 'X-Api-Key:qYXf5PimffLjeH1i5B1rySQw';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch); $result = curl_exec($ch);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment