If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

By all means, you should urldecode() all of the $_POST assignments. Also, I notice that all of your $_POST[] elements are assigned to either $name, $subject, $email, or $comments. If you look down further in the '//If there is no error, send the email' section, you will see additional variables to which some of them might be more appropriately assigned.

I saw a few things that were not quite right but I am hoping this will help it a long a bit. The only problem I have is when I click to submit it usually sends the form without some of the information. now it says there is an error.

This seems to be a good thing because it must mean the php code was wrong and now must be slowly getting to what it should be.

Part 1

Lol... although I'll admit it was an aggravating day, your project had little to do with it and by a happy coincidence, I've learned that when I feel cranky it always makes me happier to do something nice for someone... The code below needs a little work, but they are only cosmetic and minor things that you'll find instructive to tinker with. Although it's a single file, I have to send it in two parts due to its size... the php section (this part) goes first and the html second (next message).

Thats quite funny but brilliant in another way. Thank you for your help. So let me get this straight. The code we have here has missing parts on purpose so I have to find them. I tried sending the form and it displayed the have you filled in everything text so i am assuming I need to go into the php and find the parts missing and fill them in?

Well, I figured if you wanted it all done for you, you'd have gone to Rent-A-Coder or someplace like that, so coupled with my intrinsic laziness, I thought I would fix it enough that you would be able to learn from what I had done as well as fix a few odds and ends on your own. For example, I'm sure you don't want comments to be mandatory, yet as originally written, they were. I'm sure you can fix it, so I left it that way. Similarly, but a little more difficult, you might like the form displayed in a table so that you had columns of labels and columns of data. You'll have to stretch your abilities a bit but I think you'll be able to manage it, so I left that for you. That's all that comes immediately to mind in that regard, and as for learning from the code as it stands, I would draw your attention to the beginning of the file, where the $_POST array is read. I think you'll appreciate the efficiency with which that is done as opposed to the original version. Also, the 'have you filled in everything' has been enhanced to include a more specific error message. So, in summary, the code is fully functional but as I said, it could stand a few cosmetic improvements and some tinkering of which I think you are probably capable. If I misread the situation, I apologize and will continue improving it as time permits.

Thanks for the praise (a pat on the back is always welcome) & have a nice evening

Just a quick update. Been tinkering with the php form and added a few things and now just trying to figure out how to get some of the input area's to sit next to each other horizontally. This will make it loads more compact and easier to fill in as opposed to it being really long and arduous.

I have seen a few of the things you did and they are great. Thanks again.

I will post up here the finished site so you can see what I have been doing.