我现在都处于安全恐慌状态,所以我要尽可能地保证一切安全.我登录了,我引用了这个:
http://www.addedbytes.com/writing-secure-php/writing-secure-php-1/
第一个例子是登录的例子,如果你说?authorization=1你进去了.但是如果我把我的代码包裹起来if($_POST)那么用户必须发帖子.用户可以伪造一个$_POST吗?我怎么去假装$_POST?
我有一个jQuery模式对话框,其中包含一个显示一些内容的iFrame.当用户在iFrame中选择一个选项时,我会进行一次Ajax调用,然后我想关闭我的对话框,但它并没有为我关闭.
在我的父表单上,我有一个div标签:
div id="structureDialog" title="Add Structure"
Run Code Online (Sandbox Code Playgroud)
当用户单击父级上的元素时,我会打开对话框:
// bind an onclick event onto tiles to display the modal dialogue window
$(".stationTile").bind('click', function () {
var src = "<iframe src="myurl" />";
var locationID = 1;
$("#structureDialog").attr("locationID", locationID);
$("#structureDialog").html(src); //iframe
$("#structureDialog").dialog({
modal: true,
});
});
Run Code Online (Sandbox Code Playgroud)
在我的iFrame中,我有以下内容:
$(".userOption").bind('click', function () {
$.ajax({
async: false,
type: "POST",
url: "/NewStructure.aspx/Build",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: buildSuccess
});
});
function buildSuccess(res, dest) {
$("body", window.parent.document).attr("style", "background-color:yellow;");
$("#structureDialog", window.parent.document).attr("style", "background-color:red;");
$("#structureDialog", window.parent.document).dialog('close');
}
Run Code Online (Sandbox Code Playgroud)
在我的函数buildSuccess中,我能够成功将对话框更改为红色.但是,关闭功能不会关闭我的对话框.从我到目前为止看到的大多数例子来看,这段代码应该可以正常工作,所以我很难过.
我正在使用Swift Mailer检查退回邮件.我为退回邮件创建了一个单独的帐户,但是当我设置返回路径时,它不允许将退回邮件发送到该帐户.这是正常还是代码错误?
$verp = 'bounces-' . str_replace('@', '=', $row['ReplyTo']) . '@gmail.com';
$message = Swift_Message::newInstance()
->setSubject($row['Subject'])
->setFrom(array($row['ReplyTo'] => $row['FromName']))
->setReturnPath($verp)
->setBody($html, 'text/html')
->addPart($txt, 'text/plain');
Run Code Online (Sandbox Code Playgroud)
我现在正在使用VERP,它似乎是找到一个传递错误?但是不是要将邮件发送到退回邮件帐户?
我想选择多个按钮并按顺序点击第一个按钮.像COALESCE功能一样的东西.
我试过这个:
$(".selector1, .selector2, .selector3").first().click();
Run Code Online (Sandbox Code Playgroud)
这可以工作,但选择遵循DOM顺序而不是我的选择器查询顺序.有什么建议吗?
假设我在生产服务器上有一个nodejs/express应用程序.如果我想添加一个新的路由器,我必须重启一个,对吗?但是,如果我重新启动我的node.js服务器,那么用户可能会收到错误.
那么我应该如何为我的用户重启我的node.js服务器而不出错?
我想将我服务器上的Facebook应用程序选项卡的所有流量直接重定向到我的Facebook应用程序.因此,如果用户位于Facebook iframe内或我的网页上,请使用以下代码进行检查:
<!-- language: lang-js -->
function referrerIsFacebookApp() {
if(document.referrer) {
return document.referrer.indexOf("facebook.com") !== -1;
}
return false;
}
if (!referrerIsFacebookApp()) {
top.location.replace("https://www.facebook.com/bommelME/app_264697733636385");
};
Run Code Online (Sandbox Code Playgroud)
如果我用浏览器打开页面,一切正常.但是,如果我链接到此页面并打开链接,重定向将无法正常工作.任何提示?
我是JQuery的超级优秀者,但我真的很喜欢玩它.我正在制作一个页面,它开始变得缓慢/毛躁,我不知道如何使用回调,我认为它会有很大帮助.
我正在使用的代码如下所示:
$(".navHome").click(function(){
var div=$(".navHome");
div.animate({left:'190px'},"fast");
var div=$(".content");
div.animate({width:'700px'},"slow");
div.animate({height:'250px'},"slow");
$(".content").load("home.html");
var div=$(".xIcon");
div.animate({width:'20px'},"slow");
div.animate({height:'20px'},"slow");
});
Run Code Online (Sandbox Code Playgroud)
所以我点击div"navHome",它移动,"content"div扩展/加载.但它开始看起来波涛汹涌.我认为回调是我需要的,但我不确定.
只是想知道是否有任何方法可以检查选择框下拉列表的值是否与页面加载时的原始值匹配(当使用设置值时selected = "yes")?
我想我可以使用PHP将原始值创建为JavaScript变量并检查它们,但是有一些选择框,我试图让代码尽可能简洁!
我正在使用Apache mod_rewrite将JPG文件的请求路由到我的Web根目录之外的目录.
它通常很好,但有一些图像不显示.然后我意识到当我get_headers()在我的图像URL上使用PHP的函数时,它们都返回
Content-Type: text/html; charset=UTF-8而不是正确的image/jpeg头类型.
我已经尝试明确设置Content-Type: image/jpeg标题,但仍然没有我的图像返回正确的标题 - 虽然大多数确实正确显示,但我不知道为什么.
如何确保在重定向时通过正确的标头发送JPG文件mod_rewrite?