Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Search within html <body> tags

  1. #1
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Search within html <body> tags

    I need to help create a Page for search like this


    I have more than 500 html pages , every page contains different codes in between <body></body> tags
    like

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>my title</title>
        <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
        <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->
        <script type="text/javascript" src="jquery.js"></script>
    </head>
    <body>
    here is the code like 234556 with some other contents
        
    </body>
    </html>
    when user give input like this



    The Search Result Should Come out like this


  2. #2
    Join Date
    Aug 2009
    Location
    charset utf-8
    Posts
    144
    Thanks
    4
    Thanked 5 Times in 5 Posts

    Default

    So you are trying to search within that page, or search all the pages?

  3. #3
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    obviously within all pages .. if similar code is found in more than one page that should come out by search

    sorry I don't know whether I am asking appropriate question because I am zero in web coding

  4. #4
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,718
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    You're gonna hate this answer, but it would be best to create a database and upload all of the pages into a table in your database. From there you can search the table for the relevant data.

    It sounds like it would take forever to do and really difficult to do as well, but you can also create a fairly simple program to upload the pages into your database. We can help you do that and more as I am sure that there are people on this forum who have had to do this or something similar when they were in the same boat or close to it. After you have it uploaded into your database you can get rid of 499 of your 500 pages. Your one remaining page will most likely be a lot smaller than any one page and it will be easier to manage as well.

    If you wanted to avoid the database you could create a rather complicated search program that will systematically open and close all of your pages and store the results in another file. I can't say for certain, but that sounds like it would be extremely processor heavy on your server and take a long time to run. It wouldn't work as well as a MySQL database that is designed to organize and search through all of your information.
    To choose the lesser of two evils is still to choose evil. My personal site

  5. #5
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, well as I said in my post #3 that I am zero in web coding .. My aim is to achieve like

    index.page have links like this

    page.1
    page.2
    page3.
    so on
    when clicked on page1. it opens another page containing more links to go another page ..
    I got difficult to create individual HTML pages as the size of site is going very huge

    I am looking for a guide to help me how a single HTML template page will handle

    like when i click on page1 link on index
    mydomain.com/folder/page_1.html?value=1&value=2&value=3

    then it might be easy for master to help to make search option

  6. #6
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,718
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    I don't know much about your situation or what kind of hosting service you use, but it does not sound like you are using a database at all. The first thing you need to do is set one up through your hosting service. After that take a look at the following to help you get started. It has a few examples for connecting to your database.

    http://www.php.net/manual/en/mysqlinfo.api.choosing.php

    If you are creating more and more pages you can imagine how much harder it will be to manage your site. Imagine how hard it would be to manage if you have to update all of those pages if they are not static.

    I'm sorry to say that I am not really familiar with a good tutorial for setting up a database. I believe I used a book at the time, which I am sure is quite out of date now.
    To choose the lesser of two evils is still to choose evil. My personal site

  7. #7
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,363
    Thanks
    31
    Thanked 140 Times in 135 Posts
    Blog Entries
    32

    Default

    Are you looking for something like this? In that case, no data base needed, just one central page and a lot of iframed pages.
    If that's wht you want, I could help you further.

  8. #8
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Sir, this is what I am looking for .. but slightly different

    you have used here one central page instead of which I want to use a page of template and apart from this you have used drop down to go to another page instead of which I intend to use links .. Hope I will be helped

    like this way

    Ist page



    2nd page



    3rd page



    Please have a look on url also

    on the other hand in SEARCH BY VERSION tab .. a page of search for code when user input it in text box so that when code is submitted the user should be direct to that page or the content of that page should be display on the same search page ... Hope I will get help soon

    but all without database
    Last edited by janu; 07-02-2013 at 03:02 PM.

  9. #9
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,363
    Thanks
    31
    Thanked 140 Times in 135 Posts
    Blog Entries
    32

    Default

    EDIT: Corrections
    THIS is closer to what you want, although the URLs are slightly different.
    Pages:
    applications.html
    Code:
    <!doctype html>
    <!doctype html>
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    
    
    <title></title>
    
    <style>
    body {font-family: verdana; font-size: 12px; background: #dedede;}
    </style>
    
    </head>
    
    <body >
    
    <div style="position: relative; text-align: center; top: 20px">
    <button onclick="window.location.href='applications.html'">HOME (applications)</button> <button>SEARCH BY VERSION</button> <button>ABOUT</button>
    </div>
    
    <div id="container" ></div>
    
    <div style="position: absolute; top:80px; left:50px; right: 50px; bottom: 50px; border: 1px solid black; padding: 10px; background: white">
    <div style="font-size: 190%; font-weight: bold">List of applications:</div>
    <ul style="margin-top:20px">
    <li><a href="javascript: void(0)" onclick="top.location.href='applications.html?whatsup.html'; return false">Whatsup</a><br><br>
    <li>Opera<br><br>
    <li>Skype<br><br>
    <li>Mozilla
    </ul>
    </div>
    
    
    <script>
    if(location.search){top.document.getElementById('container').innerHTML='<div style="position: absolute; top:80px; left:50px; right: 50px; bottom: 50px; border: 1px solid black; "><iframe name="ifr" src='+location.search.substring(1)+' style="position: absolute; width: 100%; height: 100%; background: white; z-index:1" frameborder="0"><\/iframe><\/div>'}
    </script>
    
    </body>
    
    </html>
    whatsup.html:
    Code:
    <!doctype html>
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    
    
    <title></title>
    
    <style>
    body {font-family: verdana; font-size: 12px; background: white}
    </style>
    
    </head>
    
    <body >
    
    <div style="position: absolute; top:0px; left:0px; right: 0px; bottom: 0px; border: 0px solid black; padding: 10px; background: white">
    <div style="font-size: 190%; font-weight: bold">Whatsup versions and codes:</div>
    <ul style="margin-top: 20px">
    <li><a href="javascript: void(0)" onclick="top.location.href='applications.html?whatsup.html?versions.html'; return false">Version 1.1 Code: 2435</a><br><br>
    <li>Version 1.2 Code: 5687<br><br>
    <li>Version 2.11 Code: 0986<br><br>
    <li>Version 2.2 Code: 7098
    </ul>
    </div>
    
    
    <script>
    if(location.search){top.document.getElementById('container').innerHTML='<div style="position: absolute; top:80px; left:50px; right: 50px; bottom: 50px; border: 1px solid black"><iframe src='+location.search.substring(1)+' style="position: absolute; width: 100%; height: 100%; background: white; z-index:1" frameborder="0"><\/iframe><\/div>'}
    </script>
    
    </body>
    
    </html>
    versions.html:
    Code:
    <!doctype html>
    <html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    
    
    <title></title>
    
    <style>
    body {font-family: verdana; font-size: 12px; background: white}
    </style>
    
    </head>
    
    <body >
    
    <div style="position: absolute; top:0px; left:0px; right: 0px; bottom: 0px; border: 0px solid black; padding: 10px; background: white">
    <div style="font-size: 190%; font-weight: bold">Download Whatsup Versions 1.1 Code: 2435</div>
    <BR>DOWNLOAD
    </div>
    
    </BODY>
    
    </HTML>
    Last edited by molendijk; 07-02-2013 at 11:56 PM. Reason: Corrections

  10. #10
    Join Date
    May 2013
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks you very much .. it is really hard to help me .. I really salute your help ..
    But again I have to create separate HTML pages .. I was expecting I might get something like
    that I should have only a template page where other pages contents are called to display ... let it be server side script only .. my hosts have PHP support

Similar Threads

  1. How do I add search Related Tags to my site?
    By vjboc in forum Looking for such a script or service
    Replies: 0
    Last Post: 11-14-2011, 08:53 PM
  2. Replies: 2
    Last Post: 11-24-2009, 07:53 PM
  3. Replies: 11
    Last Post: 06-15-2008, 04:13 PM
  4. 2 onload tags in the body tag
    By Frazmand in forum JavaScript
    Replies: 3
    Last Post: 07-26-2006, 08:04 PM
  5. HTML: Body Onloads!
    By wmcobra3670 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 01-07-2006, 07:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •