我在CSS上有这个类:
.mgmtError{
width:716px;
float:left;
background-color:#FF0000;
padding:10px;
text-align:center;
}
Run Code Online (Sandbox Code Playgroud)
而且我想为填充区域中的背景着色.我尝试使用保证金,但似乎它有一些IE的麻烦.
还有其他方案吗?
我想知道HTTP上的POST方法是否将数据作为QueryString发送,或者它是否使用特殊结构将数据传递给服务器.
实际上,当我分析从客户端到服务器的POST方法的通信(例如,使用Fiddler)时,我看不到任何QueryString,而是看到具有名称/值对的Form Body上下文.
我有数组$ var,如果数组中的一个或多个元素为空(我的意思是,字符串是""),我想返回FALSE.
我认为这array_filter()是更好的方法,但我不知道如何以这种方式过滤它.
我该怎么做?
我认为检查问题的最佳方法是访问它:
打开页面,它应该加载底部Alptraum - La Vie Fascinante D'Une Jeune Vierge Effarouchee Marnaise - 未知日期归功于这个jQuery脚本:
$.ajax ({
url: "list/browse_ajax.php",
type: "POST",
success: function(data) {
$('#browseList').html(data);
},
error: function(data) {
$('#browseList').html("Error");
}
});
Run Code Online (Sandbox Code Playgroud)
在服务器上,它回复:
<script type="text/javascript">
$(document).ready(function() {
$('.lists').mouseover(function() {
$(this).css("background-color", "#CCCCCC");
});
$('.lists').mouseout(function() {
$(this).css("background-color", "#FFFFFF");
});
});
</script>
<div class="lists">
<a class="lblackb" href="index.php?explore=view&trackid=888"><?=htmlentities("Alptraum - La Vie Fascinante D'Une Jeune Vierge Effarouchee Marnaise - Unknown Date", ENT_QUOTES, "UTF-8")?></a>
</div>
Run Code Online (Sandbox Code Playgroud)
用这个列出类:
.lists{width:710px; float:left; border-bottom:1px #000000 solid;}
Run Code Online (Sandbox Code Playgroud)
这是 …
我在一个用PHP编写的网站上为自己的个人论坛编写了一个引用函数.
引用标签的消息看起来像[quote=username]message[/quote],所以我写了这个函数:
$str=preg_replace('#\[quote=(.*?)\](.*?)\[/quote\]#is', '<div class="messageQuoted"><i><a href="index.php?explore=userview&userv=$1">$1</a> wrote :</i>$2</div>', $str);
Run Code Online (Sandbox Code Playgroud)
如果引用是一个,但是当用户引用引用时,这个不起作用,这不起作用.所以我需要一种递归引用来应用这种行为.
我试图搜索很多主题,但我真的不明白它是如何工作的.将不胜感激任何有关此类操作的建议/提示!让我知道,谢谢!
编辑
最后,这是我自己的解决方案:
if(preg_match_all('#\[quote=(.*?)\](.*?)#is', $str, $matches)==preg_match_all('#\[/quote\]#is', $str, $matches)) {
array_push($format_search, '#\[quote=(.*?)\](.*?)#is');
array_push($format_search, '#\[/quote\]#is');
array_push($format_replace, '<div class="messageQuoted"><a class="lblackb" href="index.php?explore=userview&userv=$1">$1</a> wrote :<br />$2');
array_push($format_replace, '</div>');
}
$str=preg_replace($format_search, $format_replace, $str);
Run Code Online (Sandbox Code Playgroud)
只有在出现次数正确的情况下才能补充.所以它应该(对吧?)来防止html破坏或其他恶意攻击.你怎么看?
我想知道在html textarea上打印之前是否真的有必要用htmlentities($ str,ENT_QUOTES,"UTF-8")来逃避我的字符串.
或者自动这个人为我逃脱了角色?
可能重复:
\ r和\n之间有什么区别?
我真的想知道什么是之间的区别\n,\r,\t,chr(13),它们是如何在Web应用程序中使用,其中操作系统,等等.
例如,你可以确认windows \n\r用于换行,而linux使用\n恰到好处吗?了解这些事情会很有趣.
谢谢
我有我的变量$_GET['artist'],我想检查一下:
one一封信,这封信是从a到z(区分大小写,因此A是无效的);all或other如何在PHP 上regex和preg_match()PHP上检查它?
我必须使用正则表达式检查变量(php,preg_match)是否来自1988年和2011年; 我知道如何使用普通的if/else来做,但我想使用正则表达式!
我有一个行列表,我想在分组(一种COUNT)时对行数进行求和,但仅在每行时,字段customField = 0.
示例:
title customField
aaa 1
aaa 0
bbb 0
ccc 1
bbb 1
aaa 0
Run Code Online (Sandbox Code Playgroud)
所以,输出应该是:
aaa 2
bbb 1
ccc 0
Run Code Online (Sandbox Code Playgroud)
我怎么能用MySql做到这一点?
编辑
实际上我真正的查询是这样的:
SELECT forum_categories.title, COUNT(forum_topics.id) AS total_topics, COUNT(forum_messages.id) AS total_replies, MAX(forum_messages.date) AS last_message
FROM forum_categories
JOIN forum_topics ON forum_topics.category_id = forum_categories.id
JOIN forum_messages ON forum_messages.topic_id = forum_topics.id
GROUP BY forum_categories.id ORDER BY forum_categories.date
Run Code Online (Sandbox Code Playgroud)
而且我必须COUNT(forum_messages.id) AS total_replies只计算forum_messages.original=0,这就是为什么我要求SUM :)