PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
tag added][/size]
My question is this: is there a more elegant/better way to redirect the user to a clean form other than using
'header("Location: http://localhost/insert_form2.html");'
(of course, 'localhost' will be something else in the future)??
Thanks in advance!
A server-side redirect is fairly elegant, user knows little about it and they then can't refresh the screen 16 times and insert the same thing over and over.
Ok. It's working as it is, but I will try Jam's way and let you know. Is there a difference with the number of hits? I don't know if 'hits' is the right word, but whatever connotes 'new connections to the server'? I would like to do it some way that the same user doesn't get counted again.
"I would like to do it some way that the same user doesn't get counted again. "
I'm having a hard time understanding that with the original post, so I'll mention two solutions...
a) Actually counting users, as in pagevisitor counter; You can use $_COOKIES. If cookie is not set = set it, and add visitor count to the database. If set, user is counted.
b) Actually blocking the insert in the original post; Add an additional query to the database that contains "select coname from clients where coname = '$_POST[coname]'". Use mysql_num_rows() (or similiar) to get the number of results. If it is > 0, there is allready an entry with that data. If not, well... Insert it.