• Resolved Sany

    (@sannny)


    Hey guys,

    I want to export my WordPress website to static HTML. I found the tool HTTrack and it works fine.

    The problem is, that of course, the search functionality isn’t working anymore, cause of php. Does anybody know a solution? Maybe a plugin or something like that/ JavaScript/ etc.?

    I would appreciate an answer.
    Thank you and have a nice weekend.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Well you could use javascript to service a text box, and use either AJAX or a load of a PHP file on your server to run the search and display the results, but then you have defeated the whold static HTML file thing, the results would most naturally be other PHP files, but you could make it search your HTML files instead.
    Why are you trying to do this ? Why the static HTML ?

    Thread Starter Sany

    (@sannny)

    Thanks for your answer. I thought about searching all HTML files, I just don’t know how to realize.. Can JavaScript do this, too?

    I want to do this because the website should work offline on a CD/DVD.

    I just don’t know how to realize..

    There is a program called “grep”, you can probably get it to be run on your server and use PHP to masage the results into your display.

    Can JavaScript do this, too?

    Well probably not, javascript runs in your browser, which does not have access to all the files on your server.

    Thread Starter Sany

    (@sannny)

    Okay, thank you. Does PHP in order to display the results still works in static HTML? Cause I thought PHP stuff doesn’t work.

    This is how it will go:
    EITHER:
    Any of your HTML files which has a search box loads javascript to service the search box. The javascript uses AJAX to communicate the search to the server.
    OR
    The searchbox is part of a form, activating the search submits the form.
    Submitting the form activates a script on the server.

    In each case the server has some PHP which is activated by the search request. This PHP assembles the search into a command line (probably using grep), it runs the command and collects the results. The PHP then formats the results into clickable links and provides back to the browser these results, either as a page or for display by javascript.

    So the bottom line is that your server will be running PHP or other scripting. A database is not required.

    Awesome thanks, I had the same problem with https://www.wowdate.co.uk/. But now Il give this a try.

    Thread Starter Sany

    (@sannny)

    Yes, I will give this a try, too. Thank you very much.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Export static HTML with offline search functionality’ is closed to new replies.