RE: Working with sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
I have a question about sessions, I am attempting to store a search  
term in a session variable to that when it finds the set of records  
from the database it can export it to excel. The problem I have is  
that the session variable is 1 search behind...
[/snip]

When you do the search store the search term immediately to the session
variable;

<?php
//pseudo-code
start_session();
$_SESSION['searchTerm'] = $_GET['searchTerm'];
?>
<html>
<a href="link to excel sheet">
</html>

Now in the code that generates the excel;

<?php
session_start();
$getStuffForExcel = "SELECT foo, bar FROM data where foo =
'".$_SESSION['searchTerm']."' ";
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux