Where do you put the php?!

Dee 21 Jul, 2008
WOW! I get to post! I can hardly get this forum to load sometimes so I am excited to post!πŸ™‚

Here's the issue:
I have a registration form. I want it to transfer (php) some information to another page that will then calculate a total. The total is taken to paypal. I have the form done and it works (emails and all that). I have the php calculation page done and talking with paypal.

How in the world do I get the form to talk to the php calculation page?! I can't seem to get anything to transfer over from a form to a php echo page for nothing. Is there an important step I am missing? What do I need to post here to give you more information?

Thanks for any tips/hints that you can give!πŸ™‚
GreyHead 21 Jul, 2008
Hi Dee,

You probably don't need to transfer to another page - put your PHp code in the 'OnSubmit Before' or 'OnSubmit After' boxes and you can pick up the values from the $_POST array (or use JGet).

Which box you use depends on the workflow of your form.

Bob
Dee 21 Jul, 2008
Okay... Got that part... hehe...

Now here's the problem. When I have the form send it's info on to the php page the email does not send and none of the validation areas work. Is there something I am missing? A bug maybe?
Dee 21 Jul, 2008
OH and PS... Here's what I am trying to do... a little..

I have a registration form. The registration form sends out an email to me, the user and then sends the user on to the php page that gathers some information from the form, calculates it and then sends the person on to the paypal page to finish the transaction.

I have people going from the form to the php page because the values on the form are one thing and the calculation values are another thing. Can you put something on a form with 2 values? No wait... I don't want to mess with that now. I want it just work the way I have it! hahaha... sigh
GreyHead 21 Jul, 2008
Hi Dee,

I don't understand why the validation ares don't work, they are JavaScript and just depend on the browser. If you have your form with an OnSubmit to the php page then ChronoForms will never see it so the email won't work and nor will the ImageVerification.

So, to repeat myself, put the php calculation code in the OnSubmit before box, then you can use the result in the email. In the same place build a PayPal url and use that with the ChronoForms ReDirect. To do this don't put a redirect url for the form but include
<?php
$rows[0]->redirecturl = //my paypal url
?>
in your php code.

ChronoForms will then redirect to PayPal after it has sent out your emails.

Bob

Note: there is a bug in some versions fo chronocontact.php that won't send emails if there is a redirect url set. There are fixed versions at several places in the forums here.

Bob
Dee 21 Jul, 2008
Got it! Well.. actually a friend got it. Hehehe...

I (we) were putting the php file separate and having the chronoforms redirect/submit to it, when it can all go neatly in the after submit php area instead and take care of it all there. Plus the code was still set to get and not post. oops!

Wow... Lack of sleep really gets to a person with coding.

Validation, email and moving necessary fields to the next page works now just fine.

Now I am just trying to get all the fields that are required to be filled to fit into that itty bitty validation box.πŸ™‚

Thanks for everything!!
This topic is locked and no more replies can be posted.