<?php $config['address'] = 'http://forum'; $post['usrname'] = 'nick'; $post['passwrd'] = 'haslo'; $post['redirect'] = ''; $post['login'] = 'Zaloguj'; $ch = curl_init($config['address'].'login.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_COOKIEFILE, $path['cookie']); curl_setopt($ch, CURLOPT_COOKIEJAR, $path['cookie']); curl_setopt($ch, CURLOPT_POSTFIELDS, prepare_request($post)); curl_exec($ch); curl_close($ch); function prepare_request($query) { { foreach($query as $key => $value) { } } else { return false; } } $config['address'] = 'http://forum'; $ch = curl_init($config['address'].'posting.php?mode=reply&t=2'); curl_setopt($ch, CURLOPT_COOKIEFILE, $path['cookie']); curl_setopt($ch, CURLOPT_COOKIEJAR, $path['cookie']); $postFields['message'] = 'tekst'; curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_exec($ch); curl_close($ch); ?>
I o ile logowanie działa poprawnie, to niestety dodawanie postu do istniejącego tematu już nie i nie mogę znaleźć błędu. Mógłby ktoś pomóc?