0
在cakephp中,我登录到mysql数据库没有问题。我有一个问题,我登录后需要访问另一个cakephp网站上同一服务器上的另一个数据库(按钮单击)。我不希望用户在另一个网站上再次登录。我找不到解决这个问题的信息。我如何自动登录到另一个cakephp网站? 要更清楚我想要的是我想要用户登录,然后单击一个按钮并使用另一个不同数据库的cakephp网站,而无需登录。的setDataSource似乎是住在同一个CakePHP的网站和交换数据库如何从cakephp中的当前网站自动登录另一个数据库
下面的代码工作正常(我的电脑),但II需要自动登录到该网站,而无需再次登录
echo $this->Html->link('link!', 'http://127.0.0.1/maths/numeracyStudents/dashboardst');
public $mathdb = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '127.0.0.1',
'login' => 'root',
'password' => '',
'database' => 'maths',
'prefix' => '',
//'encoding' => 'utf8',
);
//called this function from the controller and nothing happens?
public function changedb() {
$this->NumeracyStudents->setDataSource('mathdb');
}
我不明白这一点,因为database.php中是不同的你说什么。有没有newQuery – ajt
对不起,我应该问你使用什么版本的蛋糕? – chrisShick
我正在使用cakephp 2.x,我没有得到如何在登录后自动登录到另一个数据库? – ajt