close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Display keywords on Results Page

Thread began 6/07/2011 3:37 pm by doug425125 | Last modified 6/09/2011 7:00 am by Jason Byrnes | 3317 views | 9 replies |

doug425125

Display keywords on Results Page

Is it possible to show the keywords that were used in a search, on the results page? It would say something like this:

Your search using the keywords: apples, oranges, pears found these results:

.. then the results with the keywords in them.

If that is not possible, could the search box with the keywords in it, remain visible on the results page?

Thanks

Doug

Sign in to reply to this post

Jason ByrnesWebAssist

you would need to store the search terms into session variables, then echo the session variable values on the page.


send a link to your search page so I can see how the search is configured and i can give some more specific code examples.

Sign in to reply to this post

doug425125

Thanks for the response Jason. The search page is nested in a single frame.
Main page is mpengoprojectsup.html
The search page by itself is FAQ_Search.php

This is the public access page. I also have the admin pages with more access to pages and editing, but I could apply the solution to that search page as well.

Thanks for your help..
Doug

Sign in to reply to this post

Jason ByrnesWebAssist

there is only one for element, this is pretty easy.

add the following a line 1 of your results page:

php:
<?php
@session_start();
if(isset(
$_GET['knowledgebase'])) {
$_SESSION['knowledgebase'] = $_GET['knowledgebase'];
}
?>




then add this code after the body to display the search term:

php:
<?php echo(isset($_SESSION['knowledgebase'])?$_SESSION['knowledgebase']:""); ?>
Sign in to reply to this post

doug425125

Hi Jason.. Where on the results page do I actually paste this code (the 1st one) in the Code view window of Dreamweaver.. I tried line 1, but got syntax errors. Sorry, I don't have much coding experience.

Sign in to reply to this post

Jason ByrnesWebAssist

it goes at line 1, you got syntax errors because I had an error in the code.

this line:

php:
if(isset($_GET['knowledgebase']) {




should be:

php:
if(isset($_GET['knowledgebase'])) {
Sign in to reply to this post

doug425125

Thanks Jason.. that worked. Is there a way that I could get those keywords to show just after 'Search Results" at the top of the page? (with a .. "You used the following keywords in your search" just before that line) I appreciate your quick response.. Thanks again..
Doug

Sign in to reply to this post

Jason ByrnesWebAssist

yes, in design view, select where it says Search results, then go to code view, it will have the string "Search results highlighted, just after that string add:

php:
<?php echo(isset($_SESSION['knowledgebase'])?" You Just Searched for "$_SESSION['knowledgebase']."":""); ?>
Sign in to reply to this post

doug425125

Thanks Jason.. that worked perfectly. You have been a great help.. if your are ever in Toronto, drinks are on me!.. Thanks again,
Doug

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...