Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Search within the html pages

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

    Default Search within the html pages

    I need help to create a search option on my index page ..

    I actually have more than 2000 HTML pages on my site ... each page contains details of different applications

    the url of HTML pages are like

    http://mydomain.com/application1.htm...34&version=1.1
    http://mydomain.com/application1.htm...34&version=1.2


    http://mydomain.com/application2.htm...56&version=2.0
    http://mydomain.com/application2.htm...56&version=2.1

    as the above HTML page urls have application code as well as versions

    I want if there is any code or script which when user input the code like above url code=1234 and the user will be redirected to the page containing the code as well as higher version ...

    like the code here for search
    Code:
    <form action="/test.html" method="get">
    <input type="text" name="Code" value=""/><br/>
    <input type="submit" value="GET IT"/>
    </form>

    I really appreciate your help
    Last edited by Beverleyh; 06-02-2013 at 07:03 PM. Reason: Formatting

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

    Default

    You need to use server side scripting like php to do it. Here is the code.
    Code:
    <? if ($_POST ['get_it']) {
    echo "<script language='javascript'>window.location='yoururl.html?code=".$_POST ['Code']."'</script>";
    } ?>
    <form  method="post">
    <input type="text" name="Code" value="<?=$_REQUEST ['code'] ?>"><br/>
    <input type="submit" value="GET IT" name="get_it">
    </form>
    Any problem do revert to me

    regards
    developer husain
    Last edited by Beverleyh; 06-02-2013 at 07:04 PM. Reason: Formatting

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

    Default

    thanks for your reply .. sorry to say actually i am not coder .. so it is bit diificult for me understand ..

    please help me how to use the given code

    but I have all html files only

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

    Default

    You said that in your earlier post that when you submit the code,it should redirect to page displaying code as well as higher version.What you do is open a file test.html and put the above code in it.

    PHP Code:
    <? if ($_POST ['get_it']) {
    echo 
    "<script language='javascript'>window.location='test.html?code=".$_POST ['Code']."'</script>";
    ?>
    <form  method="post">
    <input type="text" name="Code" value="<?=$_REQUEST ['code'?>"><br/>
    <input type="submit" value="GET IT" name="get_it">
    </form>
    What this form will do is when you submit the code it will redirect to same page and display the inputted code in the input field Code. And regarding displaying higher version associated with this code. Doing it in php mysql database can be really useful. If you don't want to do it in mysql database you can do like this to fetch the code as well as higher version

    PHP Code:
    <? 
    if ($_REQUEST ['Code']=="1234"$higher_version="2.1";
    if (
    $_REQUEST ['Code']=="346"$higher_version="1.1";

    echo 
    $higher_version."&nbsp;".$_REQUEST ['code'];

     
    ?>
    With this you can achieve what you want. If i have done anything which is contradicting your request.Please do write down your full request. I will definitely help you achieve what you want
    Last edited by keyboard; 06-03-2013 at 07:36 AM. Reason: Format: Php Tags [php][/php]

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

    Default

    I really get frustrated .. I put the above code in between the body tag of test.html .. the result is as in picture shown ..

    I don't use any database .. I have created only html pages linked to one another ... Please help

    Click image for larger version. 

Name:	111.jpg 
Views:	133 
Size:	27.9 KB 
ID:	5076

    need desperate proper help
    Last edited by jscheuer1; 06-04-2013 at 08:18 AM. Reason: merge

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

    Default You should put this code in .php page

    You should put this page in .php code. Miss Janu. .html does not help you in being dynamic in your website. I have myself developed a website which is down now in .htm page using frames.You can't do anything dynamic.The above given code will not work in html. It can only be used in php page.

    Here is another code much easier for you.This has been tried and tested in php page.This will definitely serve your purpose if you put this in .php page
    PHP Code:
    <form action="test.php?code=<?=$_POST['Code'?>" method="get">
    <input type="text" name="Code" value="<?=$_REQUEST['Code'?>"/><br/>
    <input type="text" name="Version" value="<?
     
    if ($_REQUEST ['Code']=="1234") echo "1.1";
     else if (
    $_REQUEST ['Code']=="3234") echo "2.1"
     
    ?>"/><br/>
    <input type="submit" value="GET IT"/>
    </form>
    Any other request. you can tell me i'm ready to help you

    Regards
    developerahusain
    Last edited by jscheuer1; 06-04-2013 at 08:17 AM. Reason: Format

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,167
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    Please use the forum's bbcode tags to make posts more readable:

    for php code............[php] <?php /* code goes here */ ?> [/php]
    for html...............[html] <!-- markup goes here -->.....[/html]
    for js/css/other.......[code] code goes here................[/code]


    I and other moderators have been doing this for you. But you've been around awhile now, so please start using proper formatting for code when posting.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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

    Default

    Ok Sir, I will do as suggested .. waiting for postie help

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

    Default

    Try the code in php page as i have said miss janu. If not i will provide you with javascript for achieving the task.Any problem do revert because i have done lot of coding like this
    regards
    developerhusain

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

    Default

    sorry I came online after few days .. thanks for your kindness .. please help me in any ways to achieve this ...

Similar Threads

  1. search keywords in all pages in my website
    By lvenkatesh in forum PHP
    Replies: 4
    Last Post: 10-27-2012, 05:08 AM
  2. Resolved My html pages got problem
    By xaverius in forum HTML
    Replies: 7
    Last Post: 02-19-2012, 10:59 AM
  3. fade two .html pages
    By skizo in forum JavaScript
    Replies: 19
    Last Post: 02-28-2011, 03:14 PM
  4. HTML/CSS Pages
    By salvo in forum Looking for such a script or service
    Replies: 0
    Last Post: 02-08-2008, 09:25 PM
  5. HTML Pages in XP
    By BNVSAJ in forum CSS
    Replies: 8
    Last Post: 09-11-2007, 08:35 AM

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
  •