Posting Comments using php, no mysql
Posted 03 April 2006 - 03:43 AM
I have a picture on firstpage.html and there is a form below the picture (see below)
<br> <INPUT name="name" type="text" size="20">
<br> <TEXTAREA name="message" rows=3 cols=30 wrap=virtual></TEXTAREA>
<input type="submit" name="submit" value="Post">
A visitor would be able to input the name and comment, press "post" and his/her comment would be posted immediately below the picture and so on in reverse chrnological order. The form would move below the most recent comment.
Obviously I have the form made but I have no idea what .php file I must make to make this work. My other idea is a link to a separate page where the visitor would input the information and by submitting, it will refer back to firstpage.html and post the comment below the picture. Again, I am not sure how to script that.
I would appreciate any help. Thank you.
Posted 03 April 2006 - 07:49 AM
Create a database
Create a table with 3 fields
the fields are:
ID (int, autoincrement, unique)
Name (varchar, 80)
int, varchar and text are fieldtypes. you'll find them as a dropdownmenu in phpMyAdmin.
autoincrement is a dropdown item as well, and unique is found in a checkbox.
varchar 80 means there's a max of 80 characters to store in that field. Just put the 80 in the field next to the varchar.
Posted 03 April 2006 - 08:33 AM
A database is a hell of alot better.
If you want to learn how to use MySQL and PHP then follow through the tutorials [a href=\"http://www.php-mysql-tutorial.com/mysql-tutorial/index.php\" target=\"_blank\"]here[/a] - that is just using MYSQL in a DOS window just to get to grips with mYSQL. Then you'll want to go through tutorial numbers 4 - 7 [a href=\"http://www.php-mysql-tutorial.com/\" target=\"_blank\"]here[/a].
Also in order for you to do a comment system I would recommend you to learn how to create a basic guestbook as you can adapt a basic guestbook into a your comment system very easily becuause a questbook is a comment system. [a href=\"http://www.php-mysql-tutorial.com/mysql-php-guestbook.php\" target=\"_blank\"]Part 1[/a] and [a href=\"http://www.php-mysql-tutorial.com/mysql-php-guestbook-2.php\" target=\"_blank\"]Part 2[/a].
I know it sounds a lot but learning the basics of MySQL will only take a few hours max. Then a couple more hours to get the basics of PHP and MySQL. Once you've go those under your belt you should be able to be set to create your comment system. Again the guestbook tutorial will tak about 1 - 2 hours if you do that then you'll be able to create your comment system.
Posted 03 April 2006 - 04:58 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users