Jump to content

jquery tablesorter on same page as sessions


dodgeitorelse

Recommended Posts

Hi I have jquery table sorter for one of my pages. It works fine..... until I start using some variables that are in session. Why does this stop the sort function from working?

 

code for sorter that works ....

<head>
  <title><?php echo "$server_name"; ?> Top Ten Scores</title>

<style type="text/css">
A:link {text-decoration: none; color: lime;}
A:visited {text-decoration: none; color: blue;}
A:active {text-decoration: none; color: white;}
A:hover {text-decoration: underline; color: lightgreen;}
</style>
  
  <script src="js/jquery.js" type="text/javascript"></script>
  <script src="js/jquery.dataTables.min.js" type="text/javascript"></script>
  
  <link href="css/table.css" rel="stylesheet" type="text/css" media="print, projection, screen" />
  <script type="text/javascript">
    $(document).ready(function ()
    {
      $("#tablesorter").dataTable({
        "bPaginate": false,
        "bAutoWidth": true,
	"aaSorting": [[ 0, "Asc" ]],
        "aoColumns": 
          [
	  
            { "bSortable": true }, // disable sorting of first column in table
            	null,
                null				
          ]
      })
    });
  </script>
</head>

 

 

with sessions (this stops table from sorting feature)....

 

<?php

session_start();

// Retrieve the URL variables (using PHP).
	$name = $_GET['name'];
	$name2 = $_GET['name2'];
	$name3 = $_GET['name3'];


$_SESSION['name'] = $_GET['name'];
$_SESSION['name2'] = $_GET['name2'];		
$_SESSION['name3'] = $_GET['name3'];	


//rest of code that displays data and table

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.