Oto kod php:
<?php // Login $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $link.'login.php'); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookieFile); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_POST, true); $postVars = array('username' => $login, 'password' => $pass, 'autologin' => 'on', 'login' => 'Zaloguj'); curl_setopt($curl, CURLOPT_POSTFIELDS, $postVars); $resp = curl_exec($curl); curl_close($curl); // Parse sid from cookie file // Post $curl = curl_init(); $temat1 = $link.'posting.php?mode=newtopic&f='.$temat; curl_setopt($curl, CURLOPT_URL, $temat1); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookieFile); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_POST, true); 'subject_e' => $message2, 'message' => $message, 'sid' => $sId, 'f' => $temat, 'post' => 'Submit'); curl_setopt($curl, CURLOPT_POSTFIELDS, $postVars); $result = curl_exec($curl); curl_close($curl); $pattern = '#<a href="(.*?)">Tutaj</a>#'; $zwrot = $adres . '/' . $matches[1][0]; if($viewtopic !== false || $postlink !== false) { $status = "ok"; } else $status = "bad"; //print_r($matches); //echo $matches[1][0]; //echo $resp; ?>
Kod odpowiedzialny za wyswietlanie:
$zwrot = $adres . '/' . $matches[1][0]; if($viewtopic !== false || $postlink !== false) { $status = "ok"; } else $status = "bad";
Otóż nic się nie dzieje, nie wyswietla ani błędnych ani dobrych ....
Proszę o pomoc!