想知道这是一个HTML,PHP或JavaScript问题 [英] want to know whether this is a html, php or javascript issue

查看:63
本文介绍了想知道这是一个HTML,PHP或JavaScript问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想标识每条评论,以便任何成员对评论发表评论时,INSERT和SELECT知道评论的显示位置,评论内容以及评论内容。这就像为每个评论创建一个ID,以便SELECT在每个消息的位置显示每条消息。 BU我不知道这是一个HTML,PHP或JavaScript问题来处理。 jsfiddle的此处



php

p>

我会在url字符串中选择id

  $ id = $ _GET [ 'ID']; //这个用户的id在用户表中被评论我想我需要这个id来标识哪个用户被评论为profile,这是他的个人档案的id 
if(isset($ _ SESSION ['id' ])){
$ userid = $ _SESSION ['id'];
$ username = $ _SESSION ['name']; }
else {

//做这个

}
//用户标识包含用户注释的用户标识和名称用户登录。

if($ _POST ['comment_field_1']!=){



$ comment_field_1 = $ _POST ['comment_field_1'];
$ comment_field_1 = stripslashes($ comment_field_1);
$ comment_field_1 = strip_tags($ comment_field_1);
$ comment_field_1 = mysql_real_escape_string($ comment_field_1);
$ comment_field_1 = eregi_replace(',',$ comment_field_1);

$ sql = mysql_query(INSERT INTO comments(mem_id,commented_men_id,the_message,parent_id,message_date)
VALUES('$ userid','$ idc','$ comment_field_1',$ parent_id now()))
或die(mysql_error());

//我估计$ parent_id应该初始化为0或1的值,这取决于天气是回应还是评论。
}

// men_id是$ userid的字段,commented_men_id是注释字段,$ idc变量等...

if( $ _POST ['comment_field_2']!=){//响应表单域



$ comment_field_2 = $ _POST ['comment_field_2'];
$ comment_field_2 = stripslashes($ comment_field_2);
$ comment_field_2 = strip_tags($ comment_field_2);
$ comment_field_2 = mysql_real_escape_string($ comment_field_2);
$ comment_field_2 = eregi_replace(',',$ comment_field_2);

$ sql = mysql_query(INSERT INTO comments(mem_id,commented_men_id,the_message,sub_commented_id,message_date)
VALUES('$ userid','$ idc','$ comment_field_1',$ sub_commented_id now()))
或die(mysql_error());

//这里,而不是$ parent_id我使用为响应标记评论而创建的字段,因为响应应该在顶部的某处以0或1的值进行初始化,具体取决于天气是响应还是评论。我不知道天气我应该离开parent_id变量或与这个新字段$ sub_commented_id。你怎么看?
}

// men_id是$ userid的字段,commented_men_id是注释字段,$ idc变量等...

$ b ($ _SESSION ['id'] == $ userid){
$ the_message_form ='


comment(220 char max)