473,383 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Search function

Hi all

I have a search function on a site of mine. At the moment, the content is
delivered using this:

<?php echo $row_Recordset1['content']; ?>

The search function goes through the table and displays the titles of the
pages that contain the term.

What I'd like to do is set it up so that when the visitor clicks on a title,
it sends the search term as well, looks for it in
$row_Recordset1['content']; and puts <strong> before and </strong> after.

Does that make sense?

Also, I've just noticed something not right. The CMS takes a text box and
writes the HTML into the table. So, if I do a search on </li> for example,
then it brings back results. I can't even begin to imagine a way round
this. In most cases this is unlikely to be a problem but I'd like to think
there might be a way round it.

Any help would be gratefully received.

Andy

Jul 17 '05 #1
3 1735
convert < and > to &lt; and &gt; using html_specialcharacters() - ive prob
got the function name wrong -. and then search using that.

- Ali

"Andy Jacobs" <an**@redcatmedia.net> wrote in message
news:BE92B1B4.5E93%an**@redcatmedia.net...
Hi all

I have a search function on a site of mine. At the moment, the content is
delivered using this:

<?php echo $row_Recordset1['content']; ?>

The search function goes through the table and displays the titles of the
pages that contain the term.

What I'd like to do is set it up so that when the visitor clicks on a
title,
it sends the search term as well, looks for it in
$row_Recordset1['content']; and puts <strong> before and </strong> after.

Does that make sense?

Also, I've just noticed something not right. The CMS takes a text box and
writes the HTML into the table. So, if I do a search on </li> for
example,
then it brings back results. I can't even begin to imagine a way round
this. In most cases this is unlikely to be a problem but I'd like to
think
there might be a way round it.

Any help would be gratefully received.

Andy

Jul 17 '05 #2


On 25/4/05 3:24 pm, in article 42******@nntphost.cis.strath.ac.uk, "Alistair
Baillie SS2002" <ab******@cis.strath.ac.uk> wrote:
convert < and > to &lt; and &gt; using html_specialcharacters() - ive prob
got the function name wrong -. and then search using that.

- Ali

But then doing a search on /li would still work, or any other HTML tags,
just without the <>.

I'm not convinced that it's a major problem as I can't think that anyone
using a site would be searching using HTML anyway. I've been trying to
think of something where a 'real' word that someone would search for might
also be an html tag but it's going to be rare, I think.

Andy

"Andy Jacobs" <an**@redcatmedia.net> wrote in message
news:BE92B1B4.5E93%an**@redcatmedia.net...
Hi all

I have a search function on a site of mine. At the moment, the content is
delivered using this:

<?php echo $row_Recordset1['content']; ?>

The search function goes through the table and displays the titles of the
pages that contain the term.

What I'd like to do is set it up so that when the visitor clicks on a
title,
it sends the search term as well, looks for it in
$row_Recordset1['content']; and puts <strong> before and </strong> after.

Does that make sense?

Also, I've just noticed something not right. The CMS takes a text box and
writes the HTML into the table. So, if I do a search on </li> for
example,
then it brings back results. I can't even begin to imagine a way round
this. In most cases this is unlikely to be a problem but I'd like to
think
there might be a way round it.

Any help would be gratefully received.

Andy



Jul 17 '05 #3
other than the words Strong, and Quote, I dont think you'll get any, and
assuming you use <b> then strong wont be a problem.

I beleive you can use Regular expressions within SQL searches, u could try
doing a search for where the wrod exists, but is not within a < > ?

but as you said, its unlikley to be a problem thats worth bothering about.

- ali

"Andy Jacobs" <an**@redcatmedia.net> wrote in message
news:BE92C371.5EAB%an**@redcatmedia.net...


On 25/4/05 3:24 pm, in article 42******@nntphost.cis.strath.ac.uk,
"Alistair
Baillie SS2002" <ab******@cis.strath.ac.uk> wrote:
convert < and > to &lt; and &gt; using html_specialcharacters() - ive
prob
got the function name wrong -. and then search using that.

- Ali


But then doing a search on /li would still work, or any other HTML tags,
just without the <>.

I'm not convinced that it's a major problem as I can't think that anyone
using a site would be searching using HTML anyway. I've been trying to
think of something where a 'real' word that someone would search for might
also be an html tag but it's going to be rare, I think.

Andy

"Andy Jacobs" <an**@redcatmedia.net> wrote in message
news:BE92B1B4.5E93%an**@redcatmedia.net...
Hi all

I have a search function on a site of mine. At the moment, the content
is
delivered using this:

<?php echo $row_Recordset1['content']; ?>

The search function goes through the table and displays the titles of
the
pages that contain the term.

What I'd like to do is set it up so that when the visitor clicks on a
title,
it sends the search term as well, looks for it in
$row_Recordset1['content']; and puts <strong> before and </strong>
after.

Does that make sense?

Also, I've just noticed something not right. The CMS takes a text box
and
writes the HTML into the table. So, if I do a search on </li> for
example,
then it brings back results. I can't even begin to imagine a way round
this. In most cases this is unlikely to be a problem but I'd like to
think
there might be a way round it.

Any help would be gratefully received.

Andy


Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
4
by: Ken Fine | last post by:
I'm looking to find or create an ASP script that will take a string, examine it for a search term, and if it finds the search term in the string, return the highlighted search term along with the...
3
by: Liz Malcolm | last post by:
Hello and TIA for guidance. I am building a reusable search procedure (thanks go to Graham Thorpe for his example that set me on my way). Everything works up until the 2nd match is found, the...
5
by: pembed2003 | last post by:
Hi all, I need to write a function to search and replace part of a char* passed in to the function. I came up with the following: char* search_and_replace(char* source,char search,char*...
2
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to start, pause and resume a recurrsive search exactly where you left off, say in the registry programmatically? -- Michael Bragg,...
4
by: BenCoo | last post by:
Hello, In a Binary Search Tree I get the error : Object must be of type String if I run the form only with the "Dim bstLidnummer As New BinarySearchTree" it works fine. Thanks for any...
4
by: ravindarjobs | last post by:
hi...... i am using ms access 2003,vb6 i have a form. in that i have 2 buttons 1. start search 2 stop search when i click the "start search" button the fucntion SearchSystem() is called,...
0
by: kang jia | last post by:
hi currently i am doing this search function for car booking website. it can search through either car seats or CarModel. it seems it able to do search function, however i small problem occurs to...
0
by: Atos | last post by:
Binary search is used to locate a value in a sorted list of values. It selects the middle element in the array of sorted values, and compares it with the target value; that is the key we are...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.