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

My contact form doesn't submit across the information to the server

I am currently on the topic of 'WORKING WITH POST VARIABLES'.

I have followed everything the video told me to do in regards to adding:

<form method = "post" action="contact-process.php">

and then creating a new file called contact-process.php

However, when I reload the localhost page, it doesn't submit the info across. If I manually type in http://localhost/contact-process.php

I get array(0) { } cause no info has been sent across.

It should be such an easy task!

3 Answers

Sorry guys. I solved my own problem. It turned out after staring at my screen for 2 hours figuring out why it wasn't working, I had forgotten to put the closing '>' for my form submit button from the previous lesson.

Ugh I can't believe I wasted so much time on a silly mistake like that!

The w3 validator can be helpful for finding errors like that. You can view the source of the loaded page in a browser and copy/paste it into the validator using the "direct input" tab.

The W3 validator only has experimental HTML5 support, that's why there's W3 validator that uses the nu engine which has full HTML5 support

http://validator.w3.org/nu/

Thanks Tom. Will definitely check it out. Cheers.

having the same problem