473,387 Members | 1,711 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,387 software developers and data experts.

trying to modify my search script

I am modifying a search script, but when I change it, it only searches for 2 of the 3 fields. I believe the problem is in a chunk of it here.
Expand|Select|Wrap|Line Numbers
  1. if( $INFO[0] eq "$FORM{title}" && $INFO[1] =~ /$FORM{subject}/ && $INFO[2] =~ /$FORM{search}/ ) {
it only searches for the title and the search is a text line. i need it to search for the title subject, and search categories.

How can i change this code so it searches for all 3?
Sep 10 '08 #1
4 1176
numberwhun
3,509 Expert Mod 2GB
Why are you using "eq" for the first match, but regex's for the rest? Without seeing what its trying to match and the rest of the code, its going to be tough to help you.

Regards,

Jeff
Sep 10 '08 #2
eWish
971 Expert 512MB
Currently the way it is written, you must match on three occurrences before it will enter inside of the if statement. Would you rather search for a match on any of the three elements?

--Kevin
Sep 10 '08 #3
Currently the way it is written, you must match on three occurrences before it will enter inside of the if statement. Would you rather search for a match on any of the three elements?

--Kevin
ideally the script would search for any input given.
Sep 10 '08 #4
eWish
971 Expert 512MB
Then you would need to use the || in lieu of &&

Expand|Select|Wrap|Line Numbers
  1. if ($FORM[0] eq $title || 
  2.     $FORM[1] eq $subject || 
  3.     $FORM[2] eq $search) {
  4.  
  5. ....then do something here....
  6.  
  7. }
I hope that you are checking your data first. Never trust the user's input.

--Kevin
Sep 10 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Patrick | last post by:
Are the differences between a search engine, a subject directory and a meta search engine significant for an ebusiness web site owner? A meta search engine merely uses ordinary existing search...
1
by: it hates me | last post by:
Hey gang, I hope you're all well and you're having an enjoyable week I'd love to be able to have a custom news feed on my web page through Javascript The only custom news feed I can find for...
2
by: Benjamin Rutt | last post by:
I often execute a long-running python script which is a "driver" for my application; it may run for several hours on a large input. Under CPython, is it safe for me to modify the Python script...
13
by: Ray Muforosky | last post by:
Hello all: Task: I want to do file search, using the "conatining text" option from a web page. How do I search for a file on my local drive containing a certain string, from a web page. That...
9
by: Boris Yeltsin | last post by:
I use Master Pages, so I make use of URL rebasing through the ~ operator, like this in the <head>: <link runat="server" href="~/Root.master.css" media="screen" rel="stylesheet" type="text/css" />...
0
by: Grant Schenck | last post by:
Hello, Looking for some advice. I'm trying to build an Internet Explorer add on in C# which would modify a page as or just after it is downloaded by searching the page contents and replacing...
23
by: no1zson | last post by:
I have been adding buttons to my GUI to manipulate list data. I added a Delete button this morning in case I decide I no longer needed a particular element. I am now working on a modify button, in...
6
by: Doogie | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.