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 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