Php 如何确保ajax调用提取经过身份验证的内容
我在我的页面中对数据库进行Ajax调用,并提取包含图像的产品 下面是我正在进行的ajax调用:Php 如何确保ajax调用提取经过身份验证的内容,php,authentication,jquery,security,Php,Authentication,Jquery,Security,我在我的页面中对数据库进行Ajax调用,并提取包含图像的产品 下面是我正在进行的ajax调用: $.ajax({ type : "GET", url : "**https**://www.mydomain.org/getRow.php", dataType: 'html', success: function (msg) { $(".drag-desired").html(msg); $.event.trigger('ini
$.ajax({
type : "GET",
url : "**https**://www.mydomain.org/getRow.php",
dataType: 'html',
success: function (msg) {
$(".drag-desired").html(msg);
$.event.trigger('init-draggable-products');
},
error: function (xhr) {
$('#errorDisplay').html('Error: '+ xhr.status + '' + xhr.statusText);
}
});
我的问题是IE,它会提示访问者是否想查看未经验证的内容。如果该用户单击“否”或“是”,他们会希望浏览器阻止该内容,我不会让产品显示
这是我的php文件,它正在抓取这些产品:
<?php
define('INCLUDE_CHECK',1);
require "connect.php";
?>
<?php
$result = mysql_query("SELECT * FROM internet_shop WHERE price = 5");
while($row=mysql_fetch_assoc($result))
{
echo '<div class="product"><img src="https://www.mydomain.org/img/products/'.$row['img'].'" alt="'.htmlspecialchars($row['name']).'" width="128" height="128" class="pngfix" /></div>';
}
?>
如果php脚本与当前网站位于同一个域中,请尝试使用“/getRow.php”而不是“”作为url,这可能会解决此问题。您看到此错误,因为您仅通过HTTPS加载了部分内容,而如果通过HTTP(无SSL)加载了其余内容。有些浏览器就是不喜欢它
在链接上使用实时HTTP头。我可以看到您正在通过HTTP加载Jquery和Jquery UI。(例如
)
将这些链接更改为HTTPS,您就没事了。您知道我以前就是这样做的,它仍然在给我提示。我认为这与抓取产品的行为有关。你可以在这里查看测试页面:这是一个大错误!!谢谢我想再多看一眼会有帮助的。