no to podaję funkcję logującą
<?php
function login($username, $password)
{
// Generate post string
$post_fields = $this->array_to_http(array( 'username' => $username,
'password' => $password,
'autologin' => 1,
'redirect' => 'admin/index.php',
'login' => 'Log In',
));
// Init curl
$this->curl = curl_init();
// Set options
curl_setopt ( $this->curl, CURLOPT_URL, $this->phpbb_url . 'login.php?redirect=admin/index.php' );
curl_setopt ( $this->curl, CURLOPT_POST, true );
curl_setopt ($ch, CURLOPT_REFERER, "http://adresforum.pl/admin/index.php");
curl_setopt ( $this->curl, CURLOPT_POSTFIELDS, $post_fields );
curl_setopt ( $this->curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt ( $this->curl, CURLOPT_HEADER, false );
curl_setopt ( $this->curl, CURLOPT_COOKIE, $this->cookie_name );
curl_setopt ( $this->curl, CURLOPT_COOKIEJAR, $this->cookie_name );
curl_setopt ( $this->curl, CURLOPT_COOKIEFILE, $this->cookie_name );
curl_setopt ( $this->curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );
// Execute request
$result = curl_exec ( $this->curl );
// Error handling
if ( curl_errno ( $this->curl ) )
{
curl_errno($this->curl),
curl_error($this->curl),
);
curl_close ( $this->curl );
return false;
}
// Close connection
curl_close ( $this->curl );
// Return result
return true;
}
?>
ten sposób po prostu nie działa, nie wychodzi logowanie na admina