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

Majid Mokhtari
Majid Mokhtari
10,506 Points

Problem with showing the thank you message

I included this code:

<?php
    header("Location: contact.php?status=thanks");
exit;
?>

on local server it sends the status=thanks to browser and i see the thank you message, but in real server it does not send it to the browser. In other words I don't see the thank you message:

<?php if(isset($_GET["status"]) AND $_GET["status"] == "thanks"){?>
<h4>Thanks for sending the message. I will contact you soon!</h4>
Andrew Shook
Andrew Shook
31,709 Points

fixed formatting issue so code will show up in code blocks.

2 Answers

Chris Southam
Chris Southam
1,823 Points

The problem will be a difference between your local and real server. Do you know what the two are running PHP wise? Try putting var_dump($_GET); at the top of your file (after <?php) and see what it outputs.

Majid Mokhtari
Majid Mokhtari
10,506 Points

Andrew what do you mean by formatting issue? Chris I did that they are showing same output