1. sayfa
<?php $input = array( 'kullanici' => '', 'sifre' => '', 'MYGG' => 'Y', 'js_kontrol' => 1, 'logfrm' => 1, 'ITEM' => '', 'url' => '', 'pass' => '%C3%9Cye+giri%C5%9Fini+onayl%C4%B1yorum', 'facebookLoginCheck' => 0, 'dmEmailPermission' => 0 ); $cookie_file_path = dirname(__FILE__) . '/cookie.txt'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.gittigidiyor.com/uye-girisi?s=1'); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($input)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $result = curl_exec($ch); if (isset($_REQUEST['catCode'])) { $input = array('catCode' => $_GET['catCode']); curl_setopt($ch, CURLOPT_URL, 'http://www.gittigidiyor.com/urun-satmak/select-category-ajax'); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($input)); $headers = array(); $headers[] = 'Accept: application/json, text/javascript, */*; q=0.01'; $headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'; $headers[] = 'X-Requested-With: XMLHttpRequest'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = json_decode(curl_exec($ch)); curl_close($ch); foreach ($result as $row) { $array[$row->categoryCode] = $row->displayName; } } else { curl_setopt($ch, CURLOPT_URL, 'www.gittigidiyor.com/urun-satmak/kategori-secim'); $result = curl_exec($ch); $result = str_replace(' class="odd"', '', $result); preg_match_all('/<option id="cat_(.+?)" value="(.+?)">(.+?)<\/option>/i', $result, $matches); foreach ($matches[1] as $index => $catCode) { $array[$catCode] = $matches[3][$index]; } } echo json_encode(array('status' => 'OK', 'category' => $array)); ?>
quote:PHP CURL ile Gittigidiyor'a login olmak PHP CURL ile Gittigidiyor'un kategorilerini çekmek
işine yarayan olabilir
test.php // Ana Kategoriler
test.php?catCode=1 Evcil Hayvan Ürünleri vs
< Resime gitmek için tıklayın >
< Bu mesaj bu kişi tarafından değiştirildi ScorpionCoders -- 4 Şubat 2017; 1:11:34 >