Explain, please, what to write in css, php, html files? Thank you in advance!

    2 answers 2

    Moving on a simplified scheme. First, the base, three tables.

    The first (messages), where messages / products / news are stored: id(auto_increment), text

    The second (comments), where comments are stored directly: id(auto_increment), msg_id, text, user_id

    The third (users) where users are stored: id(auto_increment), name, login, password

    HTML output:

     //Π²Ρ‹Π±ΠΈΡ€Π°Π΅ΠΌ ΠΈΠ· Π±Π°Π·Ρ‹ всС сообщСния, запросом Ρ‚ΠΈΠΏΠ°: select * from messages //Π²Ρ‹Π²ΠΎΠ΄ΠΈΠΌ Π² Ρ†ΠΈΠΊΠ»Π΅ сообщСния <div class="message_body"> Ρ‚Π΅Π»ΠΎ сообщСния //Π²Ρ‹Π±ΠΈΡ€Π°Π΅ΠΌ ΠΈΠ· Π±Π°Π·Ρ‹ ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ Π² соотвСтствии с Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Π½ΠΎΠ²ΠΎΡΡ‚ΡŒΡŽ. //запрос Ρ‚ΠΈΠΏΠ° select c.text as text, u.name as user_name from users u,comments c where c.msg_id = 'id сообщСния' and u.id=c.user_id //Π²Ρ‹Π²ΠΎΠ΄ΠΈΠΌ ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ Π² Ρ†ΠΈΠΊΠ»Π΅ <div class="comment_body"> тСкст ΠΈ имя ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ </div> //здСсь Ρ„ΠΎΡ€ΠΌΠ° добавлСния Π½ΠΎΠ²ΠΎΠ³ΠΎ ΠΊΠΎΠΌΠ΅Π½Ρ‚Π°, Ρ‡Ρ‚ΠΎ Ρ‚ΠΎ Ρ‚ΠΈΠΏΠ°: <div class="comment_add"> <form> <input type="hidden" value="id новости" name="msg_id"> <textarea name="text"></textarea> <input type="submit" value="Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ"> </form> </div> </div> 

    New PHP comment handler:

    Check whether the user is authorized; if yes, we get its id, check for the validity of the information coming from the site, add a new comment to the database. user_id we have mgs_id arrived post'om, text too, id will be assigned.

    CSS:

    And here as the heart tells. We make beautiful, perverted to the fullest.

    • I mixed up the names of the tables. - Oleg

    Almost nothing if you use this tool.

    • I know about it .. But it is desirable for me that everything be stored on my site! - Kamilplus
    • one
      Then I will answer your question like this: in css-, html-, php-files you need to write, respectively, css-, html-, php-code. I would also advise you to create a table comments in the database. The project is so serious that you do not trust disqus'u? Well, then you have half a hundred bucks to find a freelancer who will write you a block of comments. - caravaneer