Session jumi-joomla的.php文件中的会话集
我在使用jumi中附加的.php文件中的会话时遇到问题 如何在该页面中设置会话?当我使用:Session jumi-joomla的.php文件中的会话集,session,joomla,jumi,Session,Joomla,Jumi,我在使用jumi中附加的.php文件中的会话时遇到问题 如何在该页面中设置会话?当我使用: //this define and require I use from reading the other papers define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(dirname(__FILE__))); define( 'DS', DIRECTORY_SEPARATOR ); require_once (JPATH_BASE . DS .
//this define and require I use from reading the other papers
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(dirname(__FILE__)));
define( 'DS', DIRECTORY_SEPARATOR );
require_once (JPATH_BASE . DS . 'includes' . DS . 'defines.php');
require_once (JPATH_BASE . DS . 'includes' . DS . 'framework.php');
$mainframe = JFactory::getApplication('site');
$session = &JFactory::getSession();
if(isset($_GET['id'])){
var_dump($id= $_GET['id[i]']);
} else {echo "No session ";}
// code connect to db
// render out the items
//
foreach($rows as $i=>$row){
$id[$i] = $row['rid'];
$name[$i] = $row['rname'];
$view .= '<tr>
<td>'.$id[$i].'</td>
<td><a href="http://www.thispage.php?id='.$id[$i].'">'.$name[$i].'</a></td>';
?>
}
<p><?php echo $view.'</tr></table>'; ?> </p>
//这定义并要求我在阅读其他论文时使用
定义('u JEXEC',1);
定义('JPATH_BASE',dirname(dirname(_文件__)));
定义('DS',目录\分隔符);
require_once(JPATH_BASE.DS.'includes'.DS.'defines.php');
require_once(JPATH_BASE.DS.'includes.DS.'framework.php');
$mainframe=JFactory::getApplication('site');
$session=&JFactory::getSession();
如果(isset($_GET['id']){
变量转储($id=$\u GET['id[i]');
}else{echo“No session”;}
//代码连接到数据库
//渲染出项目
//
foreach($i=>$row的行){
$id[$i]=$row['rid'];
$name[$i]=$row['rname'];
$view.='
“.$id[$i]”
';
?>
}
它不允许我找到我单击的id=1的子页面。
处理这种事情最好的办法是什么?
谢谢。如果出现语法错误,请在继续之前尝试以下操作:
</php
//this define and require I use from reading the other papers
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(dirname(__FILE__)));
define( 'DS', DIRECTORY_SEPARATOR );
require_once (JPATH_BASE . DS . 'includes' . DS . 'defines.php');
require_once (JPATH_BASE . DS . 'includes' . DS . 'framework.php');
$mainframe = JFactory::getApplication('site');
$session = &JFactory::getSession();
if(isset($_GET['id'])){
var_dump($id= $_GET['id[i]']);
} else {
echo "No session ";
}
// code connect to db
// render out the items
//
foreach($rows as $i=>$row){
$id[$i] = $row['rid'];
$name[$i] = $row['rname'];
$view .= '<tr>
<td>'.$id[$i].'</td>
<td><a href="http://www.thispage.php?id='.$id[$i].'">'.$name[$i].'</a></td>';
}
?>
<p><?php echo $view.'</tr></table>'; ?></p>
$row){
$id[$i]=$row['rid'];
$name[$i]=$row['rname'];
$view.='
“.$id[$i]”
';
}
?>
查看Jumi包含PHP文件的方式,您应该从以下内容开始:
defined('_JEXEC') or die('Restricted access');
这将阻止通过直接HTTP请求执行PHP文件(如果您查看Jumi附带的示例blogger文件,您将看到这一行)。define
语句,初始化Joomla!代码用于确保通过正确的路径输入请求
除此之外,正如@travega所提到的,在关闭foreach()