On Submit Code not executing

itchibahn 08 Apr, 2009
Using joomla 1.5.9 w/ ChronoForms RC4, and the codes in "On Submit Code" are not being executed. I tried both "before sending email" and "after sending email". And neither is being executed. Is there some config that needs to be turned on? Below is the url that shows in the address bar once submitted, and the content shows blank:

index.php?option=com_chronocontact&task=send&chronoformname=one_time_gift&Itemid=135

On debug shows the following only:

   1. Form passed first SPAM check OK
   2. Form passed the submissions limit (if enabled) OK
   3. Form passed the Image verification (if enabled) OK
   4. Form passed the server side validation (if enabled) OK
   5. $_POST Array: Array ( [amount] => 11.00 [419f86db4d551287eabf8e7bf6d08c42] => 1 )
   6. $_FILES Array: Array ( )
   7. Form passed the plugins step (if enabled) OK
   8. Debug End


Below is the code:
<?php
$url  = "https://www.paypal.com/cgi-bin/webscr";
$url .= "&cmd=_xclick";
$url .= "&business=donations@example.com";
$url .= "&item_name=One-Time-Gift";
$url .= "&item_number=1001";
$url .= "¤cy_code=USD";
$url .= "&amount=100.00";
//$url .= "&custom=".$_POST['email'];
//$url .= "&return=http://www.mysite.com/thank-you.html";
// $url .= "&return=some_url";
// $url .= "&cancel_return=some_url";
$url .= "&no_note=1";
$url .= "&no_shipping=1";
if ( $debug ) {
    echo "url: ";
    print_r($url);
    echo "<br />";
    echo "<a href='$url'>Click to continue</a>";
} else {
    $rows[0]->redirecturl = $url;
}
?>
Max_admin 09 Apr, 2009
Hello,

in RC4, chronoforms got a more standard and elegant code base, your code now should be like this:


    <?php
    $url  = "https://www.paypal.com/cgi-bin/webscr";
    $url .= "&cmd=_xclick";
    $url .= "&business=donations@example.com";
    $url .= "&item_name=One-Time-Gift";
    $url .= "&item_number=1001";
    $url .= "¤cy_code=USD";
    $url .= "&amount=100.00";
    //$url .= "&custom=".$_POST['email'];
    //$url .= "&return=http://www.mysite.com/thank-you.html";
    // $url .= "&return=some_url";
    // $url .= "&cancel_return=some_url";
    $url .= "&no_note=1";
    $url .= "&no_shipping=1";
$MyForm =& CFChronoForm::getInstance();
    if ( $MyForm->formparams->debug ) {
        echo "url: ";
        print_r($url);
        echo "<br />";
        echo "<a href='$url'>Click to continue</a>";
    } else {
        
$MyForm->setFormData('redirecturl',$url );
    }
    ?>



Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
itchibahn 09 Apr, 2009
That worked. 😛 😛

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