I switched to element validation, if the element is validate, the forward an url.
I put the following code in PHP text area, the strange thing is no matter what I input, the validate result is true but the forwarding never process. Dose any one know what was wrong??
$app = JFactory::getApplication('site');
$session = JFactory::getSession();
$companyAbb = $session->get('myCompany');
$inputpass = $app->input->get('tablename___elementname');
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('com_compass');
$query->from('igc8d_company_information2');
$query->where('comp_abbreviation = '. $db->quote($compabb));
$db->setQuery($query);
$result = $db->loadResult();
if ($result == &inputpass) {
header("Status: 301 Moved Permanently");
header("Location:
http://www.ccfia.org/purity2");
} else
return false;