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

redirecting a contact form to a thank you message?

Hi all,

I have been updating my personal portfolio website, and have restructured to a one page format!

Im trying to validate my contact form at the moment, I've decided to follow Randy's 'Adding a Contact Form' badge to understand the PHP process better. To redirecting the form after submission Randy suggests using 'header("Location: PAGENAME?status=thanks");' I would like to use the same mark up but to link to an anchor on my page (i.e. '#contact')

Is this possible? and if so how?

Cheers Brett

1 Answer

It should work fine to just add the anchor right in on that URL, so in your example above you'd do:

header("Location: PAGENAME?status=thanks#contact");