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 3 1735
convert < and > to < and > 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
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 < and > 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
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 < and > 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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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,...
|
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...
|
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...
|
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*...
|
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,...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |