由于某些原因,当帖子包含非常长的文本(即超过200个字左右)时,长篇帖子未插入到数据库中。但是,这个问题非常含糊,因为这些长文本中的一些被插入到数据库中(例如插入大量文本文件而没有任何问题)。首先,我认为它与标点符号有关,但这不是问题。此外,文本中断等不是问题的原因。此外,我在数据库中检查了注释部分的数据结构(它被分配了如下所示的textarea),并且在那里我看到它已经被赋予了长文本作为一种类型。所以字符限制也不是问题。因此,奇怪的是,它只发生在“一些”长文本中。大约200字的短文本没有问题,并且完美插入。jQuery ajax post并不总是与长文本一起工作
我的代码如下。首先,HTML部分:
<div class="new-com-bt">
<span>Schrijf hier uw bericht ....</span>
</div>
<div class="new-com-cnt">
<input type="text" id="name-com" name="name-com" value="" placeholder="Uw naam" />
<input type="text" id="mail-com" name="mail-com" value="" placeholder="Uw e-mail adres" />
<input type="text" id="code-com" name="code-com" value="" placeholder="Viercijferige code..." />
<textarea class="the-new-com"></textarea>
<span class="rating2">Beoordeel ons:
<input type="radio" class="rating-input"
id="rating-input-2-1" name="example" value="5">
<label for="rating-input-2-1" class="rating-star"></label>
<input type="radio" class="rating-input"
id="rating-input-2-2" name="example" value="4">
<label for="rating-input-2-2" class="rating-star"></label>
<input type="radio" class="rating-input"
id="rating-input-2-3" name="example" value="3">
<label for="rating-input-2-3" class="rating-star"></label>
<input type="radio" class="rating-input"
id="rating-input-2-4" name="example" value="2">
<label for="rating-input-2-4" class="rating-star"></label>
<input type="radio" class="rating-input"
id="rating-input-2-5" name="example" value="1">
<label for="rating-input-2-5" class="rating-star"></label>
</span>
<div class="bt-add-com">Plaats bericht</div>
<div class="bt-cancel-com">Annuleer</div>
</div>
现在JQuery的部分:
<script type="text/javascript">
$(function(){
//alert(event.timeStamp);
$('.new-com-bt').click(function(event){
$(this).hide();
$('.new-com-cnt').show();
$('#name-com').focus();
});
/* when start writing the comment activate the "add" button */
$('.the-new-com').bind('input propertychange', function() {
$(".bt-add-com").css({opacity:0.6});
var checklength = $(this).val().length;
if(checklength){ $(".bt-add-com").css({opacity:1}); }
});
/* on clic on the cancel button */
$('.bt-cancel-com').click(function(){
$('.the-new-com').val('');
$('.new-com-cnt').fadeOut('fast', function(){
$('.new-com-bt').fadeIn('fast');
});
});
// on post comment click
$('.bt-add-com').click(function(){
var theCom = $('.the-new-com');
var theName = $('#name-com');
var theMail = $('#mail-com');
var theCode = $('#code-com');
var theRating = $('input[name=example]:checked');
if(!theCom.val()){
alert('U moet een bericht schrijven');
}else if(theCode.val() != '7624'){
alert('Vul de viercijferige code in die u heeft gekregen tijdens de ceremonie')
}else{
$.ajax({
type: "POST",
url: "ajax/add-comment.php",
data: 'act=add-com&id_post='+<?php echo $id_post; ?>+'&name='+theName.val()+'&email='+theMail.val()+'&comment='+theCom.val()+'&rating='+theRating.val(),
success: function(html){
theCom.val('');
theMail.val('');
theName.val('');
theRating.val('');
setTimeout(function(){
//fade back
$('.new-com-cnt').html("Dank u wel voor uw bericht. Deze zal zo spoedig mogelijk op de site verschijnen!");
}, 0);
}
});
}
});
});
这是附加comment.php脚本:
<?php
extract($_POST);
if($_POST['act'] == 'add-com'):
$name = htmlentities($name);
$email = htmlentities($email);
$comment = htmlentities($comment);
$rating = htmlentities($rating);
include('../config.php');
// Get gravatar Image
// https://fr.gravatar.com/site/implement/images/php/
$default = "mm";
$size = 35;
$grav_url = "http://www.gravatar.com/avatar/" . md5(strtolower(trim($email))) . "?d=" . $default . "&s=" . $size;
if(strlen($name) <= '1'){ $name = 'Guest';}
//insert the comment in the database
mysql_query("INSERT INTO comments (name, email, comment, id_post, rating, display)VALUES('$name', '$email', '$comment', '$id_post', '$rating', 'nee')");
if(!mysql_errno()){
?>
<div class="cmt-cnt">
<img src="<?php echo $grav_url; ?>" alt="" />
<div class="thecom">
<h5><?php echo $name; ?></h5><span data-utime="1371248446" class="com-dt"><?php echo date('d-m-Y H:i'); ?></span><span class="com-dt-rating"><span class="rating">
<input type="radio" class="rating-input"
id="rating-input-1-1" value="5" disabled="disabled" <?php echo ($rating=='5')?'checked':'' ?> />
<label for="rating-input-1-1" class="rating-star"></label>
<input type="radio" class="rating-input"
id="rating-input-1-2" value="4" disabled="disabled" <?php echo ($rating=='4')?'checked':'' ?> />
<label for="rating-input-1-2" class="rating-star"></label>
<input type="radio" class="rating-input"
id="rating-input-1-3" value="3" disabled="disabled" <?php echo ($rating=='3')?'checked':'' ?> />
<label for="rating-input-1-3" class="rating-star"></label>
<input type="radio" class="rating-input"
id="rating-input-1-4" value="2" disabled="disabled" <?php echo ($rating=='2')?'checked':'' ?> />
<label for="rating-input-1-4" class="rating-star"></label>
<input type="radio" class="rating-input"
id="rating-input-1-5" value="1" disabled="disabled" <?php echo ($rating=='1')?'checked':'' ?> />
<label for="rating-input-1-5" class="rating-star"></label>
</span></span>
<br/>
<p>
<?php echo $comment; ?>
</p>
</div>
</div><!-- end "cmt-cnt" -->
<?php } ?>
的例子插入的长文本:
他在论文中描述的技术来建模和形式化需求被称为FLAGS。除了明确的目标之外,FLAGS 提供了建模和形式化模糊目标的可能性。与这些模糊目标有所不同的是,它们不能被具体实现,而明确的目标可以。相反,这些目标的可实现性是模糊的,因此它们不能被满足或不能满足,但它们可以在一定程度上得到满足。作为目标,在驾驶汽车时节省燃油。目前尚不清楚 这个目标是否具体实现。帽子是,油耗只能很小,但这并不是 状态是否达到了明确的目标。相反,它只在一定程度上满足,即当汽车仅使用少量燃料时。他可以通过对这些目标进行建模来评估人员实现的运动的速度和正确性,从而可以将同样的思维方式应用于物理治疗,只有在标准化目标模型元素 时才能正确完成。
需要遵循几个步骤才能应用FLAGS。这些步骤可以在附录A的 表1中找到,并且将在本章中通过描述应用 被描述为学习机器人如何像人一样移动的示例来进一步阐述。作为例子涉及机器人 申请,并因此描述了另一种情况,来自Pasquale等人的FLAGS元模型(2013) 扩展到本章中描述的例子。他的扩展FLAGS元模型可以参考附录A中包含的图2中的 。此外,例如,假定 要求已经确定。
他旗帜元模型由几个类组成,这些类描述了抽象级别的FLAGS目标 模型的组成。它解释了可以模拟清晰的目标(明确的目标)或模糊的目标(在特定范围内可达到 )。此外,目标可以相互影响(受关系影响) 并且可以被分解为子目标(由关系分解)。实现这些目标是 对人员和机器人都很重要。此外,域假设(条件)和 操作在FLAGS元模型进行采纳,一个人使用控制器来监视他或她的 运动使机器人可以对这些运动
的一个例子回应不插入文本:
Mijn iboga ervaring BIJ iboga农场 泽尔mooie连接rustige locatie连接EEN heerlijke sfeer,verzorgd GOED。 Geen haastihehe maar alles in een relaxte flow。 Ik wist niet wat ik moest verwachten maar de jongens stellen je goed gerust,goede uitleg en er word goed rekening gehouden met je jezondheid toestand en eet gewoontes。 Alles is aanwezig wat men nodig heeft。 Eten,drinken,douche gelegenheid,slaap plek等 Mooie ceremonie voorafgaand。 Erst krijg je een test test dom om vast te kunnen stellen of men allergisch is voor de substantie。 Iets wat veel andere niet doen。 Als het eenmaal werkt word de sessie begonnen terwijl je boven op een comfortabel bed ligt, Met een spiritueel muziekje op de achtergrond。 Toen het eenmaal goed werkte ervaarde ik een soort van ijl achtige droomstaat trip waarbij er visioenen tevoorschijn komen。 Ik persoonlijk heb vorige levens en voorouders gezien en gevoeld。 Ondertussen word er zeer goed op je je ge en en je word uitstekend verzorgd,je zal niks tekort komen gedurende de iboga reis。 Als men het toilet nodig heeft wel even even om assassie vragen want het lopen gaat wat moeilijk。 Tijdens de reis zal het voor ieder andere anders zijn want het zijn allemaal persoonlijke kwesties die verwerkt worden。 Ondertussen德sessie梅尔克济人DAT呃veel dwars liggende emotie的连接gewoontes verdwijnen UIT JE systeem,EN
单引号将打破这一点,你巧合是开放的SQL注入。 – chris85