我目前有一个Joomla 1.5安装,以及另一个网站.它们都驻留在同一个Web服务器上.但是,它们位于wwwroot目录中的不同文件夹中.我想在非joomla网站上放置一个登录表单,该表单将用户登录到Joomla.我已经尝试复制和粘贴的Joomla登录表单代码放到页面上的非Joomla网站,直到秘密形式值是不正确的,一切工作正常了.任何帮助是极大的赞赏.
编辑:这是代码 -
联系表:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="login" name="login" method="post" action="login.php">
<label>
<input name="username" type="text" id="username" value="username" />
</label>
<label>
<input name="password" type="password" id="password" value="password" />
</label>
</p>
<p>
<label>
<input type="submit" name="submit" id="submit" value="Submit" />
</label>
</p>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
登录脚本:
<?php
$uname = $_POST['username'];
$upswd = $_POST['password'];
$url = "http://www.mywebsite.com/joomla_site/index.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, …Run Code Online (Sandbox Code Playgroud)