guidance on allowing users to submit info to a mysql database
I am interested in the idea of creating a website that allows users to submit content and display it on new pages for other users to view. For example having a form with a few text fields to fill out, and this will be the information that is shared. I have looked at some CMS software and most of it is too much for what i need. So if you have any advice or doc开发者_如何学Cumentation to lead me in the right direction that would be wonderful.
Any book on MySQL and PHP application development will contain examples that do exactly what you describe -- I suggest you buy one and get started on your adventure!
If you take up the challenge and not use existing code, one thing you'll want to know up front is this:
In any case, make 100% sure that the values users enter can not be interpreted as SQL code. If users abuse your forms and you don't take preemptive measures, SQL injection is an easy way of gaining access to the entire database or deleting data from it. Simply calling mysql_real_escape_string() on every variable that comes from the user form, will prevent this from being possible.
Check http://en.wikipedia.org/wiki/SQL_injection for more info on this.
Good luck!
look for lightweight CMS it not wise to reinventing the wheel
you can use a guest book source code it can do the job all you have to do is to add some html
While many CMS packages probably have more than you need, it will most likely still be easier to learn a CMS than to figure out how to do everything on your own.
That said, figuring out how to do it yourself is a much better way to learn the fundamentals of web development. A popular place to start is PHP running on Apache with a MySQL database. If you're on Windows, you can find packages that install all of those things together and saves you from a lot of the low level configuration, for example WAMP.
精彩评论