setQuery( $queryId );$resultId = mysql_query($queryId) or die(mysql_error()); $rowId = mysql_fetch_array($resultId) or die(mysql_error());$cfId=$rowId['cf_id'];?>But can't get it to workIs this even an option???thanx againmark"> add variable to to redirect url - Forums

Forums

add variable to to redirect url

marklandry 17 May, 2011
Hi,
I'm trying to use the following in the form redirect url

index.php?option=com_chronocontact&chronoformname=settings&tmpl=component&cf_id=<?php echo $cfId;?>

I have the following code in the form JavaScript:

<?php
$user =& JFactory::getUser();
$usr = $user->get('id');
$database =& JFactory::getDBO();
$queryId = "SELECT cf_id, cf_user_id FROM `jos_chronoforms_settings` WHERE `cf_user_id` = '$usr' " ;
$database->setQuery( $queryId );
$resultId = mysql_query($queryId) or die(mysql_error()); 
$rowId = mysql_fetch_array($resultId) or die(mysql_error());
$cfId=$rowId['cf_id'];
?>

But can't get it to work
Is this even an option???
thanx again
mark
GreyHead 18 May, 2011
Hi Mark,

You can't use PHP in the Redirect URL box so that won't work. But you can set a Redirect URL in the OnSubmit Code boxes. There are several threads here with the code for that and the code is in The ChronoForms Book (which I think you have) in the article on page 151.

The other code you have is PHP, not JavaScript so won't work in the Form JavaScript box.

Bob
This topic is locked and no more replies can be posted.