Using htdig search engine tool with php and Computer Engineering webhosting

This page is for clients who do their webhosting with computerengineering.ca and want to add the free htdig local search engine tool to their website using php.

Step 1: Ask for htdig

Request htdig php services by sending support an email. It is part of your webhosting services.

Step 2: run htdig

The first time you create this, you will need to run htdig. This can be done by ssh'ing into the web server, and running a command at the command line:

/usr/bin/rundig -v -s -c ~/conf/htdig.conf
. Too complicated? Email support, and we'll do it for you.

We will also set up a "cron job" to refresh your database periodically so that you can have your website search catch new web pages that you have created.

Step 3: Put the following code into your website:

Make sure that you change the <yourhomewebdirectoryhere> to your home directory name. Go ahead and email us if you don't know what that is. Be sure to include your domain name in the email address so we know who you are.

Remember to have a ".php" suffix on your web page. This is only a section of your web page. It will need the usual html code at the top and below this code that all web pages need.

<!-- start htdig section -->
<?php
    foreach ( $_POST as $key => $value ) {
        $$key = trim( $value );
    }
    if ( isset( $f_search_submit ) && ! empty( $f_search_submit) ) {
        include( "class.htdig.php" );
        $l_htdig = new htdig;
        $l_htdig->htsearch( $f_search,"","/home/<yourhomewebdirectoryhere>/conf/htdig.conf" );
    }
?>
<h1>htdig Website Hosting Search</h1>
<form method="post" action="<?php echo $PHP_SELF; ?>">
    Search for: <input type="text" name="f_search" SIZE=30 value="<?php echo $f_search; ?>">
    <input type="submit" name="f_search_submit" value="Search">
</form>
<?php
    if ( isset($f_search_submit) && ! empty ( $f_search_submit) ) {
        $l_result_code = $l_htdig->display_results( );
    }
?>
<!-- end htdig section -->

For more information about our products and services, please phone us at (587) 410 0617 (within Edmonton, Alberta, Canada), (587) 316 5118 (within Calgary, Alberta, Canada), 1 (877) 864 2168 (Saskatoon), (647) 499 1311 (Toronto), (604) 757 1251 (Vancouver)1-877-864-2169 (toll free within North America).

Copyright © 2004-2015 Computer Engineering Inc. All rights reserved.
links | search | add your URL - link exchange
Get our small business packaging including card design, logo, and simple website free domain name with web hosting Canadian php5 web hosting - Edmonton, Calgary, Alberta, Toronto, Ontario Canadian Windows 2003 ASP web hosting - Edmonton, Calgary, Alberta, Toronto, Ontario Stop Spam Here  Use OpenOffice.org