Jump to content

I want the searched keyword to appear on the page


Chrisj

Recommended Posts

I'm using a php script that has the ability to search by keyword.

When I wanted the keyword to appear on a page called inner_results.htm

I was told: 

 

"you'd have to look at search.php. and see if there is a line like:

$_SESSION['keyword'] = $keywords; if there is something kinda like that then you're good.

You would just add the sessions.php include to the results.php page, (include_once ('classes/sessions.php');)

then add something like: $keywords = $_SESSION['keyword'];

then in the inner_results page, wherever you want the keywords to display, add something like: You searched: [var.keywords]"

 

So, I followed this advice and on search.php I found this: $_SESSION['searched'] = $_GET['keyword'];

 

And I see that on results.php it already has this: include_once ('classes/sessions.php');

 

And on the results.php page I added this: $keywords = $_SESSION['keyword'];

 

And on the inner_results.htm page I added this: You searched: [var.keywords]

 

But the inner_results.htm page only shows this: You searched:

 

Can someone suggest what I should try to make this work?

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.