LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-08-2008, 10:08 AM   #1
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Rep: Reputation: 17
PHP - Zend Framwork: Zend_Session


Hey Guys,

Having a bit of a problem using Zend Session namespaces:

ToolsController.php
PHP Code:
<?php
/** Zend_Controller_Action */
require_once 'Zend/Controller/Action.php';


class 
ToolsController extends Zend_Controller_Action
{
    
   public function 
indexAction()
   {
       
   }
   
   public function 
mailAction()
   {
    require_once 
'Zend/Session.php';
    require_once 
'Zend/Session/Namespace.php';
    
$this->view->authNamespace = new Zend_Session_Namespace('User');
   }
}
mail.phtml
PHP Code:
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Neranjara.org using Zend Framework</title>
</head>
<body>
<h1>Neranjara.org - Mail Diagnostics</h1>
<?php
if (isset($this->authNameSpace->userName)) 
{
  echo 
$this->authNameSpace->userName;
}
else
{
  
?><p>Fail!</p><?php
}
?><pre><?php
var_dump
($_SESSION); 
?>
</pre>
</body>
</html>
If you check the page, http://zend.neranjara.org/tools/mail after logining in to, http://zend.neranjara.org/user/, (test/test123) you'll see that the session data is being stored without issue. However I cannot successfully initiate the 'User' name space.

Any help is greatly appreciated!

Last edited by nathacof; 10-08-2008 at 04:19 PM.
 
Old 10-09-2008, 04:06 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Check your httpd error_log if php errors are logged in this file
You can not use $this variable out of the class context
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Am I more secure if I encode my php scripts? For example like using Zend abefroman Linux - Security 1 04-13-2008 02:30 AM
LXer: Zend Goes Straight to The PHP Core LXer Syndicated Linux News 0 03-06-2007 09:01 AM
LXer: In Zend (And PHP) We Invest LXer Syndicated Linux News 0 08-28-2006 11:21 AM
How to remove a php zend extension docbrazen Linux - Software 0 01-19-2004 02:17 PM
Configure zend with PHP help! please DigiCrime Linux - General 0 02-20-2003 12:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration