My Post and Session's php script for wordpress not work online but only in local -


i'm working on wordpress plugin page allows user perform search on custom posts. search form based on script ajax , when click on search button, script jquery intercepts call , creates ajax call wordpress. call launches method within class of wordpress plugin in question, handles data passed through $ _post search form. shown results , clicking on 1 of these sended single page. script i'm trying should allow user return single page search results using button of browser. problem script working fine in local on pc, once loaded online plugin stops working. (sorry long introduction served define problem well).

the script works follows:

  1. fill search form , click on search button
  2. $_post filled form data , fill $_session $_session = $_post
  3. open result , go single page hit in browser
  4. force refresh of page setting controls $_post = $_session (the ride more complicated principle on based).

    ajaxresult php function function called on search button click

    // check if user came single page or search page if(!$_post && $_session['back_to_hardsoft_results']) {     if( $_session['back_to_page'] ) {         $_post = $_session['back_to_hardsoft_results'];         $_session['back_to_page'] = null;     } } else if( $_post && $_session['back_to_hardsoft_results']) {     $_session['back_to_hardsoft_results'] = null; }  ...some controls $_post data...  $search = $this->getqueryobject($this->type, $this->taxonomies, $this->historicalfilter());  include_once template_path . custom_post_slug . '-' . results_page . '-page.php';  } else if ( ...$_get...) { ...other things... } 

when user visit single page, $_session['back_to_page'] created.

getqueryobject php function called ajaxresult

$args = array ( ...some args... );           $q = new wp_query ( $args);  // save query results single_mediateca_page $_session['back_to_hardsoft_results'] = $_post;  return $q; } 

i've put on js file follow string force refresh of page.

history.navigationmode = 'fast'; 

i think problem may relate browser's cache, don't know if due problem. lot help!

you might want use plug in adaption codeigniter session here take @ https://wordpress.stackexchange.com/a/72744

also shouldn't use $_post['results'] put $_session['back_to_hardsoft_results'] in specific index.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -