i have news publishing script.
every script has own id (www.example.com/index.php?id=12 (for ex)
who can help me Make comments script
i want that let it possible to add comments each news
when whatever news selected let it comes with its comments
Thanks for attention
Sadly, you won't actually get your work done for you. This is really simple though.
I'll give you some steps, this should help:
>> Create a table called 'Comments'
comments.php <?php // connect to the database $id = $_GET['id']; // get the news id, passed through the URL $q = "SELECT * FROM comments WHERE news_id='$id'; $r = mysql_query($q); ?>
<?php $id = $_GET['id']; $q = "INSERT INTO comments (VALUE, VALUE, VALUE) VALUES ('$value', '$value', '$value')"; $r = mysql_query($query); ?>
Hope this helps! There are other ways. Also, using the ID method is very insure, make sure you check it for numeric data.
this is my script comment php
i tested its post method with
<?php $no=$_GET["no"]; echo "<form name=\"\" action=\"part.php\" method=\"post\"> Имя:<input name=\"data\" type=\"text\" value=\"\"><br/> e-mail:<input name=\"data\" type=\"text\" value=\"\"> <br/> <textarea name=\"data\" rows=5 cols=20 wrap=\"off\"></textarea> <br/> <input type=\"submit\" name=\"add\" value=\"добавить\"> <br/> <input type=\"hidden\" name=\"az\" value=\".$no.\"> </form>"; ?>
but in response it returns me
Array ( [data] => Array (  => sdfsdf  => sdfs  => sdffs ) [add] => пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ [az] => \\\'116\' )
but i only need
thanks again for attention