This topic is locked

search page redirect

2/8/2008 9:35:25 PM
PHPRunner General questions
J
jamesberry12 author

I would like the search page to redirect to an add page if there are no records found

Im assuming that I can edit the search page code here

// Pagination:

if(!$numrows)

{

$smarty->assign("rowsfound",false);

$message="No records found";

$smarty->assign("message",$message);

}
with something that redirects.
Anyone know how to do this?

J
Jane 2/11/2008

Hi,
use List page: Before display event on the Events tab for this purpose.

Here is a sample:

$var = $smarty->get_template_vars("rowsfound");

if (!$var)

{

header("Location: TableName_add.php");

exit();

}

H
HMIS 2/14/2008

Hi,

use List page: Before display event on the Events tab for this purpose.

Here is a sample:


Perfect!!!! Thanks Jane