How to program a vote up system?

前端 未结 2 763
情歌与酒
情歌与酒 2021-02-11 02:55

I am in the very beginnings of teaching myself php. I am giving myself micro projects to push myself.

Thus far I have a MYSQL database, created through a php form. One C

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-11 03:21

    Personally I like Jonathan's answer.

    However if you feel like you might need more info, I might be able to help.

    As a small side project I tried to make a quote database like bash.org for my university.
    It was developed using MySql and PHP, it has posting/voting much like what you are trying to accomplish.
    It is by no means a well designed web app. However it might be able to get you going in the right direction.

    Live testing site: link (be gentle!)

    Code on GitHub: link

    I would take a look at the database schema , the php-db-integration and the ajax to update a vote.

    The code is fairly simple and straight foreword. One thing of note is the "filter_input"s, These functions are from a PHP library to sanitize user inputs to prevent SQL injections.

提交回复
热议问题