I want to create a link between phpMyFAQ and another software in such a way that if you login there than you don't have to type again username and password.
I did it on my localhost. Everyghing was working perfectly.
But if i do the same on my serwer there is a such problem that I CAN log in to phpMyFAQ without retyping username and password but as soon as i want do anything (e.g. i click on: startpage, user administration etc. - menu) i HAVE TO retype user name and password.
Additionally i have notice that uin number is disapiring after i click on anything (that's why i thinkg my username and password are missing )
Below u will find a lines which i did ignore as well some others i have added.
admin/index.php
-----------------------------------------------------------
Code: Select all
$ID = $_GET['SID'];
session_id($ID);
session_start();
.......
// delete cookie before sending a header
//if (isset($_REQUEST['aktion']) && $_REQUEST['aktion'] == 'delcookie') {
// setcookie('cuser', '', time() + 30);
// setcookie('cpass', '', time() + 30);
//}
........
// Set cookie before sending a header
/*
if (isset($_POST["aktion"]) && $_POST["aktion"] == "setcookie") {
if (isset($_POST["cuser"])) {
setcookie(" ", $_POST["cuser"], time() + (86400 * PMF_AUTH_TIMEOUT));
}
if (isset($_POST["cpass"])) {
setcookie("cpass", $_POST["cpass"], time() + (86400 * PMF_AUTH_TIMEOUT));
}
}
*/
.....
// If the cookie is set, take the data from it
/*
if (isset($_COOKIE['cuser']) && !preg_match('/^[a-z0-9]$/i', $_COOKIE['cuser'])) {
$user = $_COOKIE['cuser'];
} else {
unset($user);
}
if (isset($_COOKIE['cpass']) && !preg_match('/^[a-z0-9]$/i', $_COOKIE['cpass'])) {
$pass = $_COOKIE['cpass'];
} else {
unset($pass);
}
*/
.....
$faqusername = $_SESSION['username'];
$faqpassword = $_SESSION['password'];
$user = $db->escape_string($faqusername);
$pass = md5($db->escape_string($faqpassword));
// Authenticate the user from login POST variables
/*
if (isset($_POST["faqusername"])) {
$user = $db->escape_string($_POST["faqusername"]);
}
if (isset($_POST["faqpassword"])) {
$pass = md5($db->escape_string($_POST["faqpassword"]));
}
*/
- on the localhost is working fine
- I CAN login to the first page with this one on the server. so this means that phpmyfaq reads username and password frome the database
Regards Lukasz