Solved

database results refresh problem

Posted on 1998-08-04
13
124 Views
Last Modified: 2013-12-25
I have a search form which returns records from a  database. If I refresh the results page the criteria for the search are lost and the page displays every record in the database. Any fixes on this one?
NM
0
Comment
Question by:englishman
  • 7
  • 2
  • 2
  • +2
13 Comments
 
LVL 1

Expert Comment

by:davejenkins
ID: 1858820
How is the page being built?  With a CGI script?  Are you POSTing or GETting the data?  Please give us some more info . . .
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1858821
Save the search criteria in hiden fields and when you refresh the page, pass those hidden fields back as parameters.

<INPUT TYPE=HIDDEN NAME=Param1 VALUE="search text1">
etc...

- Matt
0
 
LVL 2

Author Comment

by:englishman
ID: 1858822
Hi,
searchform includes:

<form method="POST" action="librarysearch.asp">
  <p><strong>Keywords:</strong> <input type="text" name="KeywordEntry" size="20"></p>
  <p><strong>And:</strong> <input type="text" name="KeywordEntry1" size="20"></p>
  <p><br>
  <input type="submit" value="Search" name="B1" style="color: rgb(0,128,128)"><input
  type="reset" value="Reset" name="B2"></p>


answer page includes:

 <!--webbot bot="DatabaseRegionStart" startspan s-columnnames="Authors,Date,Keywords"
  s-connstring="DSN=crtintlib" b-tableformat="TRUE"
  s-sql="SELECT Keywords, Authors, Date FROM library WHERE (library.Keywords like  '%%%KeywordEntry%%%' AND library.Keywords   like  '%%%KeywordEntry1%%%')"
  local_preview="&lt;tr&gt;&lt;td colspan=6 bgcolor=&quot;#FFFF00&quot; align=&quot;center&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; Database Regions do not preview unless this page is fetched from a Web server using a web browser.  The following table will display one row for each query result row when the page is fetched from a Web server.&lt;/td&gt;&lt;/tr&gt;"
  preview clientside s-DefaultFields s-NoRecordsFound="No Records Returned" i-MaxRecords
  i-ScriptTimeout tag="BODY" s-Password --><%
' Substitute in form parameters into the query string
fp_sQry = "SELECT Keywords, Authors, Date FROM library WHERE (library.Keywords like  '%%%KeywordEntry%%%' AND library.Keywords   like  '%%%KeywordEntry1%%%')"
fp_sDefault = ""
fp_sNoRecords = "No Records Returned"
fp_iMaxRecords = 0
fp_iTimeout = 0
fp_iCurrent = 1

0
 
LVL 2

Author Comment

by:englishman
ID: 1858823
Hi,
searchform includes:

<form method="POST" action="librarysearch.asp">
  <p><strong>Keywords:</strong> <input type="text" name="KeywordEntry" size="20"></p>
  <p><strong>And:</strong> <input type="text" name="KeywordEntry1" size="20"></p>
  <p><br>
  <input type="submit" value="Search" name="B1" style="color: rgb(0,128,128)"><input
  type="reset" value="Reset" name="B2"></p>


answer page includes:

 <!--webbot bot="DatabaseRegionStart" startspan s-columnnames="Authors,Date,Keywords"
  s-connstring="DSN=crtintlib" b-tableformat="TRUE"
  s-sql="SELECT Keywords, Authors, Date FROM library WHERE (library.Keywords like  '%%%KeywordEntry%%%' AND library.Keywords   like  '%%%KeywordEntry1%%%')"
  local_preview="&lt;tr&gt;&lt;td colspan=6 bgcolor=&quot;#FFFF00&quot; align=&quot;center&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; Database Regions do not preview unless this page is fetched from a Web server using a web browser.  The following table will display one row for each query result row when the page is fetched from a Web server.&lt;/td&gt;&lt;/tr&gt;"
  preview clientside s-DefaultFields s-NoRecordsFound="No Records Returned" i-MaxRecords
  i-ScriptTimeout tag="BODY" s-Password --><%
' Substitute in form parameters into the query string
fp_sQry = "SELECT Keywords, Authors, Date FROM library WHERE (library.Keywords like  '%%%KeywordEntry%%%' AND library.Keywords   like  '%%%KeywordEntry1%%%')"
fp_sDefault = ""
fp_sNoRecords = "No Records Returned"
fp_iMaxRecords = 0
fp_iTimeout = 0
fp_iCurrent = 1

0
 
LVL 2

Author Comment

by:englishman
ID: 1858824
Frontpage as you see, sorry about 2*post

0
 
LVL 37

Expert Comment

by:Bing CISM / CISSP
ID: 1858825
Does the URL line of your browser contain all the search conditions while you perform a searching?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Author Comment

by:englishman
ID: 1858826
no search conditions in the URL
0
 
LVL 2

Expert Comment

by:Wiz_of_Oz
ID: 1858827
what technology r u using to access the db?
0
 
LVL 2

Author Comment

by:englishman
ID: 1858828
asp frontpage sql
0
 
LVL 37

Expert Comment

by:Bing CISM / CISSP
ID: 1858829
Since no search conditions in the URL, so as you refresh the content, browser send same URL to server again, the server cannot do same searching with proper conditions you want, then the result cannot be given as you like.
0
 
LVL 10

Accepted Solution

by:
MasseyM earned 30 total points
ID: 1858830
Why did you reject my answer from before?

0
 
LVL 2

Author Comment

by:englishman
ID: 1858831
Sorry Matt, I thought I'd got locked into talk with someone who said I couldn't do it.
Your answer is what I'm looking for.
Unfortunately I am new to coding and need to be a little more spoon fed.
How do I do this? -
NM

0
 
LVL 2

Author Comment

by:englishman
ID: 1858832
Sorry Matt, I thought I'd got locked into talk with someone who said I couldn't do it.
      Your answer is what I'm looking for.
      Unfortunately I am new to coding and need to be a little more spoon fed.
      How do I do this? -
      NM
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now