I have a site and something on the site will not appear until I refresh the page.
I found this in my code session_start(); if I delete my PHP Session ID the thing on my page disappears again, it seems like this session needs to set on first page load…does anyone know how to do that?
By the way the thing that will no show up is a form, a GET form.
Thanks
Here is the code with the session
function wpsc_core_load_session() {
if ( !isset( $_SESSION ) )
$_SESSION = null;
if ( ( !is_array( $_SESSION ) ) xor ( !isset( $_SESSION['nzshpcrt_cart'] ) ) xor ( !$_SESSION ) )
session_start();
}
and he is what doesnt show up
<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>
I turned on my WordPress debugger and this is what came out
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
and this message appears when the form that is missing is there….
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
You have one fundamental problem:
You can’t access the session before it is started. Try starting it and then accessing it…
Also xor is a bitwise comparison…I’m not sure if that’s what your looking for here, maybe
||is.Normally first page load is denoted by the top of your script or whatever runs before outputting headers but since your new I’ll just say at the top. Try putting it there.
Most likely you are receiving an error and got
display_errorsoff as such you get a blank page I reckon.