Jump to content

Need PHP form to send an email on submit AND go to a confirmation type page!


openhandmedia

Recommended Posts

Hello all! I am a newbie, yes, and am trying to learn as quickly as I can! I am building a site for a non-profit that needs to collect information for sponsorships fields including: donation level, company information, other sponsorship opportunities, etc.

 

The full form can be see here: http://www.campgolfchallenge.org/register.html

 

Currently when the form is filled out it sends an email to the visitor and someone collecting the information. What I need to do is have the form ALSO post the filled out information to another page ,"register-submit.php" for instance, totaling the amount of money selected from the form but still emailing the information to the visitor.

 

My goal is to incorporate Google Donate so that they can see after submitting the form how much they need to enter into the donate field. I hope this isn't too confusing and someone can help!

 

I am also attaching the php files sendmail-register.php, register-submit.php

 

 

[attachment deleted by admin]

Only a human can POST a page (cUrl is possible but I wouldn't).

 

Php can't POST to another page.

 

The best bet is to store in a PHP session, then recall on any other page you want. (look into PHP sessions - very simple).

 

You could use $_GET which is exactly the same as POST (just type GET instead of POST) - and this pulls what is in the address bar rather than what sent in a form. Php could then do a header redirect to www.yoursite.com/page.php?a=Dave&b=100

 

By pulling $_GET['a'] and $_GET['b'] you can say:

 

Thanks Dave, you paid $100 or something.

 

 

header redirect is simple php code:

 

header ("Location: http://www.sitename.com/page.php?a=123");

 

 

I wasn't saying cURL can't post as well as a human, I was saying I wouldn't use it for this.

 

In this case it would just be best to store values in a session, or even merge the 2 scripts into one.

 

cURL for this just doesn't seem the best method - and also slightly more difficult for someone new to php.

 

I would look into PHP sessions, not cURL.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.