Change value of PHP variable with AJAX

后端 未结 4 516
刺人心
刺人心 2021-01-24 09:11

The PHP:


The HTML:

4条回答
  •  无人及你
    2021-01-24 09:44

    Storing the View in the session, will keep the site displaying this view until the user closes the browser and ends the session, the session expires or they change the view again.

    The include that sets mainView

    
    

    // the ajax script that sets the mainView

    
    

    the javascript link for ajax

    ajaxURL='ajax.php?mainView=otherDasboard';
    

    you may also want to check for empty session variable and that the file exists before setting it

提交回复
热议问题