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

Brittany Demers
Brittany Demers
160 Points

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

I had trouble with the header redirect so I googled it and found this line worked for me:

header('location:contact.php?status=thanks');

hope it helps someone else (:

2 Answers

Patrik Balogh
Patrik Balogh
47,986 Points

Yes it's working. WHEN headers hasn't been sent yet.

Look for the characters. Don't write Location with lowercase; put a space after colon: header("Location: contact.php?status=thanks");

Patrik Balogh
Patrik Balogh
47,986 Points

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

or

<?php header("Location: http://example.com/index.php"); ?>