close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How can I display the search words on the search results page

Thread began 7/18/2010 2:18 am by lightwalkercreations361768 | Last modified 11/12/2010 1:28 pm by Dave Buchholz | 1884 views | 13 replies |

lightwalkercreations361768Beta Tester

How can I display the search words on the search results page

Dear WebAssist,

I am sorry for this question but I have not been able to find an answer on the forum. I am sure this is quite easy but have struggled to figure out a way to display the search terms on the results page. i.e if a customer searches for "chicken salad" on the results page I would like to display "chicken salad" to remind the customer what he just searched for.

Many thanks as always

Sign in to reply to this post

AlaskaTomBeta Tester

There might be other methods, but usually what I do is use the cookie toolkit, and use it to set a session variable to the posted search variable, and set the trigger to to the search button on your form pressed.

You can then drag the session variable from the bindings panel onto your search page.

Hope that helps.
Tom

Sign in to reply to this post

lightwalkercreations361768Beta Tester

Dear AlaskaTom,

Thank you for your reply, that is really helpful. My concern with using cookies it that I am using this for a support system, were a question the customers asks is searched in the FAQ's before allow that question as well as customer comments is send. So if anyone has cookies disabled the original question will not be pasted and left blank.

I am wondering if there may be another way that is can be done that is entirely server side?

Sign in to reply to this post

AlaskaTomBeta Tester

Actually, I recommended using session variables, not cookies, so no worries

Sign in to reply to this post

Jason ByrnesWebAssist

yes, using session variables is a better method.

On the results page, open the bindings panel. Click the plus button and select Form data. In the form data dialog, select the search page. This will add dynamic data bindings for the search form on the results page.

Now open the server behaviors panel, and select WA Cookies Toolkit -> Set Session Value.

Set the trigger to any form post, click the lightning bolt next to value and select one of the form elements from the search form. set the name to the same name as the form element.

Repeat that step for each form element.

yoou can then add the session bindings to the results page to display the search terms.

Sign in to reply to this post

lightwalkercreations361768Beta Tester

Thank you Jason and thank you AlaskaTom.

Your help worked beautifully for getting the form information into session variables, thank you, I am so grateful

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

Sign in to reply to this post

lightwalkercreations361768Beta Tester

Just to expand on this question. I have a few search form that all point to the same results page. What I would like to do is store the search query in my mysql DB so that I can see what people are searching for to help me provide relevant content.

If I use the above method I think I would have to create a form data for all the pages were the search form exists. and then put that search word into a session variable and then insert into the mysql row.

Is there a better method. I though maybe I could take the session variable ( WADbSearch1) created by data assist search. But I was not able to.

What would be the best way to be able to store the search terms in a DB if the search terms are coming from multiple pages that have the search form.

Thank you all as always for your help

Sign in to reply to this post

Jason ByrnesWebAssist

using the WADbSearch1 session would be the best way.

for this to work tough, you may need to move the insert record code on the page so that it is after the data assist search code.

Sign in to reply to this post

lightwalkercreations361768Beta Tester

Dear Jason,

Thank you for your help. I did place the DA Insert server behaviour below the search but when the form is submitted I get these errors.


Notice: Undefined variable: SResultDB in /Volumes/My Book/DataBases/Cura Romana Project DB/Cura Romana Project/Folders/Website (dreamweaver) Files/CuraRomana Large official/curaromana/FAQ/Search/index.php on line 122

Notice: Undefined variable: database_SResultDB in /Volumes/My Book/DataBases/Cura Romana Project DB/Cura Romana Project/Folders/Website (dreamweaver) Files/CuraRomana Large official/curaromana/FAQ/Search/index.php on line 134

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /Volumes/My Book/DataBases/Cura Romana Project DB/Cura Romana Project/Folders/Website (dreamweaver) Files/CuraRomana Large official/curaromana/FAQ/Search/index.php on line 135

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Volumes/My Book/DataBases/Cura Romana Project DB/Cura Romana Project/Folders/Website (dreamweaver) Files/CuraRomana Large official/curaromana/FAQ/Search/index.php on line 139

They looked to me like there was a problem with my DB connection which I have tested to make sure it is working correctly and it appears to be. I have included the results page. Any ideas?

Many thanks again

Attached Files
index.php.zip
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...