RE: Working with sessions

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

 



[snip]
Wouldn't that be what this code does:

<?PHP
	if ($_SESSION['search'] != NULL){
	echo "The search string is: <strong>$search</strong>.<BR>";
	$qrow[]= mysql_query($qstring) or die(mysql_error());
	$qresult = $qrow[0];
	$num_rows = mysql_num_rows($qresult);
	//display search form
		echo "
			<form action='search.php' method='GET'>
			<label>Search:
			<input type='text' name='search' id='search' />
			</label>
			<input type='submit' value='Go!' />
		</form>";
$_SESSION['search'] = $_GET['search'];


?>
[/snip]

Looks like it should if the form is referring to PHP_SELF (search.php).
Do you have a seesion_start() at the top of the page? 

-- 
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