PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

diferent server embedded search box strange results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • diferent server embedded search box strange results

    hello, i notice something strange when i try to embed search box in another server:

    when the same search box is embedded in domain-a.com it works perfectly
    in case of embedding this search box on page in domain-b.com (diferent ip) in url of search results im getting random x and y values like that: ...searchedword&x=8&y=11 this is giving me 404 because the url is wrong

    zoom v5.1 (1011)
    search box is embedded with document.write javascript
    it has absolute link to ../search.cgi
    server is linux
    apache v.1.3.37

    what im doing wrong please?
    i have embedded search box be4 in another domains to search domain-a.com from domain-b.com and it works well

    thank you very much for your help in advance
    ewa

  • #2
    The x and y values you are seeing ("&x=88&y=11") are not a part of Zoom. These would have to be created by your own pages or scripting.

    As you said that you are writing out the search form yourself from Javascript, this is likely to be adding the parameters. Since we did not write your Javascript, nor can we see what it is, we are unable to comment. You need to look at your JS to determine why this is so.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      hello ray,
      thank you for answer, is what im saying x an y looks like position and i did not declare any where this (i just say is pretty strange ) i really have no clou how this could happening if in one site exactly the same box works perfectly ah... javascript is only simple include like this:

      // JavaScript search box
      document.write('<form method="get" action="http://sitename.com/empresas/buscar/search.cgi"><div style="background: url(images/rbox.png) no-repeat left top; padding: 0px; height: 22px;"><input type="text" name="zoom_query" style="border: none; background-color: transparent; width: 110px; padding-left: 5px; padding-right: 5px;"><input id="Submit" type="image" src="images/sbutton.png" align="absBottom" style="border-style:none"></div></form><br/>');

      i really can't see any think what could add these random x and y numbers to url

      ewa

      Comment


      • #4
        The parameters may be added by other Javascript on your page. It may also be added by the target page through a redirect. Or the server may be configured to rewrite the URL and add the parameters. If you can give us the URL to the live site, we may be able to have a better guess.
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          should i postit urls here? or pm you please?

          ewa

          Comment


          • #6
            Either is fine. PM if you wish to keep your site private.
            --Ray
            Wrensoft Web Software
            Sydney, Australia
            Zoom Search Engine

            Comment


            • #7
              We've had a look at the site and it turns out that the problem is actually in the HTML search form quoted above (much to my surprise).

              In fact, the problem comes from the examples we gave in our FAQ page here. We were using image type buttons (ie. <input type="image" ... >) and this is an inherent nature of image type inputs, whereby "x" and "y" values corresponding to the position of the mouse click is sent by the browser (see this W3 page for more information). I was not aware of this until I took a closer look.

              Seeing as that is the case, we have now updated our support page with HTML that uses a different method of providing an image submit button. The updated example code will not send "x" and "y" parameters to the resulting script.

              So if you change your form HTML over to the method now given in the updated support page above, you should find that this will fix the issue.
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment


              • #8
                hello ray,
                thank you very much for your help, very tricky, yes! but im afraid is not the end... , moving styles fixes this strange addons, but there is one more think when the word is searched from domain-b.com im getting again 404, and results shows only from direct link example: when i click inside of adress bar then i hit enter. i didnot try it yet if this happens to in oposite situation like searching of site-b.com from site-a.com, because on site-a.com searchbox is working ok...

                thank you very much for your help
                ewa

                Comment


                • #9
                  OK, this time I'm sure it is due to something setup on your server hosting "domain-a.com". I believe there is URL rewriting setup to prevent hotlinking on your site based on the HTTP referrer. This is blocking direct linking to the "search.cgi" page from an external site.

                  You can test this by the following:
                  1) Submit the search word on your search box on "domain-b.com"
                  2) You should see the 404 page on "domain-a.com"
                  3) Click on the URL box at the top of your browser window, and press the "Enter" key. This re-submits the request without the HTTP referrer.
                  4) You should see that the exact same URL which returned 404 is now returning a working page.

                  In addition to the above, you can also see the hotlink prevention taking place when you try to link to an image file on a different domain. Try this by placing an image tag like <img src="http://domain-a.com/images/search.png"> on a page hosted on "domain-b.com". You will see that the image will not show up. This is because domain-a is blocking the request from domain-b.

                  For more information on hotlink blocking, see:
                  http://altlab.com/htaccess_tutorial.html
                  http://surprisehighway.com/blog/2006/02/how_to_prevent_hot_linking_and/

                  If you are using a CMS or additional script/backend systems, they may be enforcing this for you.

                  I was going to comment previously, on the strange behaviour that your site was returning 404 when additional parameters are given in the URL. This is normally not a problem UNLESS "x" and "y" happens to also be used by the script/page on your target site, which was not the case, although I had presumed that it might have been. So the earlier problem is really caused by the same thing here, and it is this hotlink blocking that is the real problem.
                  --Ray
                  Wrensoft Web Software
                  Sydney, Australia
                  Zoom Search Engine

                  Comment


                  • #10
                    hello ray,
                    thank you very much, you are big!
                    yes indeed i have htaccess protection (...RewriteRule \.(gif|jpe?g|png|swf|cgi)$ spacer.gif [NC,L]) and i checked twice my htaccess but some how i missed this part:"cgi)$" well, momeries... im so sorry, im just human
                    but at less we learn something ...

                    thank you very much
                    ewa

                    Comment

                    Working...
                    X