Web Design Forums

HTML and CSS Help

Having problems with these web design scripting? Ask here.

searching html content



Site of the Month Nominations
ENTER YOUR SITE NOW!

Reply
 
LinkBack Thread Tools
Old June 13 '09, 09:16 AM (#1)
ketanco is offline
WDF Regular
 
ketanco's Avatar
 
Join Date: October 2007
Posts: 228
ketanco is an unknown quantity at this point
searching html content

Is anybody able to tell me how can I make a search box for searching the html content of my website? Also I have many htm files, I want them searched too...

Or, should I just paste one from yahoo or google and that woudl solve the problem? (I mean are they for searching the html of MY site or the whole web?)

Lastly, I already have a search box for searching the data in my mysql databases. Is there a way to have a combined searchbox that is able to seach both the htm, html and mysql portions of my website?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 13 '09, 03:41 PM (#2)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,401
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
Usually, the HTML page is generated from a database.
So searching the HTML is not necessary. But you must have
some static web pages?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 14 '09, 02:17 PM (#3)
imagn is offline
WDF Regular
 
imagn's Avatar
 
Join Date: July 2007
Location: Los Angeles
Posts: 156
imagn will become famous soon enough
You can PHP's CURL to "read" your static pages and then run regular expression to search for whatever your visitors entered.

Have you looked into adding Google search? The free version displays the small ads and there is a cheap paid version ($100/year) that omits them.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 14 '09, 02:18 PM (#4)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
hey i was just thinking about the google search tool imagn. thx for the info
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 14 '09, 04:17 PM (#5)
ketanco is offline
WDF Regular
 
ketanco's Avatar
 
Join Date: October 2007
Posts: 228
ketanco is an unknown quantity at this point
well, yes I might have some static pages, because for one page, the content will vary greatly in format from one week to another, so if I use php i will be stuck with just one format, though it will be automatic. so thats why i wanted to see how can i search static pages as well.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 14 '09, 04:23 PM (#6)
Dorky is offline
Freelance
 
Dorky's Avatar
 
Join Date: June 2009
Location: Destin Florida
Posts: 905
Dorky will become famous soon enough
nono you can use conditional php (if) statements for entire divs or an entire layout for that matter.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 15 '09, 02:30 PM (#7)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,401
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
Let's say you search for a word somewhere within your HTML pages.
Example, the word "photograph" ...
What happens when it finds that word in your HTML?

Does it display the whole page?
Does it display the line where it was found?

That's the problem with searching your HTML ...
What will you do with your result(s) ... and what if you have 50 results from 3 pages?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 15 '09, 07:33 PM (#8)
imagn is offline
WDF Regular
 
imagn's Avatar
 
Join Date: July 2007
Location: Los Angeles
Posts: 156
imagn will become famous soon enough
You would use the array functions to combine same-page hits and just display a list of those returned. You could even add a psuedo-relevancy score by the number of hits on a given page. Once you're on the page you can also use a reg exp to highlight the word(s) a user looked for.

It can be a bit of a pain which is why I still say Google
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 18 '09, 08:40 AM (#9)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,401
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
Trace ...
Not sure what that means.

You mean searching for HTML tags, like <div> and <body> and <img src>?
Or text between tags? HTML really has nothing worth searching.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 19 '09, 09:33 PM (#10)
drwatz0n is offline
New Member!
 
drwatz0n's Avatar
 
Join Date: June 2009
Location: New York, USA
Posts: 2
drwatz0n is an unknown quantity at this point
Send a message via AIM to drwatz0n Send a message via MSN to drwatz0n
Quote:
Originally Posted by Dorky
nono you can use conditional php (if) statements for entire divs or an entire layout for that matter.
Well, he could do that, but it would require some modification to his site. As of now, all he would like to do is integrate some sort of search system.

Would it be possible to create your own list of search "terms", and once the search is performed, return a list of articles/content relating to the term? If your page contains a lot of static HTML pages, then I would assume you have some sort of understanding/naming scheme for the pages (say "may_photos", or "fall_photos"). For example, searching "photos" would return a list of all of your static pages that fit with "photos".

The upside to this is that you don't need to search every single page of your site, or convert it to some sort of heavily-PHP based system, which isn't something you have now (from what I was able to garner). The downside is that you must define each of the results returned for each query. Once it's set up, it should be fairly easy to maintain, but, depending on the size of your site, may take some time to set up fully.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old June 20 '09, 10:16 AM (#11)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,401
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
Dr.

Quote:
Would it be possible to create your own list of search "terms", and once the search is performed, return a list of articles/content relating to the term?
That's the whole point of having the "content" in a database to begin with.
Going back to post #2 ... there would be no reason to search each HTML page.

If someone is manually adding content "articles" to each static page manually,
then they are pretty much beyond the use of PHP to search their site.
Do you see what I mean?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » HTML and CSS Help

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database vs html content for SEO ketanco Search Engine Optimization / SEO 0 February 15 '09 02:36 AM
firefox problem diddy HTML and CSS Help 3 August 18 '08 08:45 PM
How do I wrap a div in another? Jason HTML and CSS Help 4 May 18 '07 05:26 PM
Layout Basics JR Coding Articles & Tutorials 13 April 29 '05 11:02 AM

 
User Infomation
Your Avatar

Site Of The Month

Ticket Cake
Ticket Cake

Ticket Cake is a drupal based event ticketing platform. It features that ability to browse events and share them.

Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 02:40 AM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163