Hoşgeldin Misafir

PhP Curl ile login yapma (Yardım)

zaferpfc

10 Ara 2019
7 Mesaj

Aktiflik

Seviye

Deneyim

TIM / GÖREV:
Merhaba Uzun süredir wish sitesine login yapıp 1 adet ürünün bilgilerini çekmek istiyorum ama ne yazıkki bunu henüz başaramadım login olmadan çekmek mümkün fakat fiyatlar indirimli olarak gelmiyor bu yüzden giriş yapmak şart oldu Benim çalıştığım kodlar şu şekilde

PHP:
<?php
    $username="***"; 
    $password="****"; 
    $url="https://www.wish.com"; 
    $cookie="cookie.txt"; 
    
    $postdata = "email=".$username."&password=".$password; 
    
    $ch = curl_init(); 
    curl_setopt ($ch, CURLOPT_URL, $url); 
    curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
    curl_setopt ($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); 
    curl_setopt ($ch, CURLOPT_TIMEOUT, 60); 
    curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0); 
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); 
    curl_setopt ($ch, CURLOPT_REFERER, $url); 
    curl_setopt($curl, CURLOPT_AUTOREFERER, true);
    curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate');
    
    curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata); 
    curl_setopt ($ch, CURLOPT_POST, 1); 
    $result = curl_exec ($ch); 
    
    echo $result;  
    curl_close($ch);
   ?>

Ama ne yazıkki 403 hatası alıyorum yardım edecek biri varmı acaba.