Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Pauline Orr
Pauline Orr
15,321 Points

PHPMailer to work for one form where there is two

I am using the PHPMailer, almost exactly like in the PHP Basic Website course but I have a front page with a form to start the form. Once you click submit, it takes you to the actual page with those inputs you wrote into those inputs along with the new empty ones. It worked great until I brought into the PHP. Here is what I used to pass solutions to the other form. http://stackoverflow.com/questions/15236733/pass-form-data-to-another-page-with-php

I have tried differentiating the forms- making their names, values, ids different but the problem is when I submit the first form, it emails me rather than taking me to the other form with the passed values. Anytime I submit anything, the "if(!$mail->send())...' runs if no errors are caught.

I thought maybe bringing in a hidden input for the first variable could help with another if statement to run but I'm still not figuring this out.