Hi,
I am trying to integrate phpbbforum in my website. I have been successfull in adding the data of the user in the table of my website as well as my form user table.Now I am trying to make a single sign in for the user. It means that if the user sign in in my website the same session will be used for the forums also. I am trying to apply the logic with curl here is my code.
$post_data = $_POST;
$post_items = array();
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
$url = "http://example.com/forums/ucp.php?mode=login";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$head = curl_exec($ch);
$httpCode = curl_getinfo($ch);
curl_close($ch);
}
This is my response of the curl code executed
Array
(
[url] => http://example.com/forums/ucp.php?mode=login
[content_type] => text/html; charset=UTF-8
[http_code] => 200
[header_size] => 634
[request_size] => 86
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.123356
[namelookup_time] => 0.000209
[connect_time] => 0.000367
[pretransfer_time] => 0.000377
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 0.123264
[redirect_time] => 0
[certinfo] => Array
(
)
)
But it is not executing the code of login for forums.I am logged in my website but not in forums. Can anyonel help me that where I am wrong.Thanks in advance.