Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Basic PHP Website (2018) Adding a Basic Form Redirecting After a Form Submission

Steven Chan
Steven Chan
6,526 Points

Hitting back after landing on thanks.php, the suggest.php page still has the fields filled (not blank)

I pretty much copied the code verbatim, but am unsure why when I hit back button, the suggest.php page has the name, email address, and details field still filled in. I thought they should be blank again, like in the video.

Robert Cooper
Robert Cooper
22,701 Points

My fields remain filled-in as well when I hit the back button. I'm not too concerned though.

3 Answers

Hitting back on your browser to form will keep the form filled in because it's the browsers memory that's putting the data back there. If you refresh a browser whilst on a form page the details will be gone.

As for skipping over processing.php, what do you mean? It runs processing.php then it follows the header redirect to the thanks.php like it's supposed to.

coskun olcucu
coskun olcucu
5,340 Points

Hi, I have the same issue like you guys have it. I turned off auto complete on my browser setting,but still no luck. can you guys let me know if you find out solution? thank you

I think its a bloody feature albiet unwelcome but I wish someone could explain why there is a skip over processing.php? Is it because of the form action redirect? Or the fact it doesn't have the html to support itself independently?