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 Simple PHP Application Adding a Contact Form Working with Get Variables

Keith Kasputis
Keith Kasputis
11,365 Points

<?php if (isset($_GET["status"])) AND ($_GET["status"]=="thanks") { ?> loads blank page

The above loads a blank page but if I take out the isset part and only use $_GET["status"] the page performs as expected. This leads me to believe that the else statement is working because I will get the blank form and when the form is submitted then get redirect to the thanks message.

I did notice in the video that there is only 1 closing parenthesis just before the AND but I tried both 1 and 2, neither work.

4 Answers

You're not getting the parentheses right. As it is you're closing the if statement before the AND. The other way you said you tried wouldn't fix the issue.

php <?php if (isset($_GET["status"]) AND ($_GET["status"]=="thanks")) { ?>

Keith Kasputis
Keith Kasputis
11,365 Points

Andrew, Thank you very much! Keith

Thanks,

I had a similar issue :)

I had a similar issue forgot to close both sets of parenthesis