Forums

The Thank you message again.

Ron 12 Apr, 2012
Hello,

I am using the CF V4 (latest)on my yOOtheme on Joomla! 2.5 everything seems to work okay except that the redirection on this code after email is not working.
 <php   
    $doc = JFactory::getDocument();
    $doc->setMetaData("refresh", "10;url=http://mysite.com", true, true);
    ?>
    <h4>Hello <?php echo $form->data['hello'].' '.$form->data['fullname']; ?></h4>
    <h4>Thank you for contacting the us.</h4><h4>Best wishes</h4><h4>My company.</h4>


Is there an issue in 2.5 ? Where could I be making an error ?

Please help
Thanks
Ron
GreyHead 13 Apr, 2012
Hi Ron,

I think that Joomla! removed setMetaTag. I used this code recently and it seems OK
<?php 
$doc =& JFactory::getDocument();
$custom_tag = '<meta http-equiv="refresh" content="8;url=some_url" >'; 
$doc->addCustomTag($custom_tag); 
?>

Bob
Ron 13 Apr, 2012
Thanks Bob..

It works..πŸ˜€.

Is it possible to show the "Thank you" message for ten seconds and then run a redirection code automatically to forward to a different location as per the choice made by the user.
Example of redirect code:
    $mainframe =& JFactory::getApplication();
    $country = JRequest::getString('country', '', 'post');

    switch($country)
    {

    case 'Afghanistan':
    $url = 'form1';
    break;

   case 'Akrotiri':
    $url = 'form2';
    break;
	
   case 'Albania':
    $url = 'form3';
    break;
	
   case 'Algeria':
    $url = 'form1';
    break;
    }

    $url = '../test/index.php?option=com_chronoforms&chronoform=' . $url;
    $mainframe->redirect($url);


Thanks for the help
GreyHead 13 Apr, 2012
Hi ron,

You can't delay a $mainframe->redirect; but you can merge to two code snippets to set the value of the url in the custom tag.

Bob
Ron 13 Apr, 2012
Thanks for the reply Bob.

How to merge the two codes ? And how will that help? I am confused.

Please help.

Thanks

Ron
GreyHead 14 Apr, 2012
Hi Ron,

<?php
$country = JRequest::getString( 'country', '', 'post' );
switch ( $country ) {
  case 'Afghanistan':
    $url = 'form1';
    break;

  case 'Akrotiri':
    $url = 'form2';
    break;

  case 'Albania':
    $url = 'form3';
    break;

  case 'Algeria':
    $url = 'form1';
    break;
}
$url = JURI::base().'/index.php?option=com_chronoforms&chronoform='.$url;
$doc =& JFactory::getDocument();
$custom_tag = "<meta http-equiv='refresh' content='8;url={$url}'>";
$doc->addCustomTag( $custom_tag );
?>

Bob
Ron 14 Apr, 2012
Thanks a lot Bob πŸ˜€

It succeeded. This is exactly what I needed.

Thank you very much. GOD Bless you.

RonπŸ™‚
This topic is locked and no more replies can be posted.