I have a php file that runs a simple jquery script:
var text = $(".hide").text();
I was wondering how I could store this data when I redirect to other pages
You could put it into a cookie. Write it, leave the page, then read your own cookie when you get to the next page.
Or you could POST it to another PHP script, and store it in a session variable. In jQuery, it would look something like this
$.post("my_other_script.php", { text: "my piece of text"} );
my_other_script.php would be
<?php $_SESSION['text'] = $_POST['text']; ?>
Here is the jquery page documentation for it.
<?php session_start();$_SESSION['test']=$_POST['text'];?> to put the text into the session, then to fetch it out later, <?php session_start(); $text = $_SESSION['text']?>