The data is not sent to the database, the fields are not highlighted. Bd everything is fine, if you add a review directly through it, then everything is displayed
$ ('# button-send-review'). click (function () {
var name = $("#name_review").val(); var good = $("#good_review").val(); var bad = $("#bad_review").val(); var comment = $("#comment_review").val(); var iid = $("#button-send-review").attr("iid"); if (name != "") { name_review = '1'; $("#name_review").css("borderColor","#DBDBDB"); }else { name_review = '0'; $("#name_review").css("borderColor","#FDB6B6"); } if (good != "") { good_review = '1'; $("#good_review").css("borderColor","#DBDBDB"); }else { good_review = '0'; $("#good_review").css("borderColor","#FDB6B6"); } if (bad != "") { bad_review = '1'; $("#bad_review").css("borderColor","#DBDBDB"); }else { bad_review = '0'; $("#bad_review").css("borderColor","#FDB6B6"); } // Глобальная проверка и отправка отзыва if ( name_review == '1' && good_review == '1' && bad_review == '1') { $("#button-send-review").hide(); $("#reload-img").show(); $.ajax({ type: "POST", url: "/include/add_review.php", data: "id="+iid+"&name="+name+"&good="+good+"&bad="+bad+"&comment="+comment, dataType: "html", cache: false, success: function() { setTimeout("$.fancybox.close()", 1000); } }); } }); add_review.php:
<?php if($_SERVER["REQUEST_METHOD"] == "POST") { include("db_connect.php"); include("../functions.php"); $id = clear_string($_POST['id']); $name = iconv("UTF-8", "cp1251",clear_string($_POST['name'])); $good = iconv("UTF-8", "cp1251",clear_string($_POST['good'])); $bad = iconv("UTF-8", "cp1251",clear_string($_POST['bad'])); $comment = iconv("UTF-8", "cp1251",clear_string($_POST['comment'])); mysqli_query($link,"INSERT INTO table_reviews(product_id,name,good_reviews,bad_reviews,comment,date) VALUES( '".$id."', '".$name."', '".$good."', '".$bad."', '".$comment."', NOW() )"); echo 'yes'; } ?> response:
@font-face { font-family: 'whatshelp'; src:url('../fonts/whatshelp/whatshelp.eot?nusorz'); src:url('../fonts/whatshelp/whatshelp.eot?nusorz#iefix') format('embedded-opentype'), url('../fonts/whatshelp/whatshelp.ttf?nusorz') format('truetype'), url('../fonts/whatshelp/whatshelp.woff?nusorz') format('woff'), url('../fonts/whatshelp/whatshelp.svg?nusorz#whatshelp') format('svg'); font-weight: normal; font-style: normal; } [class^="wh-icon-"], [class*=" wh-icon-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'whatshelp' !important; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .wh-icon-facebook-messenger:before { content: "\e900"; } .wh-icon-whatshelp:before { content: "\e901"; } .wh-icon-whatsapp:before { content: "\e902"; } .wh-icon-telegram:before { content: "\e903"; }
errorsection ofajax, and not just thesuccess. - ArchDemon pm