Create a custom comment section using PHP - PHP tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ม.ค. 2025

ความคิดเห็น • 145

  • @praveenprajapati4175
    @praveenprajapati4175 6 ปีที่แล้ว +1

    Sir, You are greatest teacher ever.

  • @timsideris8377
    @timsideris8377 7 ปีที่แล้ว +1

    Thank you very much. My mother is from Denmark, so it was nice to learn from your accent. Maybe you know my cousins. Excellent training videos, thank you very much!

  • @godwinoluwadipe6098
    @godwinoluwadipe6098 4 ปีที่แล้ว +4

    Good teaching, I appreciate you.
    Please can you complete the series this week?

  • @AaronEstebanSEO
    @AaronEstebanSEO 5 ปีที่แล้ว +1

    12:50 you don't need to put the date, time, etc., into an input. You can just use plain php to write a date variable and send it straight into the database of when the comment was posted.

    • @rnomberg
      @rnomberg 3 ปีที่แล้ว

      could you elaborate ?

  • @mackynikat8833
    @mackynikat8833 4 ปีที่แล้ว

    10:46 i said to myself this is guy is a REAL GENIUIS!!!

  • @jhonny266
    @jhonny266 4 ปีที่แล้ว

    excellent lesson, very good.

  • @SlowEasyEnglish
    @SlowEasyEnglish 8 ปีที่แล้ว

    I'm not sure if the answer should be obvious to me but at 11:40, you didn't say why you chose to wrap the form in PHP tags. Just wondering why because if I sat down to do this myself, I would never think of doing it that way on my own.

    • @turboromy
      @turboromy 8 ปีที่แล้ว

      Maybe you figured it out already, but in case not, that form section will become visible/invisible depending whether user is logged in later on the series. There should be no difference within this video.

    • @dunnearbell
      @dunnearbell 6 ปีที่แล้ว

      he put it in php because earlier he used php for the time Copenhagen/.... something. so to recall that date time in the "date" field of the form, he needed to put the form in php...
      i think. im just learning as well.

  • @albertgarcia6483
    @albertgarcia6483 7 ปีที่แล้ว

    nice videos sir! its very helpful.

  • @Pradeepkumar-gy4is
    @Pradeepkumar-gy4is 6 ปีที่แล้ว +1

    this video is awesome and please make a video on star rating system in php with MySQL

  • @adamyoussef6880
    @adamyoussef6880 6 ปีที่แล้ว +1

    Hey, you're great! Thank you for sharing that. Can't wait to go for the next episode:)

  • @anamikapatel983
    @anamikapatel983 7 ปีที่แล้ว +1

    good job....

  • @convenientparking903
    @convenientparking903 8 ปีที่แล้ว +6

    when i did the SQL thing it gave me this error:
    A symbol name was expected! (near "date" at position 113)
    is there any way to fix this?

    • @npcDroneClass
      @npcDroneClass 4 ปีที่แล้ว

      a lot of this code has been retired and won't work on modern browsers. there must be hundreds of tutorials on making a comment section for personal blogs/sites, none work, period. i followed another tutorial, ended up being a waste of time because on part6 in the series, the provided code is no longer valid. gotta wonder how any website makes comment sections these days. all those facebook knockoff comment sections have to have a source code somewhere...

  • @MrOxford24
    @MrOxford24 5 ปีที่แล้ว

    Really nice video, good job! Nic!

  • @daoudaibrahim1368
    @daoudaibrahim1368 7 ปีที่แล้ว

    bravo best teacher

  • @Cd5ssmffan
    @Cd5ssmffan 7 ปีที่แล้ว +6

    I'm getting a syntax error on the table "comments" on line 6 "A symbol name was expected! (near ")" at position 165)"

    • @Cd5ssmffan
      @Cd5ssmffan 7 ปีที่แล้ว +7

      Never mind, I fixed it by removing the comma on line 5.

    • @twl148
      @twl148 5 ปีที่แล้ว

      noided

  • @kudrah
    @kudrah 8 ปีที่แล้ว

    Excellent!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @mackynikat8833
    @mackynikat8833 4 ปีที่แล้ว

    . i really wanted to visit shindlers's hometown , i really honor that guy deep into my nerves , to put a stone on his tomb to show gratitudes . im aiming to be like him soon . and if we're going to talk about Phillipines sir . a $usd here cost around 54 pesos , and compared to walmarts workers , mall attendants here earn 14,088 pesos a month . average skill CSR about 18k per month and if walmart attendant earn €18 per hour convert it to 8 hours which makes it €1728 a month . you can say 1 peso bill is uquivalent to € 0.0001 . just saying that im going to guide you here sir . you can be the man here with my intelligence and wisefullness .

  • @MrGentlemanism
    @MrGentlemanism 7 ปีที่แล้ว

    Great man, thanks a lot!

  • @bundas2011
    @bundas2011 4 ปีที่แล้ว +1

    can you create a download link for the code part?

    • @leoawara
      @leoawara 3 ปีที่แล้ว

      Yes, I am also looking for that. Were you successful in finding that?

  • @drezcovers1113
    @drezcovers1113 8 ปีที่แล้ว

    love your teaching style, subscribed :)

  • @jha.gaurav
    @jha.gaurav 7 ปีที่แล้ว

    You make only one post/article what if there is more then one post/video/article . How can i get comments for more than a post, please reply , you are very good teacher and programme r

  • @markuslanggeng
    @markuslanggeng 3 ปีที่แล้ว

    is this also an example of crud system?

  • @yoursspecial9280
    @yoursspecial9280 5 ปีที่แล้ว

    NICE

  • @JagdeepSingh-or5ke
    @JagdeepSingh-or5ke 4 ปีที่แล้ว

    I did exactly the same as you. Yet, the second closing tag of >? is being shown with the comment box in the output. Please Help!

  • @andya6569
    @andya6569 8 ปีที่แล้ว

    What software did you use for the screen capture ?

    • @Dani_Krossing
      @Dani_Krossing  8 ปีที่แล้ว +3

      I found Bandicam to be the best one for desktop capture. But I'm also using an uncompressed codec that can be downloaded for free called Largerith Lossless, which is compatible with Bandicam. Lossless gives the highest quality video, but also takes up a lot more space when you record.
      I have a video here on how to set up Largerith Lossless with Bandicam if you are interested: th-cam.com/video/T66cGD7nMko/w-d-xo.html

    • @andya6569
      @andya6569 8 ปีที่แล้ว +1

      thanks bro you just gained a subscriber

  • @hellafresh4520
    @hellafresh4520 8 ปีที่แล้ว +2

    is it possible if you can do video on how to create an upload only images with the comment section? For example, posting images on website with image descriptions and where others can comment those images?

    • @Dani_Krossing
      @Dani_Krossing  8 ปีที่แล้ว

      Similar to 9gag or memedroid?

    • @hellafresh4520
      @hellafresh4520 8 ปีที่แล้ว

      similar to Instagram! The photo on top and then comment down below!

    • @Dani_Krossing
      @Dani_Krossing  8 ปีที่แล้ว +1

      There have been a couple other requests as well but I'll try and get to it as soon as I can :)

    • @hellafresh4520
      @hellafresh4520 8 ปีที่แล้ว

      Thanks man! I appreciate all your hard work, in making these videos for us to learn!

  • @gabrielfono844
    @gabrielfono844 3 ปีที่แล้ว

    is this course still relevant in 2021?
    I have learnt most my thing through his course since a year and half.
    I look forward to hearing from you back Mr krossing

    • @Dani_Krossing
      @Dani_Krossing  3 ปีที่แล้ว +1

      No hehe. Always go for my courses that has a image of me on it (you can find it on my channel page). That one you commented on is quite old, and I should probably take it down 🙂

  • @megaresh4912
    @megaresh4912 3 ปีที่แล้ว

    u are a true god

  • @rodrigopineda2337
    @rodrigopineda2337 2 ปีที่แล้ว

    hi how are you? so i am going through your videos because i just created my website and i want a comment section where people can rate my service. I have a question regarding this, do they need a log in to be able to insert their names? or is it possible without it?

  • @akshaydeogaonkar7120
    @akshaydeogaonkar7120 4 ปีที่แล้ว

    Does it need a database?

  • @NirajDhakal
    @NirajDhakal 7 ปีที่แล้ว

    Really very helpful tutorial. Just everything is covered in this series. But i want latest comment a very top. Want your kind help...

  • @rajeev6843
    @rajeev6843 8 ปีที่แล้ว

    bro you are life saver!!!!!!!!!

    • @Dani_Krossing
      @Dani_Krossing  7 ปีที่แล้ว +1

      Thanks

    • @rajeev6843
      @rajeev6843 7 ปีที่แล้ว

      Bro can you suggest any idea or project that i can take up as my under-graduation project .
      I need to execute and present it to my professor at the university.

    • @globaldevelopernetwork4435
      @globaldevelopernetwork4435 7 ปีที่แล้ว

      Just recreate a mini instagram or twitter?

    • @aseemlalfakawma5084
      @aseemlalfakawma5084 7 ปีที่แล้ว

      something like google keep, which saves notes and all, with login, etc.

  • @fanisdeli
    @fanisdeli 7 ปีที่แล้ว

    Tip: you can use double quotes IF you use single quotes on the echo. for example: echo ' ';

  • @rizkyseptianto
    @rizkyseptianto 5 ปีที่แล้ว

    good

  • @Ginfio
    @Ginfio 3 ปีที่แล้ว

    wait, you never showed us how to display the comments.

  • @ArrayBuffer
    @ArrayBuffer 7 ปีที่แล้ว

    good tutorial

  • @mediastreamer-24
    @mediastreamer-24 7 ปีที่แล้ว

    this is going to submit comment to one article, what if we have multiple articles, all articles will have the same comments! , what is the best way to have a single comment for each article?

  • @gautamkumarravi2870
    @gautamkumarravi2870 6 หลายเดือนก่อน

    nice

  • @cadeaulucmann1949
    @cadeaulucmann1949 6 ปีที่แล้ว

    ok hum that's all for the comment section? i thought it was a big deal so i just need to create a table for these contents nd select them from this table to be published in my php page.... Will user see the comment of each other if i do it this way?

  • @leon1985ist
    @leon1985ist 5 ปีที่แล้ว +1

    Hi how are , any new ideas to do same thing but for 2019

  • @cygnus540
    @cygnus540 6 ปีที่แล้ว

    When i wrap the form in the php tag after the button on the page it shows ";?>

  • @oba-joshuasamuel8293
    @oba-joshuasamuel8293 4 ปีที่แล้ว

    Please how can I create a cms that I can use to update both media files and text contents on my website. Thanks

  • @nvandermark3517
    @nvandermark3517 7 ปีที่แล้ว

    What is that lettertype u using?

  • @StanleySK
    @StanleySK 7 ปีที่แล้ว

    please help me, i don't have full message from comment in comment-box, i wrote a long line of text and they are no paragraphs, it write me only one line of text out of the box

  • @sanjayn7029
    @sanjayn7029 4 ปีที่แล้ว

    Thanks a lot

  • @jggamingYT
    @jggamingYT 7 ปีที่แล้ว

    You use varchar(128) for your uid, but is it also possible to use int(11).
    Because you are using "user id" and not "username" am I correct?

    • @SimicMateja
      @SimicMateja 7 ปีที่แล้ว

      id = user id
      uid = username (example: Jelmer55)

  • @MechaGriffin
    @MechaGriffin 7 ปีที่แล้ว

    Hello mmtuts!
    Do you have a video where you show the installation of PHP? I want to make sure when I follow your tutorials, there won't be any error due to incorrect installation or a missing installation.
    If you respond, I would be absolutely overjoyed.

    • @Dani_Krossing
      @Dani_Krossing  7 ปีที่แล้ว

      GamerGriffin If you start at the beginning of my PHP playlist, then I will show how to get started ;)

    • @MechaGriffin
      @MechaGriffin 7 ปีที่แล้ว

      mmtuts Alright, I'll give it a look, thanks for the reply!

  • @rockface9269
    @rockface9269 8 ปีที่แล้ว

    Hello,I feel as though it would be appropriate to describe a database you can use for this and how to set it up.

    • @Dani_Krossing
      @Dani_Krossing  8 ปีที่แล้ว +2

      If you go back in my PHP playlist I have shown in detail how to set up a phpmyadmin database and what it is :)

  • @quakepie6627
    @quakepie6627 6 ปีที่แล้ว

    thank you for the lesson really helps us.

  • @jayaruban8534
    @jayaruban8534 6 ปีที่แล้ว

    i was made a comment section on my cpanel, but it doesn't work. It's showing an " is currently unable to handle this request.
    HTTP ERROR 500" this error. how to fix it

  • @mackynikat8833
    @mackynikat8833 4 ปีที่แล้ว

    . and the way you look sir . your charm . with that saying this with confident we can make a fortune out of that . me myself you already deserved a kiss ...

  • @exo7655
    @exo7655 7 ปีที่แล้ว

    so... When i try to type in the date and time up at the top all i get is it shows me the line of code but when I remove it it's fine I just dont understand....

    • @sanjayn7029
      @sanjayn7029 4 ปีที่แล้ว

      You can use this code:
      date_default_timezone_set('America/Santiago')
      This has the same time zone as Maryland

  • @mr.blue7357
    @mr.blue7357 4 ปีที่แล้ว +1

    You kinda sound like @LieLikesMusic

  • @zgong9919
    @zgong9919 8 ปีที่แล้ว

    My comments don't go in the order they are posted, they go in the middle alot of the time. Would this maybe be because i didn't have the datetime thing becuase i didn't want it? and is there any way to sort them by id in phpmyadmin or when reading out the database entries.

    • @Dani_Krossing
      @Dani_Krossing  8 ปีที่แล้ว

      Hi there! You could use "ORDER BY id" instead of by date. But if you are making a comment system I think it is VERY important to have the date registered in the database. Even if you are not planning on showing the date inside you website, it is still important to have data that you can use for other purposes such as deciding the order you want to show posts on a site :)

  • @vladimirputin5658
    @vladimirputin5658 7 ปีที่แล้ว

    Can I ask you where did you studied???

  • @Solitide
    @Solitide 8 ปีที่แล้ว

    the date time doesn't work for me. i get the time 0000-00-00 00:00:00 everytime

    • @Solitide
      @Solitide 8 ปีที่แล้ว +1

      i fixed it .. forgot the
      $date = $_POST['date'];
      haha

    • @hitfromcs
      @hitfromcs ปีที่แล้ว

      @@Solitide still helpful after 7 years! Thanks

  • @Enopocalypse
    @Enopocalypse 9 ปีที่แล้ว

    How would you write the code to say how long ago the comment was posted instead of what date the comment was posted (Similar to how TH-cam does it)?

    • @Dani_Krossing
      @Dani_Krossing  9 ปีที่แล้ว

      +Cheeky_Tree
      Then you would need to write a PHP script that counts the time between the date that is registered within the database and the current date. And if you want it completely authentic to how TH-cam does it, round up the time depending in how long ago it was posted.
      If I get the time I will show how to do this as well.

    • @Enopocalypse
      @Enopocalypse 9 ปีที่แล้ว

      So the registered date would be kept in seconds? I don't know if this would be correct or accurate at all, but when I researched it, this is the example that I could find which made the most logical sense.So would you say this is the sort of script that I would need:
      $calc_times[] = array('Year', 'Years', 31557600);
      $calc_times[] = array('Month', 'Months', 2592000);
      $calc_times[] = array('Day', 'Days', 86400);
      $calc_times[] = array('Hour', 'Hours', 3600);
      $calc_times[] = array('Minute', 'Minutes', 60);
      $calc_times[] = array('Second', 'Seconds', 1);
      Or something along those lines as long as it is in an array
      Then I would need a foreach loop going through and checking what it would be named?

    • @Dani_Krossing
      @Dani_Krossing  9 ปีที่แล้ว

      +Cheeky_Tree
      You are on the right track, I would do something like this:
      date_default_timezone_set('Europe/Copenhagen');
      $timePosted = strtotime('2016-01-19 18:20:20');
      $timeCurrent = strtotime(date('Y-m-d H:i:s'));
      $getSeconds = $timeCurrent - $timePosted;
      $getTime = array(
      array('Second', 'Seconds', 60),
      array('Minute', 'Minutes', 3600),
      array('Hour', 'Hours', 86400),
      array('Day', 'Days', 2592000),
      array('Month', 'Months', 31104000),
      );
      if ($getSeconds < $getTime[0][2]) {
      echo $getTime[0][1];
      } elseif ($getSeconds < $getTime[1][2] && $getSeconds > $getTime[0][2]) {
      echo $getTime[1][1];
      } elseif ($getSeconds < $getTime[2][2] && $getSeconds > $getTime[1][2]) {
      echo $getTime[2][1];
      } elseif ($getSeconds < $getTime[3][2] && $getSeconds > $getTime[2][2]) {
      echo $numDays.$getTime[3][1];
      } elseif ($getSeconds < $getTime[4][2] && $getSeconds > $getTime[3][2]) {
      echo $getTime[4][1];
      }

  • @beebuwear
    @beebuwear 6 ปีที่แล้ว

    I am new here, please how do i get the source code?

  • @KimKongKun1337
    @KimKongKun1337 7 ปีที่แล้ว

    Have you bought Sublime Text?

    • @YoureHot
      @YoureHot 7 ปีที่แล้ว

      You don't need to buy that.

  • @blexyt3485
    @blexyt3485 7 ปีที่แล้ว

    hello dear,
    you are my impression and teacher also,
    thank you for all,
    and thanks to internet and youtube to possible this
    Q:>/ which text editor use to PHP,
    -->in your previous 'PHP hash ' video
    encrypt pwd and enter in myphpadmin, right,
    but
    Q:>/a real pwd in myphpadmin but another way to encrypt and decrypt pwd when password enter in page by user

  • @diogogaspar68
    @diogogaspar68 5 ปีที่แล้ว

    So after the button there are these characters ?">, what do I do.

    • @diogogaspar68
      @diogogaspar68 5 ปีที่แล้ว

      Actually "; ?>

    • @Jonny9403
      @Jonny9403 5 ปีที่แล้ว

      @@diogogaspar68 Same problem. I'm not a pro, i just need those structures for a little basis but can't even open the php file, nor do I understand those guys talking about installing "php". What is there to be installed? It just works for me, when I name the file .html, but then there occur the endings ";?>
      Crazy stuff.

    • @SirZyPA
      @SirZyPA 5 ปีที่แล้ว

      @@Jonny9403 thats why you install xampp, so, php is a server side programming language, and it requires you to compile it, html is a markup language, and every browser automatically compiles your markup thats why html works for you, and php does not.
      Google xampp and download it, then open the program, start your apache and MySQL server, then go to "c:/xampp/htdocs" and put your files there, then when you want to open it, open your browser and in your url navigator, write localhost

  • @fariazkhan1779
    @fariazkhan1779 6 ปีที่แล้ว +1

    Whenever I am refreshing the page, the data gets re-inserted.
    Can you please tell me how to get rid of this?

  • @nishatrabbi
    @nishatrabbi 5 ปีที่แล้ว

    sir can you tell me where can I see those submitted comments?

    • @scsv8525
      @scsv8525 2 ปีที่แล้ว

      yeah same

  • @mackynikat8833
    @mackynikat8833 4 ปีที่แล้ว

    . and to someone who's just getting a first look in this comment , this is how you extract parse information out of a php statements in html tags /*

    • @mackynikat8833
      @mackynikat8833 4 ปีที่แล้ว

      @@wibbuffey sorry I forgot the d

    • @mackynikat8833
      @mackynikat8833 4 ปีที่แล้ว

      @@wibbuffey can you just apply the d . what just you creating ryt now ?

  • @scsv8525
    @scsv8525 2 ปีที่แล้ว

    but... where the comments go?

  • @eugenedonato5688
    @eugenedonato5688 5 ปีที่แล้ว

    Sir, can you please make a video on how to upload a website to the internet. Thank you very much. :)

    • @bedrockcoder5169
      @bedrockcoder5169 5 ปีที่แล้ว +1

      you need to buy a domain, web hosting service, and stuff I think

    • @eugenedonato5688
      @eugenedonato5688 5 ปีที่แล้ว

      Thank you sir.

  • @raypist1524
    @raypist1524 7 ปีที่แล้ว

    you never showed how to include the css into the php, and i'm new to all of this.

    • @raypist1524
      @raypist1524 7 ปีที่แล้ว

      Ah thank you so much, I've been racking my brain for a week!

  • @kurdistanregion6592
    @kurdistanregion6592 6 ปีที่แล้ว

    where are the patron files? :)

  • @johnjordandionisio9402
    @johnjordandionisio9402 6 ปีที่แล้ว

    Can someone help me i cant style the textarea and button basically all the elements inside the "echo"

    • @musiclibrary4706
      @musiclibrary4706 6 ปีที่แล้ว

      maybe you didn't link your css file to your html ..
      rename your css file "style.css" and put this code inside your tag

    • @johnjordandionisio9402
      @johnjordandionisio9402 6 ปีที่แล้ว

      rolly asuncion i did, cause i try styling other elements and it work just fine

    • @equasezy
      @equasezy 5 ปีที่แล้ว

      did you solve it?

    • @equasezy
      @equasezy 5 ปีที่แล้ว

      just made a class called .textarea instead of just calling textarea{} and it worked.

  • @funwithalbi2425
    @funwithalbi2425 2 ปีที่แล้ว

    src? pls

  • @atvoriginals
    @atvoriginals 4 ปีที่แล้ว

    India✋

  • @galvinleven7550
    @galvinleven7550 6 ปีที่แล้ว

    gud

  • @LuigiCotocea
    @LuigiCotocea 5 ปีที่แล้ว +2

    Part 2 pls!

  • @jackfrost8969
    @jackfrost8969 6 ปีที่แล้ว

    include this in a playlist

    • @Dani_Krossing
      @Dani_Krossing  6 ปีที่แล้ว +1

      No this video has a lot of bad programming habbits in it. It is still a good "guide" which is why I haven't taken it down yet, but it is not a secure way to create a comment section using PHP.

    • @jackfrost8969
      @jackfrost8969 6 ปีที่แล้ว

      @@Dani_Krossing then can you plz make a new video. this comment series didnt even work for me.

  • @blexyt3485
    @blexyt3485 7 ปีที่แล้ว

    Advise_Or_Contr:>/
    in your previous video " Create error handling for PHP login " cross checking first, last, uid, and pwd.
    we can you || or AND conditions for empty error handling
    exp:>? if ( empty ( $first ) || empty ( $last ) || empty ( $uid ) || empty ( $pwd ) ){
    //same code as what you want....
    }

    • @mahohiyajo
      @mahohiyajo 7 ปีที่แล้ว

      || == OR not AND, AND == &&

  • @byreaper8992
    @byreaper8992 8 ปีที่แล้ว

    Why is your webspace so fast? :( I have much longer waittimes than you.

    • @Dani_Krossing
      @Dani_Krossing  8 ปีที่แล้ว +1

      I'm using XAMPP to work on a local server, not an online server which makes it faster.
      Also, trying not to make this sound braggy, I also have a high end PC which makes it faster since the server is on my PC and not online :)

    • @byreaper8992
      @byreaper8992 8 ปีที่แล้ว

      I have it also on my pc, but with IIS from Microsoft.. thanks for answer.

  • @sympathycapture9233
    @sympathycapture9233 6 ปีที่แล้ว

    am getting error in my sql

  • @ArrayBuffer
    @ArrayBuffer 7 ปีที่แล้ว

    ur color scheme name please

  • @sympathycapture9233
    @sympathycapture9233 6 ปีที่แล้ว

    CREATE TABLE comment()
    cid int(11)not null AUTO_INCREMENT PRIMARY KEY,
    uid varchart(128) not null,
    date datetime not null,
    message TEXT not null
    );

  • @TechMechMaster
    @TechMechMaster 6 ปีที่แล้ว

    plz send code

  • @miataylor16
    @miataylor16 4 ปีที่แล้ว

    Hi Dani, am I able to make WordPress Plugins for my website if I learn PHP? I got a web hosting plan with lightyearhosting.com/ and built a blog, and I'd like to make my own plugins. :) Is it hard?

  • @soniaprajapati5248
    @soniaprajapati5248 ปีที่แล้ว

    php

  • @snø_music0
    @snø_music0 7 ปีที่แล้ว +1

    im getting a syntax error unexpected 'date' (T_STRING), expecting ',' or ',' in C:/xamp etc. any suggestions? my code is exactly as yours is

    • @adampetersson6809
      @adampetersson6809 7 ปีที่แล้ว

      Did u get the whole system to work or is it outdated?