I've made a new improved version (2016) of this video (2013): ruclips.net/video/0KwnPS5OhGI/видео.html Fixed: New comments are on the top No undefined variables Please watch the new video!
Thanks a ton this is the only tutorial of this variety as far as php comments go. I'm using this as the basics for my forum I'm making for some friends and I to use. Much appreciated you are awesome.
This guy has done a great JOB the concept here is your ability to write to the external file and then display what you have written to the file.. So if you were using database you cold first write a PHP program to post data to the file. Then use mysql_fetch_assoc() or mysql_fetch_array(). To display back what have posted in data base. Then a caution should be take to avoid website attacks and Database injections....... So thanks very much sour cherry
You need to INSTALL A LOCAL WEB SERVER to run PHP scripts! Otherwise PHP will display as plain text. The local web server makes an environment like on a web host, so you can run scripts like PHP that use servers to process the data. But languages like HTML, CSS and JavaScript don't need one. PHP won't work without a web server! Good local web servers are: XAMPP - www.apachefriends.org/index.html Денвер - www.denwer.ru/ WAMP - www.wampserver.com/en/
no wander mine doesnt work. so thankful that i ran to the comment section and found this haha. bet im still re typing the codes for a million times if havent read this. thankss
hey can you help me make school project ... its too hard for me cause i was absent when the chapter html was taught.And the big problem is recently our computer teacher has been changed.I just don't know how to make one i would become fail if i don't make one.Please !please!! help me :( :( i have to submit it within 3 days. please help me
Sujan Acharya lol I know this is from 2 years ago but html isn’t that hard to learn. I learned html and css in a day and can code a website in my sleep
Hello there, this is such a great Tutorial indeed, thanks alot for sharing !!! Now, quick question please : What is the exact location of the com.txt file ? in the / directory ? elsewhere ? CHEERS !
Fatal error: Maximum execution time of 20 seconds exceeded in /home/vhosts/web-sajtovi.eu5.org/1/index.php on line: echo fread($read, 1024); How solved?
I am in Notepad ++. Did the code "perfect" as shown in the video. It is not working. It shows the comment bar, but everything under the /?php tag shows in as pure code. What language do I use? I am using html. I even saved it as index.php. What do I do?
php is a web based script or sever side script which the user should not be able to see the php codes. so just installing note+ will not help u so download php and run such like C:\php\php.exe myfile.php.
you want to connect with Sql for data storing or retrieving just set up a local server. download wamp or xamp. these app have all in one so u don't need to install one by one messing up.
okay I know this video is really old and I am probably going to sound stupid for this I figured out how to change the name and message color and move them around where I want to place them but when it comes to posted comments I can't seem to figure out where to move/change there color at all anyone know how?
I know the video is old, the new version is: ruclips.net/video/0KwnPS5OhGI/видео.html What language did you use to make comments move around? PHP can't do it, so to change the color or position you will need JavaScript.
sour cherry pls help me, i tried to paste in to my website, unfortunately it is showing error. It is showing the programming codes in the website under the comment box..
hi there i know this is to late to ask but forgive me for asking because i really need this answer , i have data a stord on my php my admen and i can restor thim on i white page with all the data on it, my question how can i put thous data in to html table form instead of of white page, note that i am still learning php. so forgive me ^_^
sour cherry i already type your codes but the problem is theres a paragraph here just like this and i just need it i will use it in my thesis it will help big a lot thanks :) :) :) and also i type it in notepad cuz i don't have notepad ++ Name: Message:
can you please tell me how do i made comment post to another page...like if i enter comment and it goes to another html file...not the file in which is commentbox
The action attribute in holds the URL of the file that processes the request. If it's " ", it means the same page, like in the video. You should put there the path to the file with the comments, for example 2.php: and in2.php the PHP code will be the same, but without if($_POST):
Works pretty good and can be tweaked to fit your website. How do you get the com.txt load each time you visit the page?, it seems it only shows up after you make a comment.
+impaulgriffiths This part of code - fopen("com.txt", "r+t") - opens the file in the mode "r+t" (the second parameter), which makes PHP write the new comments in the beginning of the file. That's why when PHP reads the file - fread($read, 1024) - it reads the comments that are on the top of the file first.
After you install xampp you have to go to XAMPP Control Panel and click the Start buttons next to Apache and MySQL. Then create the files which I showed in the video and save them in C:\xampp\htdocs\ in a folder (it doesn't matter how you name it). To see the files in the browser write in the adress bar localhost/your folder
Thank you for your responded. I found it. I copied code files there. I installed wamp server and I have a website. I created it with wix. I can add html code that. So now. What Should I do?
Obsidian Fox Есть такая функция как date(), можно указать день, месяц, год и т.п., но для часов и минут будет выглядеть вот так: date('G:i'); И вставляется в код вот так: #WRITE DOWN COMMENTS# $write = fopen("com.text","a+"); $date = date('G:i'); fwrite($write, "$date $name$text"); fclose($write); $date будет переменной, в которой записывается время сообщения в момент комментирования. Вот здесь есть таблица со значениями функции date для месяца, дня, года и т.п: php.net/manual/ru/function.date.php
Thanks for your reply! In this video the comments become under the label. But it would be nicer if the comments appear in a label (box) to and not under the label. Do you have a solution ...
You have to edit the $string you write down in the .txt file and put it in a div (box): #Delete everything, write down new and old comments $write = fopen("comments.txt", "w+"); $string = "".$Name."".$Comment." ".$old_comments; fwrite($write, $string); fclose($write); fclose($old);
sir this does not work at all and i am really quite sad, all videos i watch all lead me to failure at this and i dont understand why. please help me understand why this does not work. :(
Your code looks fine, but try to validade it using HTML Validator and PHP CodeCheck (Google It)... And Also, You should try to reconfigure your local server and update it...
You can't. HTML can't receive information from the user and CSS is only for styling. You need PHP to get the comments, write them down in a file and then display them.
No I want to create a web page only with html: someone can write a comment others can see this comment. I would love to save the comments with the nickname. But I use pycharm as a development environment I can not use php. That's the problem
If you watch the video you'll get it. But I strongly recommend learning at least the basics of PHP and HTML before trying to do something more complex.
First, I'm not a man; Second, I think if English is not one's native language, it's better to make videos with captions instead of talking with an accent
Absolutely not true. Hearing an accent is way better than reading. For reading, one can go to html pages. So, please jump over the hurdle of fear, and start talking. The accent is your true self, it can even be sexy or cute. Take my advice and speak. Remember, this is a video of sight and sound. I think you even have a pretty face, if you show your face as you explain, you will get even better ratings and better views. Let me know of your next video with speaking, please and I will be happy to watch. Lastly, I do apologize for thinking such a lovely face is a man. Do accept my apology.
I've made a new improved version (2016) of this video (2013): ruclips.net/video/0KwnPS5OhGI/видео.html
Fixed:
New comments are on the top
No undefined variables
Please watch the new video!
Thanks a ton this is the only tutorial of this variety as far as php comments go. I'm using this as the basics for my forum I'm making for some friends and I to use. Much appreciated you are awesome.
Eiga Productions Thanks :D
This guy has done a great JOB the concept here is your ability to write to the external file and then display what you have written to the file.. So if you were using database you cold first write a PHP program to post data to the file. Then use mysql_fetch_assoc() or mysql_fetch_array(). To display back what have posted in data base. Then a caution should be take to avoid website attacks and Database injections....... So thanks very much sour cherry
Wow, this was 8 years ago. But still very useful ! Or I can even say that this is one of the most useful video ever !
I think its better to do comments system with mysql
You are a legend man❤❤
How to keep the comments updated in every 1~3 seconds? I mean how to make it a real time comment box?
i loved your comment staff you did from beela dowd i live in los banos
You need to INSTALL A LOCAL WEB SERVER to run PHP scripts! Otherwise PHP will display as plain text. The local web server makes an environment like on a web host, so you can run scripts like PHP that use servers to process the data. But languages like HTML, CSS and JavaScript don't need one.
PHP won't work without a web server!
Good local web servers are:
XAMPP - www.apachefriends.org/index.html
Денвер - www.denwer.ru/
WAMP - www.wampserver.com/en/
no wander mine doesnt work. so thankful that i ran to the comment section and found this haha. bet im still re typing the codes for a million times if havent read this. thankss
can someone please help me, i need a code or tutorial about editing the comment
hey can you help me make school project ...
its too hard for me cause i was absent when the chapter html was taught.And the big problem is recently our computer teacher has been changed.I just don't know how to make one i would become fail if i don't make one.Please !please!! help me :( :(
i have to submit it within 3 days.
please help me
Sujan Acharya lol I know this is from 2 years ago but html isn’t that hard to learn. I learned html and css in a day and can code a website in my sleep
@@blutoo2155 really wtf can u teach me lol
Hello there, this is such a great Tutorial indeed, thanks alot for sharing !!! Now, quick question please : What is the exact location of the com.txt file ? in the / directory ? elsewhere ? CHEERS !
Nice
Fatal error: Maximum execution time of 20 seconds exceeded in /home/vhosts/web-sajtovi.eu5.org/1/index.php on line: echo fread($read, 1024);
How solved?
u use Freewha.com?
u're a legend
@Fix Egg i know
Thank you so much.
I am in Notepad ++. Did the code "perfect" as shown in the video. It is not working. It shows the comment bar, but everything under the /?php tag shows in as pure code. What language do I use? I am using html. I even saved it as index.php. What do I do?
php is a web based script or sever side script which the user should not be able to see the php codes. so just installing note+ will not help u so download php and run such like C:\php\php.exe myfile.php.
you want to connect with Sql for data storing or retrieving just set up a local server. download wamp or xamp. these app have all in one so u don't need to install one by one messing up.
Thanks :)
okay I know this video is really old and I am probably going to sound stupid for this I figured out how to change the name and message color and move them around where I want to place them but when it comes to posted comments I can't seem to figure out where to move/change there color at all anyone know how?
I know the video is old, the new version is: ruclips.net/video/0KwnPS5OhGI/видео.html
What language did you use to make comments move around? PHP can't do it, so to change the color or position you will need JavaScript.
sour cherry pls help me, i tried to paste in to my website, unfortunately it is showing error. It is showing the programming codes in the website under the comment box..
Check your code here:
#DISPLAY COMMENTS#
$read = fopen("com.txt", "r+t");
echo "All comments:";
You could have missed the "; after All comments:
hi there i know this is to late to ask but forgive me for asking because i really need this answer , i have data a stord on my php my admen and i can restor thim on i white page with all the data on it, my question how can i put thous data in to html table form instead of of white page, note that i am still learning php. so forgive me ^_^
Thanks a lot!
sour cherry i already type your codes but the problem is theres a paragraph here just like this and i just need it i will use it in my thesis it will help big a lot thanks :) :) :) and also i type it in notepad cuz i don't have notepad ++
Name:
Message:
This is good! and I need this code to my website hehe Im just a advance or beginner programming
How do i show the date and time and how do i show newest comments at the top and old comments down ?
in your tutorial is it possible to put delete feature on the project?
Getting error between $name
$text
")fclose($write);#DISPLAY COMMENTS# and so much other words...
same
Thank you😁
It is local or global?
good
This brings me to something
$name
$text
"); fclose($write); $read = fopen("com.text", "r+t"); echo "All Comments:
"; while(!feof($read)){ echo fread($read, 1024); } fclose($read); } else{ $read = fopen("com.text", "r+t"); echo "All Comments:
"; while(!feof($read)){ echo fread($read, 1024); } fclose($read); } ?>?
What should I do?
Are you sure you haven't missed a quote? The other reason might be that your file hasn't got .php extension or you don't have a local web server
what is the "a+" and the "t+r" next to the com.txt????
Hi,how do you make it display new comments above old comments? i tried ($read,1024) but its not working. please help
It's explained in my updated video: ruclips.net/video/0KwnPS5OhGI/видео.html
The code is in the comments
can you please tell me how do i made comment post to another page...like if i enter comment and it goes to another html file...not the file in which is commentbox
The action attribute in holds the URL of the file that processes the request. If it's " ", it means the same page, like in the video. You should put there the path to the file with the comments, for example 2.php:
and in2.php the PHP code will be the same, but without if($_POST):
osm
Is php and html the same thing
thanks for the video
8 year ago😮
Can We Publish This?LIKE ON WEB
did we need to write php in html?
Works pretty good and can be tweaked to fit your website. How do you get the com.txt load each time you visit the page?, it seems it only shows up after you make a comment.
Thanks..
or do I need to buy a Domain?
how do you make it display new comments above old comments?
+impaulgriffiths This part of code - fopen("com.txt", "r+t") - opens the file in the mode "r+t" (the second parameter), which makes PHP write the new comments in the beginning of the file. That's why when PHP reads the file - fread($read, 1024) - it reads the comments that are on the top of the file first.
sour cherry thank you [: cant wait to play with this later [:
tnx
thanks
How to I make a comment box only allow people to comment if they are logged into my website
Before the part in the PHP file put code to check if there is log in cookie (I suppose you use cookies?):
it's working but theres an error msg in the webpage everytime i delete all the content in com.txt
does this work in notepad? I don't have np++
You don't need it. Its just a tool to write
I did what I have to do and downloaded xampp.....
what do I do next?
thanks if you answer my question...
After you install xampp you have to go to XAMPP Control Panel and click the Start buttons next to Apache and MySQL. Then create the files which I showed in the video and save them in C:\xampp\htdocs\ in a folder (it doesn't matter how you name it). To see the files in the browser write in the adress bar localhost/your folder
thanks
what is the function of php
Исходный код, пожалуйста ?? Еще я из норильска, здесь очень ужасно
thx for the vid. i'm making a video sharing website and i would like to add comment possibility
I did everything on video. But I don't know how I can add to server. Can you help me? I installed "wampserver"
Your code files should be in the root folder (www) for PHP to run. The path is usually "X(or the name of your virtual disk)/home/somefolder/www".
Thank you for your responded. I found it. I copied code files there. I installed wamp server and I have a website. I created it with wix. I can add html code that. So now. What Should I do?
Друг, а подскажи, как еще сделать вывод времени сообщения?
Obsidian Fox Есть такая функция как date(), можно указать день, месяц, год и т.п., но для часов и минут будет выглядеть вот так:
date('G:i');
И вставляется в код вот так:
#WRITE DOWN COMMENTS#
$write = fopen("com.text","a+");
$date = date('G:i');
fwrite($write, "$date $name$text");
fclose($write);
$date будет переменной, в которой записывается время сообщения в момент комментирования.
Вот здесь есть таблица со значениями функции date для месяца, дня, года и т.п: php.net/manual/ru/function.date.php
Good job
is there a way to color the text?
yes
privet
Can we not put text area instead of
Spasibo
Thanks for this great video!
But I have one question. Is it also possible to place the comments in a label?
If you mean styling the user name, you can use CSS for the tag:
b{ css code }
Thanks for your reply! In this video the comments become under the label. But it would be nicer if the comments appear in a label (box) to and not under the label. Do you have a solution ...
You have to edit the $string you write down in the .txt file and put it in a div (box):
#Delete everything, write down new and old comments
$write = fopen("comments.txt", "w+");
$string = "".$Name."".$Comment."
".$old_comments;
fwrite($write, $string);
fclose($write);
fclose($old);
Thank you! I'm going to try... Let you know.
How do you create the database ?
It doesn't work with MySQL database, the comments are written down in a .txt file
sir this does not work at all and i am really quite sad, all videos i watch all lead me to failure at this and i dont understand why. please help me understand why this does not work. :(
+conner mcadams This code will work only if you have a local web server like Apache, XAMPP or Denwer. What happens when you run the code?
it doesnt print write and doesnt show up.
+conner mcadams Something's wrong with the code. Could you post it?
Name:
Message:
Your code looks fine, but try to validade it using HTML Validator and PHP CodeCheck (Google It)... And Also, You should try to reconfigure your local server and update it...
It can be exploited by XSS cuz it show the comment in html form
Fabulous! But, please: how to display posts into ascending order, where the latest post is at the top (and the oldest at the bottom end)?
I've made a new version of this video (with new posts on the top): ruclips.net/video/0KwnPS5OhGI/видео.html
Большое спасибо! Thank you very much!
who actually remembers all of this lol
No one. They search, click, and copy.
Can you please send me the source code
please how can i creat a systeme comment without php just with html and CSs
You can't. HTML can't receive information from the user and CSS is only for styling. You need PHP to get the comments, write them down in a file and then display them.
Lena Kiki I do not want to save the content. I do not want to connect the page to a database just write comment
So you want people to write something, press a button and then everything is deleted?
No I want to create a web page only with html: someone can write a comment others can see this comment. I would love to save the comments with the nickname. But I use pycharm as a development environment I can not use php. That's the problem
You can't save or display the comments without PHP. And why are you using pycharm? Is you programme in Python?
Hello sir please send you html code.
Can you please tell us code in comment box
I don't understand the language😶
BG?
Мда
all of you cant open because you must have notepad ++ or php or css
Thank you +sour cherry, I don't know where to keep the com.txt file?
In the same folder where you keep index.php
why my coding doesnt work? argh so stress !
+PkahD Luffy do you have a local web server
please give me a link of your code s
This is an updated version:
ruclips.net/video/0KwnPS5OhGI/видео.html
The code is in the comments
how to add it into html file?
If you watch the video you'll get it. But I strongly recommend learning at least the basics of PHP and HTML before trying to do something more complex.
the reason why this program is not running:
nah !! we need xampp for us to run this code :( php needs xampp .. duh !! i forgot ;( (facepalm)
why the hell you named this vid in english and then you make everything in russian?!
It's not Russian, it's Bulgarian actually xD
Rep for this +1
kiki do you love me? Are you riding? :D
Toooooo old lol
better to use facebook comment box...
Hey man, if you want to do a video, please talk.
First, I'm not a man;
Second, I think if English is not one's native language, it's better to make videos with captions instead of talking with an accent
Absolutely not true. Hearing an accent is way better than reading. For reading, one can go to html pages. So, please jump over the hurdle of fear, and start talking. The accent is your true self, it can even be sexy or cute. Take my advice and speak. Remember, this is a video of sight and sound. I think you even have a pretty face, if you show your face as you explain, you will get even better ratings and better views. Let me know of your next video with speaking, please and I will be happy to watch. Lastly, I do apologize for thinking such a lovely face is a man. Do accept my apology.
hi
wtf
??
Thanks a lot!
HI
it's ok