我有一个网站,在我刷新页面之前,网站上的某些内容不会出现。
如果我删除我的 PHP 会话 ID,我在我的代码中发现了这个,session_start();
我页面上的东西又消失了,看起来这个会话需要在第一页加载时设置……有人知道该怎么做吗?
顺便说一句,不会出现的是一个表格,一个 GET 表格。
谢谢
这是会话的代码
function wpsc_core_load_session() {
if ( !isset( $_SESSION ) )
$_SESSION = null;
if ( ( !is_array( $_SESSION ) ) xor ( !isset( $_SESSION['nzshpcrt_cart'] ) ) xor ( !$_SESSION ) )
session_start();
}
他是什么没有出现
<form class="product_search" style="font-size:0px !important;" method="GET" action="<?php echo $pp_url?>/" >
<input name="product_search" id="wpsc_search_autocomplete" class="wpsc_product_search wpsc_live_search_embed .wpsc_live_search" autocomplete="off" style="padding:0px !important; height:25px !important; vertical-align:top;" />
<script type='text/javascript' > /* <![CDATA[ */
jQuery('#wpsc_search_autocomplete').keypress( function(e){
if ( e.keyCode == 13 ) {
var url = '<?php echo $pp_url ?>'+'?product_search='+jQuery(this).val();
url = encodeURI(url);
jQuery(window.location).attr('href', url);
}
});
/* ]]> */
</script>
<input type="submit" id="button" name="button" class="searchBtn" value="GO"/>
</form>
我打开了我的 Wordpress 调试器,结果就是这样
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/19/9468119/html/wp-content/plugins/jquery-colorbox/jquery-colorbox.php:34) in /home/content/19/9468119/html/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php on line 13
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/19/9468119/html/wp-content/plugins/jquery-colorbox/jquery-colorbox.php:34) in /home/content/19/9468119/html/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php on line 13
当缺少的表单存在时,会出现此消息....
Notice: A session had already been started - ignoring session_start() in /home/content/19/9468119/html/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php on line 18