SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question form action, setting target

    hey friends,

    I have following code from search engine´s site search feature, that I want to place on my personal page :
    <form action="search provider url">
    <table>
    <tr>
    <td>
    <img src="image link" alt="Clusty" />
    </td>
    <td>
    <input name="query" />
    <input name="host" type="hidden" value="yoursitedotcom" />
    <input name="tb" type="hidden" value="sitesearch-site" />
    </td>
    <td>
    <input type="submit" value="Search" />
    </td>
    </tr>
    </table>
    </form>

    It redirects to search engine&#180;s webpage to display search results. how can I set target to get results on my own page ?

    thanks in advance

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It's not going to happen automatically, how would the browser know where to put the search results?

    You should check out Google Custom Search which lets you put a Google-powered site search onto your own webpage:

    http://www.google.com/cse/

  3. #3
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi thanks for reply.
    I am not using google custom search.I am using another search engine and cited code is provided by them, but that does not let us view results on own page, it redirects to their page.

    I know that we can set target to get the display on own page. I do not know how..any idea ?

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2009
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since the search is handled by the search engine website, it has to redirect it to their web site. There can be two solutions:
    1. You create a frame on your search page. set the target field of the form to be the frame name/id. Still the results are from the search engine website; but it could be made appear that the visitor didn't leave your website.

    2. If the search engine website exposes an API, you could write a script that uses the API but displays the results in its own way.

  5. #5
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by prasanthmj View Post
    Since the search is handled by the search engine website, it has to redirect it to their web site. There can be two solutions:
    1. You create a frame on your search page. set the target field of the form to be the frame name/id. Still the results are from the search engine website; but it could be made appear that the visitor didn't leave your website.

    2. If the search engine website exposes an API, you could write a script that uses the API but displays the results in its own way.
    Hey Prashant,
    Looking to the code I mention, i would appreciate if you can provide me code implementing one of the solution you suggested.

    thanks,

  6. #6
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to display ONLY search results(body of the result page) on my personal page, without header of search engine page.


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
  •