Código PHP:
//----------------------------------
// Add The Comment ... Go Go GO!
//----------------------------------
$old_comments = file("$comm_file");
$new_comments = fopen("$comm_file", "w");
@flock ($new_comments,2);
$found = FALSE;
foreach($old_comments as $old_comments_line)
{
$old_comments_arr = explode("|>|", $old_comments_line);
if($old_comments_arr[0] == $id)
{
$old_comments_arr[1] = trim($old_comments_arr[1]);
fwrite($new_comments, "$old_comments_arr[0]|>|$old_comments_arr[1]$time|$name|$mail|$ip|$comments||\n");
$found = TRUE;
}else{
fwrite($new_comments, $old_comments_line);
//if we do not have the news ID in the comments.txt we are not doing anything (see comment below) (must make sure the news ID is valid)
}
}
if(!$found){
/* // do not add comment if News ID is not found \\ fwrite($new_comments, "$id|>|$time|$name|$mail|$ip|$comments||\n");*/
echo("<div style=\"text-align: center;\">CuteNews did not added your comment because there is some problem with the comments database.<br /><a href=\"javascript:history.go(-1)\">go back</a></div>");
$CN_HALT = TRUE;
break 1;
}
@flock ($new_comments,3);
fclose($new_comments);
donde sera exactamente??
no lo leas es demaciado, lo podre en distintos lugares aver donde funciona gracias por tu ayuda :D