By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,481 Members | 1,199 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,481 IT Pros & Developers. It's quick & easy.

Search function

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a


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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.