The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

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.

It would help if you included a dump for your table. Other users can the try your code an identify the problem. Whilst your code looks ok if this for is for public submission I would add escaping of certain chars to certain fields just in case.

Hi
I think I just spotted your error. You have no $_POST['submit'] field. Even if you did it would be better to give it a value also. Try the code below. Form now has hidden field with value equal to auth. I hav'nt tried this but should work now. Any further probs please post table dump.

This forum appear to have altered code from copy and paste. This is correct. It would help if you posted tables then I could try locally on my machine. Im unwilling to sit a make the database and tables. Rplace the last few lines with that above.

It looks like the else statement is causing the problem. My code is just a modified version on Kevin Yank's code from his book "Build you own datebase driven website using PHP & MySQL" 2nd edition on page 98 and 99. If anyone knows how to get this to work that would be great. Thanks so much to all who have helped me so far and to those who help in the future.

PS: Sorry for the large amounts of code... I just post it all cause the SQL error isnt accurate on the error line number half the time.

I still have a problem though, When the user enters the info and clicks submit the page reloads without adding anything to the database. Why would it do this? I have copied Kevin Yanks book to a tee and yet doesnt work. Any ideas?