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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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