Everah,
yes.... I realize it was not in my original posted code ... I had pointed that out to superdezign during this post ... I wish I could start over ... perhaps feyd can help with starting over ... here is all code (minus Smarty engine) associated with what I am seeing.
Also, please notice in this code I removed the paranthesis from $_REQUEST
file name membertest.php
Code: Select all
<?php
define('GARDENPARTY_DIR', '/homepages/31/d200319295/htdocs/site_flash/smarty/gardenparty/');
define('SMARTY_DIR', '/homepages/31/d200319295/htdocs/site_flash/smarty/libs/');
require_once(SMARTY_DIR . 'Smarty.class.php');
include(GARDENPARTY_DIR . 'libs/gardenmem_test.php');
$garparmem=& new GardenMember;
$garparmem->identity = $_REQUEST['viewkey'];
$identity=$garparmem->identity;
$_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'enter';
switch($_action) {
case 'enter':
$garparmem->displaytest($identity);
break;
case 'reply':
var_dump ($identity);
die;
break;
}
?>
file name: gardenmemtest.lib.php (I have Volka's recommendations commented out)
Code: Select all
<?php
class GardenMember {
// protected $myProperties = array();
// public function __set($name, $value) {
// echo "<div>Debug GardenMember::__set($name, $value)</div>\n";
// $this->myProperties[$name] = $value;
// }
// public function __get($name) {
// if ( isset($this->myProperties[$name]) ) {
// echo "<div>Debug GardenMember::__get($name)={$this->myProperties[$name]}</div>\n";
// return $this->myProperties[$name];
// }
// else {
// echo "<div>Debug GardenMember::__get($name) unknown property<pre>";
// print_r($this->myProperties);
// echo "</pre></div>\n";
// return null;
// }
// }
//
function GardenMember() {
// instantiate the sql object
$this->sql =& new GardenMember_SQL;
// instantiate the template object
$this->tpl =& new GardenMember_Smarty;
}
function displaytest($identity){
$this->tpl->assign ('identity',$identity);
$this->tpl->display ('memtest.tpl');
}
}
?>
filename: gardenmem_test.php
Code: Select all
<?php
require_once(GARDENPARTY_DIR . 'libs/sql.lib.php');
require_once(GARDENPARTY_DIR . 'libs/gardenmemtest.lib.php');
require_once(SMARTY_DIR . 'Smarty.class.php');
require('/homepages/31/d200319295/htdocs/site_flash/DB-1.7.11/DB.php');
// database configuration I removed all of this since I am not accessing the db for my experiment
class GardenMember_SQL extends SQL {
function GardenMember_SQL() {
}
}
// smarty configuration
class GardenMember_Smarty extends Smarty {
function GardenMember_Smarty() {
$this->template_dir = GARDENPARTY_DIR . 'templates';
$this->compile_dir = GARDENPARTY_DIR . 'templates_c';
$this->config_dir = GARDENPARTY_DIR . 'configs';
$this->cache_dir = GARDENPARTY_DIR . 'cache';
}
}
?>
Finally, the template used with Smarty ... I don't believe this has anything to do with what I am experiencing.
Filename: memtest.tpl
Code: Select all
<form action="{$SCRIPT_NAME}?action=reply" method="post">
<table width="350" cellpadding="0" cellspacing="0">
<tr>
<td align="right" style="padding-top:2; padding-bottom:8; padding-right:4">{$identity}
</td>
<td align="right" style="padding-top:2; padding-bottom:8; padding-right:4"><input type="submit" value="Reply Now">
</td>
</tr>
</table>
</form>
When I run this based on this link:
When the page opens I get the expected result: I see the viewkey next to the reply button.
When I hit "Reply Now" whose action = "reply"
I receive NULL on my browser.
I really apologize that the original code (and most likely the existing code) is not clear.
Thanks to all.
Feyd,
I will need to double check with my host service regarding the PHP version. My host service is 1&1 and they state that they are on PHP 5, but I will double check.
All,
I will also try to use the proper construct standard and see if that helps.