1
我有什么对我来说似乎是一个奇怪的问题。问题与PHP饼干和jQuery
我有一个jQuery的手风琴菜单的网页,有的jQuery的行为,HICH是一个:
$(document).ready(function() {
$("#accordion").accordion({
collapsible: true,
active: true,
autoHeight: false,
/* Binding to the change event of the accordion. When all panes are collapsed, ui.newHeader will be an empty jQuery object */
changestart: function(event, ui) {
if (!ui.newHeader.length) {
$("#prods_vcts").css("background", "url(images/Fondo_ALT_Products.png)");
$('#sub2').hide('fast');
$('#sub4').hide('fast');
} else {
$("#prods_vcts").css("background", "url(images/taula_vcts_"
+ ui.newHeader.attr("id") + ".png) no-repeat");
$('#sub2').hide('fast');
var descrid = ui.newHeader.attr("id");
$.post('scripts/mostrar_descr_gral.php', {desc:descrid}, function(data) {
$('#sub4').show('fast');
$('#sub4').html(data);
});
}
}
});
$('.detail').live('click',function() {
var subcatid = this.id;
$.post('mostrar_prods.php', {subcat:subcatid}, function(data) {
$('#sub4').hide('fast');
$('#sub2').show('fast');
$('#sub2').html(data);
});
return false;
});
$('form').live('submit', function() {
var formid = this.id;
var prodidval = $('#prodid'+formid).val();
var prodpreuval = $('#prodpreu'+formid).val();
var prodquantval = $('#prodquant'+formid).val();
$.post('scripts/carret.php', {idval:prodidval, preuval:prodpreuval, quantval:prodquantval, id:formid}, function(data) {
$('#sub333').html(data);
});
return false;
});
});
的问题是:一切正常,直到我设置一个cookie。这个想法是,当用户点击'scripts/carret.php'时会设置一个cookie。当存在cookie时,手风琴完美地工作,但其他两个功能则没有。
我试图设置cookie的index.php文件的第一行,在脚本/ carret.php的第一线,用jQuery插件等;我试图改变脚本/ carret.php的文件夹,我已经试过了“/”,等我检查,我dont't了知道了。
顺便说一句,这是carret.php的内容:
<?php
$qidval = $_REQUEST['idval'];
$qpreuval = $_REQUEST['preuval'];
$qquantval = $_REQUEST['quantval'];
echo '<div id="sub33" style="margin-top:100px; margin-left:80px; position:relative; z-index:2">
<div style="position:absolute; margin-top:0px; text-align:left">
idval= '.$_REQUEST['idval'].'<br>
preuval= '.$qpreuval.'<br>
quantval= '.$qquantval.'<br>
id= '.$_REQUEST['id'].'
</div>
</div>';
就是这样。任何帮助或建议?我确信这是一个非常基本的东西,我错过了,成为一个新手!
谢谢!
[R
现在已经晚了这里,也许我监督的东西,但什么cookies在你的脚本吗?你在哪里设置它们?而cookies也是从后续请求开始的,所以如果你现在设置它,它会在下一个请求中可用。其他的事情,逃生,也有你的一些脚本XSS漏洞 –
可能是方便的,如果你能提供一个链接到它承载您的代码的页面? –
我觉得我失去了一些东西......你发送一个'$后.post的( '脚本/ carret.php''但拿起'GET'瓦尔'$ qidval = $ _REQUEST [' idval'];?' –