Sorry if im being a bit of a pain, i paste copies of my code i currently have:
This is a snippet of code from my plugin which converts the keyword "{wishlist}" into a submit button. Below is a copy of the form it generates:
Code:
$load = str_replace( 'wishlist', '', $matches[0][$i] );
$load = str_replace( '{', '', $load );
$load = str_replace( '}', '', $load );
$load = trim( $load );
$content = "<form method='post' name='wishlist' >".
"<input type='submit' value='Add to wishlist'" .
"name='add to wishlist' />".
"<input type='hidden' value='". $row->title ."'".
"name='product' /></form>";
$row->text = preg_replace( '{'. $matches[0][$i] .'}', $content, $row->text );
return $load;
next is my module which is displaying the content:
Code:
<?php
//no direct access
defined('_JEXEC') or die('Restricted Access');
//start the session
session_start();
$product = mysql_real_escape_string($_POST['product']);
$session = JSession::getInstance('product', array());
$session->set('product', $product);
echo "<h2>". $session->get('product') ."</h2>";
I did try the "$app->getUserState()" but still had the same results as with the JSession. Thanks again and sorry for being a pain.