PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

filepath when search.php is in its own folder

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

  • filepath when search.php is in its own folder

    I have leftnav.php which has amongst other nav items

    <form method="get" action="search/search.php" target="_blank">
    <input type="text" name="zoom_query" size="15" />
    <input type="submit" value="Search" />
    </form>

    leftnav is an include that's included on every page of the site

    I have all of the zoom stuff in a folder called search

    when i test the search, by going to index.php I get the following error message

    Warning: fopen(./logs/searchwords.log) [function.fopen]: failed to open stream: No such file or directory in...

    I know the issue is search/search.php but I am not quite sure how to change the search.php page code to open the correct filepath

    Thanks for any assistance you can offer

  • #2
    If you wish to enable search word logging, make sure you read this support page thoroughly:
    http://www.wrensoft.com/zoom/support/logging.html

    You do not need to change the "search.php" code. The log path setting is specified in the Indexer.

    I presume "index.php" is your own PHP page which is embedding "search.php" (via an include() call for example). If this is not the case, please tell us what it is. Is this file in the same folder as "search.php"?

    Or did you just make a typo and did you mean to say "search.php" instead of "index.php"? Afterall, your search form is going to "search.php". It's a bit confusing from your description.
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      Hi there,

      index.php is the index page of my site

      In index.php I have a navigation include called leftnav.php

      leftnav.php only houses navigation links and is 125 px wide. at the top of these links I have inserted the search form code

      all of the zoom search files are in a folder called search

      www.domain.org/search/search.php
      www.domain.org/search/search_template.php

      when i use the search form, if I leave action="search.php" I get a 404 (because the search files are in a folder called search)

      If i change action to search/search.php I get a function error

      Hope this now makes more sense

      Comment


      • #4
        OK, that's fine, and should be unrelated to the log error.

        Read the support page I linked you to above, it goes into detail about how to set permissions and make sure you have the correct path for your logging file.

        It probably goes without saying, but if you just want to get rid of the error and don't care to get logging to work, you can just turn off logging ("Configure"->"Advanced" and uncheck "Log the searches made on your site"). You will need to re-index for any configuration changes to take effect.
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          Thanks for your reply and for pointing me to the page, which I have read.

          There are two separate things going on here: 1) the logging and 2) the filepath for the form search

          I have turned off the logging--that isn't the issue now.

          The issue is: What is the appropriate file path to use for the "action" part of the search form when the zoom search files are in a separate folder?

          Neither search/search.php or search.php work.

          The search form is part of a navigation list on a php page, which is then, in turn, included on all of the site's pages. (see http://www.ocuk.org/) for what I mean

          The user inputs search in the form in the navigation bar.

          The search results need to come up on a separate page.

          If the user types in a search query it comes up with an incorrect search result and the incorrect search page

          If I got to the www.ocuk.org/search/search.php page I get the following url--left nav is obviously doing something?

          http://www.ocuk.org/search/leftnav.php?zoom_per_page=10&zoom_and=0&zoom_sort= 0&zoom_query=canoe

          Thanks for your help

          Thanks for your help.

          Comment


          • #6
            It looks like you might have modified the Linkback URL setting in Zoom. From the Indexer, under "Configure"->"Advanced"->"Link back URL". Did you put "leftnav.php" here? It should probably be blank (which is the default) judging from your site.

            I don't see a problem when submitting a search from the other pages of your site (where you have your custom search form). It's only when I make a search on the "search.php" page itself that the problem is evident. So the action= attribute of your search form should be fine. Unless you have pages elsewhere on the website which is hosted under a subfolder, then the path need to reflect that as it is a relative path. An absolute path would be "/search/search.php".

            If you do not understand relative and absolute paths (which is quite crucial for all web development work), it's worth reading up on them.
            --Ray
            Wrensoft Web Software
            Sydney, Australia
            Zoom Search Engine

            Comment

            Working...
            X